diff --git a/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml b/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml index 9e393fc..cacd758 100644 --- a/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml +++ b/src/main/resources/sql/mapper/adds/nims/dsuseMgtRslt-mapper.xml @@ -11,6 +11,12 @@ , tcc.CODE_VAL AS DSUSE_MTH_NM , tdm.DSUSE_DE , IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SEL_YN + , (SELECT count(dscdmng_id) + FROM tb_dsuse_mgt + WHERE use_yn = 'Y' + AND dept_cd = #{deptCd} + AND dsuse_mth_cd = #{dsuseMthCd} + AND dsuse_de = #{dsuseDe}) AS SAVE_CNT FROM tb_dsuse_mgt tdm JOIN tb_cmn_code tcc ON (tdm.dsuse_mth_cd = tcc.code 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 0e576ae..74e762d 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 @@ - +
@@ -146,6 +146,8 @@ let isImgChange = true; // 원 데이타셋 저장 let orgDataset = {}; + // 이전 폐기결과이미지 목록 + <%--let dsuseRsltImgList = ${dsuseRsltImgList};--%> const searchRsltImgList = () => { document.getElementById("rsltImgList").innerHTML = ""; @@ -175,11 +177,15 @@ // 폐기결과 이미지를 등록한 폐기관리 ID면 skip - 이미지 추가 삭제 가능 let isSelf = list.filter(item => item.SEL_YN == 'Y') + if(isSelf.length > 0){ - $('#dsuseDe--${pageName}').prop('disabled', true); - $('#dsuseMthCd--${pageName}').prop('disabled', true); - $('#spnDsuseDe').show(); - $('#spnDsuseMthCd').show(); + // 등록된 폐기 관리가 2개 이상이면 폐기일자, 폐기방법 변경 불가 + if(list[0].SAVE_CNT > 1){ + $('#dsuseDe--${pageName}').prop('disabled', true); + $('#dsuseMthCd--${pageName}').prop('disabled', true); + $('#spnDsuseDe').show(); + $('#spnDsuseMthCd').show(); + } return; }