From 47e8a24e45ba3bf3afcb41db66b071ad98a43ab5 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 18 Jul 2024 12:01:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=EA=B2=B0=EA=B3=BC[?= =?UTF-8?q?=ED=86=B5=EB=B3=B4]=20=EC=B2=98=EB=A6=AC=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=B2=98=EB=A6=AC=20=20=20=20=20->=20=ED=8F=90?= =?UTF-8?q?=EA=B8=B0=EC=9D=BC=EC=9E=90=20&=20=ED=8F=90=EA=B8=B0=EB=B0=A9?= =?UTF-8?q?=EB=B2=95=EB=B3=84=EB=A1=9C=20=EB=8B=A8=20=ED=95=9C=EA=B0=9C?= =?UTF-8?q?=EC=9D=98=20=ED=8F=90=EA=B8=B0=EB=B3=B4=EA=B3=A0=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=A7=8C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EB=B0=8F=20=EB=B3=80=EA=B2=BD=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/adds/nims/web/AddsNimsController.java | 32 +++------ .../jsp/adds/nims/dsuseMgtRslt-info.jsp | 70 ++++++++++--------- 2 files changed, 47 insertions(+), 55 deletions(-) diff --git a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java index 8dc3b63..43afbc2 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -210,7 +210,7 @@ public class AddsNimsController extends ApplicationController { mav.addObject( "dsuseRsltImgList", toJson( - addsNimsService.getDsuseMgtRsltImgList( + getDsuseMgtRsltImgDscdmngList( new DsuseMgtRsltQuery() .setDscdmngId(dsuseRsltInfo.getDscdmngId()) .setDeptCd(dsuseRsltInfo.getDeptCd()) @@ -229,6 +229,11 @@ public class AddsNimsController extends ApplicationController { .addObject("dsuseRsltInfo", toJson(dsuseRsltInfo)) // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("apiHost", apiHost); } + + @RequestMapping(value = "/getDsuseMgtRsltImgDscdmngList.do", name="결과[통보] 처리 등록 이미지 폐기관리 목록 조회") + public @ResponseBody List getDsuseMgtRsltImgDscdmngList(DsuseMgtRsltQuery query) { + return addsNimsService.getDsuseMgtRsltImgList(query); + } //------------------------------------------------------------------------------------------------- // 결과[통보] 처리 //------------------------------------------------------------------------------------------------- @@ -248,10 +253,7 @@ public class AddsNimsController extends ApplicationController { return mav .addObject("pageName", "dsuseMgtMappingInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("apiHost", apiHost) - .addObject("dsuseMappingInfo", toJson(dsuseMappingInfo)) // View(jsp)에서 사용할 id 뒤에 붙일 suffix - // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix - // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; + .addObject("dsuseMappingInfo", toJson(dsuseMappingInfo)) /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */; } @RequestMapping(value = "/updatePrgsSttusOfDsuseMgt.do", name = "페기 보고 확인 등록") public ModelAndView updatePrgsSttusOfDsuseMgt(DsuseMgtReceiptQuery qry) { @@ -339,11 +341,7 @@ public class AddsNimsController extends ApplicationController { List deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); mav.addObject("DEPTList", deptList); - return mav - .addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix - // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix - // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; + return mav.addObject("pageName", "dsuseMgtReceipt") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */; } @RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인") @@ -353,11 +351,7 @@ public class AddsNimsController extends ApplicationController { List deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); mav.addObject("DEPTList", deptList); - return mav - .addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix - // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix - // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; + return mav.addObject("pageName", "dsuseMgtRslt") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */; } @RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인") @@ -367,11 +361,7 @@ public class AddsNimsController extends ApplicationController { List deptList = sggDeptService.getDepartmentList(new DepartmentQuery()); mav.addObject("DEPTList", deptList); - return mav - .addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix - // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix - // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; + return mav.addObject("pageName", "dsuseMgtMapping") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */; } @RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"}) @@ -525,7 +515,7 @@ public class AddsNimsController extends ApplicationController { //3.DB 저장, 스토리지 저장 List dscdmngIds = IntStream.rangeClosed(1, dataForDoc.size()).boxed().map(i -> { return dataForDoc.get(i-1).string("dscdmngId"); - }).collect(Collectors.toList()); + }).toList(); boolean allEqual = dscdmngIds.stream().distinct().count() <= 1; if(allEqual) { String resultFilePath = form.andGetPath(); 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 17e6d7e..6ec9edd 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 @@ -51,12 +51,12 @@ -
+
- + + 폐기일자는 등록후 변경이 불가 합니다
-
-
+
+ 폐기방법은 등록후 변경이 불가 합니다
@@ -80,8 +81,8 @@
- - + +
@@ -137,23 +138,29 @@ * script 진입 **************************************************************************/ $(document).ready(function() { + // 최초(load) 여부 let initDataset = false; + // 변경 화면 + let isEditData = false; const searchRsltImgList = () => { - alert('ddd'); - return; + document.getElementById("rsltImgList").innerHTML = ""; + $('#btnImgAdd--${pageName}').prop('disabled', false); + $('#btnImgDel--${pageName}').prop('disabled', false); + let param = { dscdmngId: $("#dscdmngId--${pageName}").val(), - dsuseDe: $("#dsuseDe--${pageName}").val(), + dsuseDe: $("#dsuseDe--${pageName}").val().replace(/-/g, ""), dsuseMthCd: $("#dsuseMthCd--${pageName}").val(), deptCd: "${currentUser.deptCode}" }; $.ajax({ - url :wctx.url("/adds/nims/getDsuseMgtRsltImgList.do") - ,type:"post" - ,data:{ dtls : JSON.stringify(dtls) } + url :wctx.url("/adds/nims/getDsuseMgtRsltImgDscdmngList.do") + ,type: "get" + ,data: param ,dataType:"json" ,success:function(jsonStr){ + fnRsltImgList(jsonStr); } }); @@ -166,7 +173,8 @@ let isSelf = list.filter(item => item.SEL_YN == 'Y') if(isSelf.length > 0) return; - $('#btnImgAdd').prop('disabled', true); + $('#btnImgAdd--${pageName}').prop('disabled', true); + $('#btnImgDel--${pageName}').prop('disabled', true); let tagsTextArr = []; for(let idx = 0; idx < list.length; idx++){ @@ -223,19 +231,16 @@ $P.control.onCurrentChange = item => { if (!item) return; - - //$("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => { - alert("item : "+item.data.dsuseDe) - alert($("#dsuseDe--${pageName}").val()) - //}); - + 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); - alert("item : "+item.data.dsuseDe) - alert($("#dsuseDe--${pageName}").val()) - - // 보고완료 상태인 경우 저장 버튼 비활성화 if($("input[name='prgrsSttsCd']").val() == '99') { $("#btnSave--${pageName}").prop("disabled", true); @@ -280,13 +285,6 @@ // 저장 $P.control.save = (info, fileArr) => { - // if(fileArr.length == 0){ - // dialog.alert({ - // content: "폐기(진행) 사진을 1개 이상 등록해 주세요." - // }); - // return; - // } - let saveData = { ...info, prgrsSttsCd: "06", @@ -388,10 +386,10 @@ if($P.fileArr.length > 0){ let tagsText = $P.fnMakeImgTags($P.fileArr); document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText; - $("#btnImageDel--${pageName}").removeAttr("hidden"); + $("#btnImgDel--${pageName}").removeAttr("hidden"); } else { document.querySelector("#dragAndDrop--${pageName}").innerHTML = ""; - $("#btnImageDel--${pageName}").attr("hidden","hidden"); + $("#btnImgDel--${pageName}").attr("hidden","hidden"); } } @@ -469,7 +467,7 @@ }); //이미지 삭제 버튼 - $("#btnImageDel--${pageName}").on("click", function() { + $("#btnImgDel--${pageName}").on("click", function() { let checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked"); if(checkeds.length > 0){ let keys = []; @@ -486,7 +484,11 @@ $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => { - if(initDataset) fnRsltImgList(); + if(!initDataset){ + initDataset = true; + return; + } + if(!isEditData) searchRsltImgList(); }); }