영수증 첨부
diff --git a/front/src/main/resources/templates/record/income/index.html b/front/src/main/resources/templates/record/income/index.html
index 04d0fc48..f72eca0e 100644
--- a/front/src/main/resources/templates/record/income/index.html
+++ b/front/src/main/resources/templates/record/income/index.html
@@ -248,10 +248,36 @@
$('#modelOcr').hide();
$('#btnOcr').removeClass('active');
} else {
- $('#modelSelf').hide();
- $('#btnSelf').removeClass('active');
- $('#modelOcr').show();
- $('#btnOcr').addClass('active');
+ ajaxUtil._ajaxSyncMethod(
+ '/api/record/receipt/INCOME/count',
+ {},
+ (response) => { // 성공
+ if(response < 3) {
+ debugger
+ $('#modelSelf').hide();
+ $('#btnSelf').removeClass('active');
+ $('#modelOcr').show();
+ $('#btnOcr').addClass('active');
+ $('#countOcr').val(response);
+ }else{
+ etUI.dialog.alert({
+ title: '',
+ message: '영수증은 일일 최대 3개 등록 가능합니다.',
+ type: 'alert',
+ callback: function () {
+ },
+ });
+ }
+ },
+ function (code, rstData) { // 실패
+ console.log("error : ", code);
+ },
+ 'get',
+ 'json'
+ );
+
+
+
}
},
createVaild() {
@@ -272,9 +298,17 @@
);
},
addFileInput() {
- // 여기에서 파일 첨부 몇개인지 확인하고 하루 3개,,,, 총 6개씩,,,
-
-
+ const countOcr = $('#countOcr').val();
+ if(uploadedReceipt.length === 3 - countOcr ){
+ etUI.dialog.alert({
+ title: '',
+ message: '영수증은 일일 최대 3개 등록 가능합니다.',
+ type: 'alert',
+ callback: function () {
+ },
+ });
+ return;
+ }
const fileInput = document.createElement('input');
fileInput.type = 'file';
@@ -385,8 +419,8 @@
const receiptDataList = uploadedReceipt;
if (!receiptDataList.length) {
etUI.dialog.alert({
- title: '등록 실패',
- message: '등록할 영수증 데이터가 없습니다.',
+ title: '',
+ message: '최소 1개의 영수증을 등록해주셔야 합니다.',
type: 'alert',
callback: function () {
},