From f0e91c7569e807e8522c9c5bab653cff297a3195 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 19 Jul 2024 11:46:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/adds/nims/dsuseMgtRslt-info.jsp | 96 ++++++++++--------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp index 20f6c25..0e576ae 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp @@ -55,7 +55,7 @@ - 폐기일자는 등록후 변경이 불가 합니다 +
@@ -72,7 +72,7 @@ - 폐기방법은 등록후 변경이 불가 합니다 +
@@ -144,6 +144,8 @@ let isEditData = false; // 폐기결과 이미지 등록 및 변경 let isImgChange = true; + // 원 데이타셋 저장 + let orgDataset = {}; const searchRsltImgList = () => { document.getElementById("rsltImgList").innerHTML = ""; @@ -173,7 +175,13 @@ // 폐기결과 이미지를 등록한 폐기관리 ID면 skip - 이미지 추가 삭제 가능 let isSelf = list.filter(item => item.SEL_YN == 'Y') - if(isSelf.length > 0) return; + if(isSelf.length > 0){ + $('#dsuseDe--${pageName}').prop('disabled', true); + $('#dsuseMthCd--${pageName}').prop('disabled', true); + $('#spnDsuseDe').show(); + $('#spnDsuseMthCd').show(); + return; + } isImgChange = false; $('#btnImgAdd--${pageName}').prop('disabled', true); @@ -234,16 +242,16 @@ $P.control.onCurrentChange = item => { if (!item) return; - if(!initDataset && item.data.dsuseDe){ - isEditData = true; - $('#dsuseDe--${pageName}').prop('disabled', true); - $('#dsuseMthCd--${pageName}').prop('disabled', true); - $('#spnDsuseDe').hide(); - $('#spnDsuseMthCd').hide(); - } + // Dataset 셋팅 $P.formFields.set($P.control, item); + // 원 데이타셋 저장 + if(!initDataset){ + initDataset = true; + orgDataset = $P.formFields.get(); + } + // 보고완료 상태인 경우 저장 버튼 비활성화 if($("input[name='prgrsSttsCd']").val() == '99') { $("#btnSave--${pageName}").prop("disabled", true); @@ -306,23 +314,39 @@ } } } - - upload({ - url: '' - , data: { - fileChangeYn: fileChangeYn, - dsuseMgtRsltJsonStr: JSON.stringify(saveData), - dsuseDsuseImgFiles: fileArr - } - , success: resp => { - if(!resp.success){ - dialog.alert({ - content: resp.message - }); - return; - } - dialog.alert("저장 처리 하였습니다."); - dialog.close("dsuseMgtRsltDialog"); + + if(JSON.stringify(orgDataset)===JSON.stringify(info) && fileChangeYn === "N"){ + dialog.alert({ + content: "변경된 내용이 없습니다.", + init: () => { + focusOK(); + } + }); + return; + } + + dialog.alert({ + content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" + , init: () => setDialogZindex() + , onOK: () => { + upload({ + url: '' + , data: { + fileChangeYn: fileChangeYn, + dsuseMgtRsltJsonStr: JSON.stringify(saveData), + dsuseDsuseImgFiles: fileArr + } + , success: resp => { + if(!resp.success){ + dialog.alert({ + content: resp.message + }); + return; + } + dialog.alert("저장 처리 하였습니다."); + dialog.close("dsuseMgtRsltDialog"); + } + }); // formFields } }); } @@ -367,9 +391,6 @@ : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true); - - - } // DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트 @@ -459,14 +480,7 @@ return; } } - - dialog.alert({ - content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" - , init: () => { setDialogZindex(); } - , onOK: () => { - $P.control.save(rsltData, fileArr); // formFields - } - }); + $P.control.save(rsltData, fileArr); } /************************************************************************** @@ -498,11 +512,7 @@ $("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => { isImgChange = true; - if(!initDataset){ - initDataset = true; - return; - } - if(!isEditData) searchRsltImgList(); + if(initDataset) searchRsltImgList(); }); }