[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>
@@ -246,7 +246,7 @@
clearAllItems.style.display = "none";
}
},
openAddForm() {
openAddForm(callback) {
ajaxUtil._ajaxAsyncMethod(
"/api/front/info/bank/create/input/from",
{},
@@ -298,6 +298,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);
@@ -423,11 +426,9 @@
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);
@@ -446,20 +447,39 @@
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() {

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() {

View File

@@ -8,7 +8,7 @@
<hgroup class="tit-group">
<h3>
[[${currentMonthlyInfo.koreanMonth}]]의 <br>
<strong>임산물 현황 <span>[[${currentList.totalElements}]]</span>건 등록</strong> 되었습니다.
<strong>임산물 현황 <span id="totalItems">[[${currentList.totalElements}]]</span>건 등록</strong> 되었습니다.
</h3>
<p>임산물 현황을 등록해 주세요.</p>
</hgroup>
@@ -298,7 +298,7 @@
},
// 등록폼 추가
openAddForm() {
openAddForm(callback) {
ajaxUtil._ajaxAsyncMethod(
"/api/front/info/monthly/create/from",
@@ -341,6 +341,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);
@@ -461,11 +464,10 @@
const product = ENV.data.productList.find(p => p.id == id);
if (!product) return;
this.openAddForm();
setTimeout(function() {
this.openAddForm(() => {
const form = document.getElementById('forestForm');
if (!form) return;
Object.entries(product).forEach(([key, val]) => {
const field = form.elements.namedItem(key);
if (field) {
@@ -485,7 +487,6 @@
}
});
ENV.elementRefs.select.mainYieldUnitCodeSelect.setValue(product.mainYieldUnitCode);
ENV.elementRefs.select.mainSaleUnitCodeSelect.setValue(product.mainSaleUnitCode);
ENV.elementRefs.select.subYieldUnitCodeSelect.setValue(product.subYieldUnitCode);
@@ -494,23 +495,39 @@
document.getElementById("mainSaleUnit").value = product.mainSaleUnit;
document.getElementById("subYieldUnit").value = product.subYieldUnit;
document.getElementById("subSaleUnit").value = product.subSaleUnit;
},100);
});
},
// 선택 아이템 삭제
deleteItemById(id) {
ENV.data.productList = ENV.data.productList.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.productList = ENV.data.productList.filter(p => p.id != id);
const target = document.querySelector(`#listBody div[data-id='${id}']`);
if (target) target.remove();
formControl.updateLayout();
},
});
},
// 전체 초기화
clearAllItems() {
location.reload();
// ENV.data.productList = [];
// document.getElementById('listBody').innerHTML = '';
// this.updateListHeader();
etUI.dialog.alert({
title: '초기화 안내',
message: '등록하신 모든 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.',
type: 'confirm',
dialogType: 'confirm',
callback: function () {
ENV.data.productList = [];
document.getElementById('listBody').innerHTML = '';
formControl.updateLayout();
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
document.getElementById('totalItems').textContent = ENV.data.productList.length;
},
});
},
// 아이템 겟수 처리 아이템에 따른 레이아웃 정리

View File

@@ -20,7 +20,7 @@
</label>
</div>
<div class="input-field">
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요" th:field="*{ownerName}"
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요" name="ownerName" th:field="*{ownerName}"
maxlength="10">
</div>
</div>
@@ -281,10 +281,6 @@
<section layout:fragment="script">
<script th:inline="javascript">
$(function() {
//formControl.init();
});
let ENV = {
httpUrl: {
root: /*[[#{uri.front.info.user.path}]]*/'rootUrl',
@@ -311,7 +307,7 @@
},300);
//ajaxUtil._alert('select 010->10으로 노출\n 최초값 지정 및 값 취득 함수 필요\n 개인정보 작성 필요\n 모달 내부 스크롤 기능 추가 필요', null);
ENV.initialOwnerName = document.querySelector('input[name="ownerName"]').value;
},
_bindUI() {
@@ -356,7 +352,15 @@
// selectboxInstance1.setValue($('input[name=regionMainCode]').val());
},
confirmPopup() {
ENV.module.confirmPopup.open();
const currentName = document.querySelector('input[name="ownerName"]').value;
// 사용자가 이름을 변경했을 경우에만 개인정보 변경 동의서 모달 띄우기
if (currentName !== ENV.initialOwnerName) {
ENV.module.confirmPopup.open();
} else {
// 이름 그대로면 바로 저장
formControl.updateUserInfo();
}
},
confirmPopupOk() {
ENV.module.confirmPopup.close();
@@ -406,7 +410,8 @@
* TODO
* 내정보에서만 들어온다는 가정하에서 back을 하게함 SB에는 내정보로 이동하게 되어 있음.
*/
history.back()
// history.back();
location.href = '/info';
});
} else if (rstData.code === 'ERROR') {
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);