[FO] 마이페이지 수정 + [BO] 임가현황 작업 중 ..

This commit is contained in:
kangsunlee
2025-06-23 20:45:53 +09:00
parent 8d604014db
commit e8b2ee1bf1
6 changed files with 195 additions and 67 deletions

View File

@@ -7,7 +7,7 @@
<div class="inner">
<hgroup class="tit-group">
<h3>
<strong>은행 자동이체(지출) 내역 <span>[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
<strong>은행 자동이체(지출) 내역 <span id="totalItems">[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
</h3>
<p>지출 내역을 등록해 주세요.</p>
</hgroup>
@@ -245,7 +245,7 @@
clearAllItems.style.display = "none";
}
},
openAddForm() {
openAddForm(callback) {
ajaxUtil._ajaxAsyncMethod(
"/api/front/info/bank/create/output/from",
{},
@@ -289,6 +289,9 @@
ENV.module.modalPopup.open();
document.querySelector('.modal-content').scrollTop = 0;
// 모두 로드된 후 콜백 실행
if (typeof callback === 'function') callback();
},
function(code, rstData) {
kri.logger.error('Do nothing. code: '+ code, rstData);
@@ -417,20 +420,18 @@
const product = ENV.data.bankList.find(p => p.id == id);
if (!product) return;
this.openAddForm();
setTimeout(function(){
this.openAddForm(() => {
const form = document.getElementById('popupForm');
if (!form) return;
Object.entries(product).forEach(([key, val]) => {
const field = form.elements.namedItem(key);
if (field) {
field.value = val;
if(key == 'transferCategoryCode' && val == "code.bank.input.self"){
document.getElementById(val+"_value").value = product["transferCategory"];
if (key === 'transferCategoryCode' && val === "code.bank.input.self") {
document.getElementById(val + "_value").value = product["transferCategory"];
}
if(key == 'unitCode' && val == "code.record.unit.self"){
if (key === 'unitCode' && val === "code.record.unit.self") {
document.getElementById("unitDiv").style.display = "";
}
}
@@ -439,20 +440,40 @@
ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
document.getElementById("unit").value = product.unit;
},100)
});
},
// 선택 아이템 삭제
deleteItemById(id) {
ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id);
const target = document.querySelector(`#listBody div[data-id='${id}']`);
if (target) target.remove();
this.updateLayout();
etUI.dialog.alert({
title: '삭제 안내',
message: '등록하신 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.',
type: 'confirm',
dialogType: 'confirm',
callback: function () {
ENV.data.bankList = ENV.data.bankList.filter(p => p.id != id);
const target = document.querySelector(`#listBody div[data-id='${id}']`);
if (target) target.remove();
formControl.updateLayout();
},
});
},
// 전체 초기화
clearAllItems() {
location.reload();
etUI.dialog.alert({
title: '초기화 안내',
message: '등록하신 모든 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.',
type: 'confirm',
dialogType: 'confirm',
callback: function () {
ENV.data.bankList = [];
document.getElementById('listBody').innerHTML = '';
formControl.updateLayout();
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
document.getElementById('totalItems').textContent = ENV.data.bankList.length;
},
});
},
goSave() {