Merge branch 'susu' into dev
# Conflicts: # front/src/main/resources/static/assets/scripts/common.ui.js # front/src/main/resources/static/assets/styles/style.css
This commit is contained in:
@@ -69,4 +69,14 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="removeDailyExpenseReceipt">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'EXPENSE'
|
||||
<if test="id != null and id != ''">
|
||||
and receipt_type_id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -70,4 +70,14 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="removeDailyIncomeReceipt">
|
||||
update receipt_has_record set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and type = 'INCOME'
|
||||
<if test="id != null and id != ''">
|
||||
and receipt_type_id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -17,4 +17,12 @@
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectReceiptCount">
|
||||
select count(*)
|
||||
from receipt_has_record
|
||||
where created_by = #{userId}
|
||||
and created_at = CURRENT_DATE
|
||||
and type = #{inputType}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -330,6 +330,5 @@ var ajaxUtil = {
|
||||
ajaxUtil.loadingStatus = true;
|
||||
// TODO : 로딩바 활성화
|
||||
document.querySelector('#loadingBar').style.display = 'block';
|
||||
debugger
|
||||
},
|
||||
};
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(true)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(true)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div class="loading" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<div class="loading dimmed" id="loadingBar" style="display: none"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<section th:replace="~{common/components :: header(false)}"></section>
|
||||
|
||||
<div id="container" layout:fragment="content">
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
<!--/* 영수증 등록 s */-->
|
||||
<div id="modelOcr" style="display: none;">
|
||||
<section class="form-group">
|
||||
<input type="hidden" id="countOcr"/>
|
||||
<div class="segment-label">
|
||||
<p class="label-txt">
|
||||
영수증 첨부
|
||||
|
||||
@@ -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,14 +298,25 @@
|
||||
);
|
||||
},
|
||||
addFileInput() {
|
||||
// 새로운 input type="file" 요소 생성
|
||||
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';
|
||||
fileInput.accept = 'image/*';
|
||||
fileInput.style.display = 'none';
|
||||
fileInput.name = 'file';
|
||||
|
||||
// 파일 선택 시 이벤트 처리
|
||||
// 파일 선택
|
||||
fileInput.addEventListener('change', (event) => {
|
||||
const files = event.target.files;
|
||||
const previewContainer = $('#file-upload-container');
|
||||
@@ -330,7 +367,6 @@
|
||||
`);
|
||||
previewContainer.append(fileItem);
|
||||
|
||||
// 파일 정보와 서버 응답 저장
|
||||
uploadedReceipt.push({
|
||||
fileId: fileItemId,
|
||||
file: file,
|
||||
@@ -383,8 +419,8 @@
|
||||
const receiptDataList = uploadedReceipt;
|
||||
if (!receiptDataList.length) {
|
||||
etUI.dialog.alert({
|
||||
title: '등록 실패',
|
||||
message: '등록할 영수증 데이터가 없습니다.',
|
||||
title: '',
|
||||
message: '최소 1개의 영수증을 등록해주셔야 합니다.',
|
||||
type: 'alert',
|
||||
callback: function () {
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user