From 0ae2bd5ed2e0b88ef0d51e271f60fd8e67b94b7c Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 14 Jun 2024 18:29:56 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=8F=90=EA=B8=B0=20=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/adds/nims/web/AddsNimsController.java | 2 +- .../jsp/adds/nims/dsuseMgtReceipt-info.jsp | 35 +++++---- .../jsp/adds/nims/dsuseMgtRslt-info.jsp | 77 +++++++++++++++---- 3 files changed, 82 insertions(+), 32 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 8d8a2dc..627d5b9 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -66,7 +66,7 @@ public class AddsNimsController extends AbstractController { .addObject("infoPrefix", "dsuseMgtRsltInfo") // prefix .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl .addObject("usrRptIdNo", usrRptIdNo) // View(jsp)에서 사용할 id 뒤에 붙일 suffix - ; + .addObject("apiHost", apiHost); } //------------------------------------------------------------------------------------------------- // 결과[통보] 처리 diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp index 39c2738..b48c8c1 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp @@ -288,30 +288,23 @@ } // 저장 - $P.control.save = (jsonBssh, datasetListPrd) => { + $P.control.save = (jsonBssh, datasetListPrd, fileArr) => { let saveBsshData = { ...jsonBssh, rndDtlRptCnt: datasetListPrd.length, userId: "${currentUser.account}" } - let fileArr = []; - $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(() => { - fileArr.push(this.files[0]); - }); - - let saveData = { - dsuseMgtJsonStr: JSON.stringify(saveBsshData), - dsuseMgtDtlsJsonStr: JSON.stringify(datasetListPrd), - // 폐기상품이미지목록 - dsusePrdImgFiles: fileArr - }; - let create = (jsonBssh.dscdmngId == ""); upload({ url: '' - , data: saveData || {} + , data: { + dsuseMgtJsonStr: JSON.stringify(saveBsshData), + dsuseMgtDtlsJsonStr: JSON.stringify(datasetListPrd), + // 폐기상품이미지목록 + dsusePrdImgFiles: fileArr + } , success: resp => { if(!resp.success){ dialog.alert({ @@ -407,11 +400,23 @@ return false; } + let fileArr = []; + $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(() => { + fileArr.push(this.files[0]); + }); + + if(dsProd.length != fileArr.length){ + dialog.alert({ + content: "입력되지 않은 폐기 제품 이미지가 있습니다." + }); + return false; + } + dialog.alert({ content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" , init: () => { setDialogZindex(); } , onOK: () => { - $P.control.save(bsshData, dsProd); // formFields + $P.control.save(bsshData, dsProd, fileArr); // formFields } }); } 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 c51d131..5ba44da 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 @@ -1,7 +1,7 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> -신청서 정보 상세 +폐기 결과[통보] 상세
@@ -13,7 +13,7 @@
- +
@@ -37,7 +37,7 @@
- +
@@ -50,16 +50,16 @@
- -
- - @@ -150,7 +150,7 @@ load : wctx.url("/adds/nims/dsuseMgt-list.do") } , prefix: "dsuseMgt" - , prefixName: "신청서접수" + , prefixName: "폐기 결과[통보]" , keymapper: info => info ? info.DSCDMNG_ID : "" , dataGetter: obj => obj.dsuseMgtList , appendData: true @@ -232,15 +232,33 @@ } // 저장 - $P.control.save = (info) => { - if (!info) return; - + $P.control.save = (info, fileArr) => { + let saveData = { + ...info, + userId: "${currentUser.account}" + } let create = (info.mngId == ""); - ajax.post({ - url: !create ? $P.control.urls.update : $P.control.urls.create - , data: info || {} - , success: resp => $P.control.onSave(resp) + upload({ + url: '' + , data: { + dsuseMgtRsltJsonStr: JSON.stringify(saveData), + dsuseDsuseImgFiles: fileArr + } + , success: resp => { + if(!resp.success){ + dialog.alert({ + content: resp.message + }); + return; + } + + //$P.control.onSave(resp) + dialog.alert("저장됐습니다."); + dialog.close("dsuseMgtRsltDialog"); + //this._load(); + + } }); } @@ -355,12 +373,39 @@ $P.fnSave = () => { // validate 확인 if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; + let rsltData = $P.formFields.get(); + + if(rsltData.hdrDe == ""){ + dialog.alert({ + content: "취급일자를 선택해 주세요." + }); + return false; + } + if(rsltData.dsuseDe == ""){ + dialog.alert({ + content: "폐기일자를 선택해 주세요." + }); + return false; + } + if(rsltData.dsuseLoc == ""){ + dialog.alert({ + content: "폐기장소를 입력해 주세요." + }); + return false; + } + + // FIXME: 파일 + let fileArr = []; + // $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(() => { + // fileArr.push(this.files[0]); + // }); + dialog.alert({ content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?" , init: () => { setDialogZindex(); } , onOK: () => { - $P.control.save($P.formFields.get()); // formFields + $P.control.save(rsltData, fileArr); // formFields } }); }