feat: 일련번호 조회(seqinfo_pub) API 적용

제품조회 반영(업체의 제품 조회 되도록)
main
Jonguk. Lim 1 month ago
parent 0259c17ea6
commit c47a7c9b1c

@ -1,10 +1,10 @@
package cokr.xit.adds.cmm.model; package cokr.xit.adds.cmm.model;
import java.util.List; import java.util.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.*;
import lombok.Data; import lombok.*;
/** /**
* <pre> * <pre>
@ -93,7 +93,7 @@ public class NimsApiRequest {
* true DB skip * true DB skip
* </pre> * </pre>
*/ */
private String dbSkipYn = "N"; //private String dbSkipYn = "N";
/** /**
* <pre> * <pre>
@ -162,7 +162,7 @@ public class NimsApiRequest {
* *
* </pre> * </pre>
*/ */
private String dbSkipYn = "N"; //private String dbSkipYn = "N";
/** /**
* <pre> * <pre>

@ -36,7 +36,7 @@
</span> </span>
</span> </span>
</div> </div>
<!-- / 업무 버튼 표시 --> <!-- / 업무 버튼 표시 -->
<div class="card-datatable text-nowrap"> <div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}"> <div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
@ -54,7 +54,7 @@
<%-- <th class="sorting" style="width: 120.469px;">구분</th>--%> <%-- <th class="sorting" style="width: 120.469px;">구분</th>--%>
</tr> </tr>
</thead> </thead>
<tbody id="tbody--${pageName}"> <tbody id="tbody--${pageName}">
</tbody> </tbody>
<template id="${infoPrefix}Row--${pageName}"> <template id="${infoPrefix}Row--${pageName}">
<tr data-key="{bsshCd}"> <tr data-key="{bsshCd}">
@ -119,7 +119,7 @@
, appendData: true , appendData: true
, infoSize: "xl" , infoSize: "xl"
}); });
// $P.control 설정 // $P.control 설정
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 $P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
@ -130,7 +130,7 @@
* DatasetControl 이벤트 * DatasetControl 이벤트
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => { $P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total); $P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({ $("#${infoPrefix}Paging--${pageName}").setPagingInfo({
@ -152,9 +152,9 @@
$("#tbody--${pageName}").setCurrentRow(key); $("#tbody--${pageName}").setCurrentRow(key);
} }
// 저장 callback // 저장 callback
// 저장 // 저장
/************************************************************************** /**************************************************************************
@ -197,14 +197,14 @@
/************************************************************************** /**************************************************************************
* 버튼 clickEvent * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
$P.fnSearchList = (dbSkipYn) => { $P.fnSearchList = () => {
$P.control.query = { $P.control.query = {
//... $P.formFields.get(), //... $P.formFields.get(),
bc: $P.formFields.get().schBsshCd, bc: $P.formFields.get().schBsshCd,
bn: $P.formFields.get().schBsshNm, bn: $P.formFields.get().schBsshNm,
rprsntvNm: $P.formFields.get().schRprsntvNm, rprsntvNm: $P.formFields.get().schRprsntvNm,
dbSkipYn: dbSkipYn? dbSkipYn : "N", //dbSkipYn: dbSkipYn? dbSkipYn : "N",
userId: "${currentUser.account}" userId: "${currentUser.account}"
}; };
$P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수 $P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수
@ -212,7 +212,7 @@
$P.control.load(1); $P.control.load(1);
} }
// 저장 // 저장
$P.fnSave = () => { $P.fnSave = () => {
let openPage = new AddsFormFields("#${openPage}"); let openPage = new AddsFormFields("#${openPage}");
@ -229,7 +229,7 @@
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList()); $("#btnSearch--${pageName}").on("click", () => $P.fnSearchList());
$("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y")); $("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y"));
$("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList); $("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);
} }

@ -27,6 +27,15 @@
<!-- hidden --> <!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" /> <input type="hidden" name="dscdmngId" data-map="dscdmngId" />
<input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" /> <input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" />
<input type="hidden" name="indutyNm" data-map="indutyNm"/>
<input type="hidden" name="hdntCd" data-map="hdntCd"/>
<input type="hidden" name="hdntNm" data-map="hdntNm"/>
<input type="hidden" name="chrgNm" data-map="chrgNm"/>
<input type="hidden" name="hptlNo" data-map="hptlNo"/>
<input type="hidden" name="joinYn" data-map="joinYn"/>
<input type="hidden" name="bsshSttusNm" data-map="bsshSttusNm"/>
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label> <label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4"> <div class="col-md-4">
@ -67,12 +76,19 @@
<div class="row my-1 mx-1 g-1 border-card rounded"></div> <div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form> </form>
<form id="product--${pageName}" name="product"> <form id="product--${pageName}" name="product">
<input type="hidden" name="prdlstMstCd" data-map="prdlstMstCd"/>
<input type="hidden" name="nrcdSeNm" data-map="nrcdSeNm"/>
<input type="hidden" name="prtmSeNm" data-map="prtmSeNm"/>
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<input type="hidden" name="rgsDt" data-map="rgsDt"/>
<input type="hidden" name="updDt" data-map="updDt"/>
<label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label> <label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-6"> <div class="col-md-6">
<label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label> <label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
<input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly> <input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label> <label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label>
<input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly> <input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
@ -231,6 +247,12 @@
mnfNo: prdInfo.mnfSeqInfos[0].mnfNo, mnfNo: prdInfo.mnfSeqInfos[0].mnfNo,
mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq, mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq,
prdlstMstCd: prdInfo.prdlstMstCd,
nrcdSeNm: prdInfo.nrcdSeNm,
prtmSeNm: prdInfo.prtmSeNm,
bsshCd: prdInfo.bsshCd,
rgsDt: prdInfo.rgsDt,
updDt: prdInfo.updDt
} }
); );
$("#prductCd--${pageName}").prop("readonly", true); $("#prductCd--${pageName}").prop("readonly", true);
@ -279,9 +301,6 @@
dialog.alert(obj.message); dialog.alert(obj.message);
return false; return false;
} }
// obj.data.forEach(item => {
// item.data.dsuseQy = parseFloat(item.data.dsuseQy.toFixed(2)).toString()
// });
return obj.data; return obj.data;
} }
, infoSize: "xl" , infoSize: "xl"
@ -308,7 +327,7 @@
if($("input[name='prgrsSttsCd']").val() == '99') { if($("input[name='prgrsSttsCd']").val() == '99') {
$("#btnSave--${pageName}").prop("disabled", true); $("#btnSave--${pageName}").prop("disabled", true);
} }
let checkData = item.data.dsusePrvCd; let checkData = item.data.dsusePrvCd;
if (checkData =="01" || checkData =="02") { if (checkData =="01" || checkData =="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false); $("#dsuseAcdtDe--${pageName}").prop('disabled', false);
@ -317,7 +336,7 @@
$("#dsuseAcdtDe--${pageName}").val(""); $("#dsuseAcdtDe--${pageName}").val("");
} }
} }
$P.productControl.onCurrentChange = item => { $P.productControl.onCurrentChange = item => {
if (!item) return; if (!item) return;
@ -360,10 +379,17 @@
} }
}); });
} }
$P.productControl.getProductInfo = () => { $P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회"; let dialogTitle = "마약류 제품 조회";
let rowData = $P.bsshFormFields.get(); let rowData = $P.bsshFormFields.get();
if(rowData.bsshCd == null || rowData.bsshCd === "") {
dialog.alert({
content: "업체를 먼저 선택해주세요."
});
return false;
}
let params = { let params = {
openPage : "product--${pageName}" openPage : "product--${pageName}"
, bsshCd: rowData.bsshCd , bsshCd: rowData.bsshCd
@ -383,7 +409,7 @@
} }
}); });
} }
// 저장 // 저장
$P.control.save = (jsonBssh, datasetListPrd, fileArr) => { $P.control.save = (jsonBssh, datasetListPrd, fileArr) => {
let saveBsshData = { let saveBsshData = {
@ -412,13 +438,13 @@
} }
}); });
} }
$P.productList.onAppend = item => { $P.productList.onAppend = item => {
if (!item) return; if (!item) return;
if (item.length < 1) return; if (item.length < 1) return;
// 업무별 DataTables(그리드) tr, td // 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").content; let foundContent = document.getElementById("productListRow--productList").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false); let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
@ -431,37 +457,37 @@
// //
let replacer = (str, dataItem) => str let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');");
for(let i=0; i<item.length; i++){ for(let i=0; i<item.length; i++){
let di = $P.productList.getData(item[i].keyCnt, "item"); let di = $P.productList.getData(item[i].keyCnt, "item");
let tr = di.inString(foundTr.outerHTML, replacer); let tr = di.inString(foundTr.outerHTML, replacer);
$("#tbody--productList").append(tr); $("#tbody--productList").append(tr);
AddsComponentization.fnMakeGridImageViewer( AddsComponentization.fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0], $("#tbody--productList").find("td.prdDsuseImg").last()[0],
"dsusePrdImgFiles", "dsusePrdImgFiles",
di.data.fileInfo di.data.fileInfo
); );
} }
} }
$P.productList.onRemove = item => { $P.productList.onRemove = item => {
let key = item[0].data.keyCnt; let key = item[0].data.keyCnt;
$("#tbody--productList").find("tr[data-key='"+key+"']").remove(); $("#tbody--productList").find("tr[data-key='"+key+"']").remove();
} }
$P.productList.onCurrentChange = item => { $P.productList.onCurrentChange = item => {
if (!item) return; if (!item) return;
let key = item.data.keyCnt; let key = item.data.keyCnt;
$("#tbody--productList").setCurrentRow(key); $("#tbody--productList").setCurrentRow(key);
} }
/************************************************************************** /**************************************************************************
* DataTables 이벤트 * DataTables 이벤트
**************************************************************************/ **************************************************************************/
@ -469,12 +495,12 @@
/************************************************************************** /**************************************************************************
* 사용자 함수(function) * 사용자 함수(function)
**************************************************************************/ **************************************************************************/
$P.fnSearchBssh = (title) => { $P.fnSearchBssh = (title) => {
$P.control.getBsshInfo(); $P.control.getBsshInfo();
} }
$P.fnSearchProduct = (title) => { $P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo(); $P.productControl.getProductInfo();
} }
@ -490,7 +516,7 @@
let bsshData = $P.bsshFormFields.get(); let bsshData = $P.bsshFormFields.get();
if(bsshData.bsshCd == ""){ if(bsshData.bsshCd === ""){
dialog.alert({ dialog.alert({
content: "마약류 취급업체 정보를 입력해주세요." content: "마약류 취급업체 정보를 입력해주세요."
}); });
@ -502,7 +528,7 @@
} }
let dsProd = $P.productList.getDataset(); let dsProd = $P.productList.getDataset();
if(dsProd.length == 0){ if(dsProd.length === 0){
dialog.alert({ dialog.alert({
content: "폐기 제품 정보를 입력해주세요." content: "폐기 제품 정보를 입력해주세요."
}); });
@ -542,7 +568,7 @@
} }
if(!isContinue) return false; if(!isContinue) return false;
let fileCount = 0; let fileCount = 0;
$("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() { $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() {
if(this.dataset.url != null){ if(this.dataset.url != null){
fileCount++; fileCount++;
@ -551,7 +577,7 @@
} }
}); });
if(dsProd.length != fileCount){ if(dsProd.length !== fileCount){
dialog.alert({ dialog.alert({
content: "입력되지 않은 폐기 제품 이미지가 있습니다." content: "입력되지 않은 폐기 제품 이미지가 있습니다."
}); });
@ -577,14 +603,14 @@
promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo)); promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo));
} }
}); });
Promise.all(promiseArr).then((values) => { Promise.all(promiseArr).then((values) => {
$P.control.save(bsshData, dsProd, values); $P.control.save(bsshData, dsProd, values);
}).catch((error) => {}); }).catch((error) => {});
} }
}); });
} }
//추가 //추가
$P.fnAdd = () => { $P.fnAdd = () => {
if(!$P.productFormFields.get().prductCd){ if(!$P.productFormFields.get().prductCd){
@ -613,7 +639,7 @@
const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq; const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq;
let isDup = $P.productList let isDup = $P.productList
.getDataset() .getDataset()
.filter(item => prdInfo == ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq) .filter(item => prdInfo === ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.length > 0; .length > 0;
if(isDup){ if(isDup){
const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq; const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq;
@ -627,7 +653,7 @@
data.prdValidDe = data.prdValidDe.replaceAll('-',''); data.prdValidDe = data.prdValidDe.replaceAll('-','');
$P.productList.append([data]); $P.productList.append([data]);
} }
$P.fnDel = () => { $P.fnDel = () => {
// validate 확인 // validate 확인
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
@ -641,17 +667,17 @@
} }
}); });
} }
$P.fnChangeDsusePrvCd = () => { $P.fnChangeDsusePrvCd = () => {
// validate 확인 // validate 확인
let checkData = $("#dsusePrvCd--${pageName} option:selected").val(); let checkData = $("#dsusePrvCd--${pageName} option:selected").val();
if (checkData =="01" || checkData =="02") { if (checkData ==="01" || checkData ==="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false); $("#dsuseAcdtDe--${pageName}").prop('disabled', false);
}else{ }else{
$("#dsuseAcdtDe--${pageName}").prop('disabled', true); $("#dsuseAcdtDe--${pageName}").prop('disabled', true);
$("#dsuseAcdtDe--${pageName}").val(""); $("#dsuseAcdtDe--${pageName}").val("");
} }
} }
/************************************************************************** /**************************************************************************
@ -663,18 +689,18 @@
$("#btnBsshSearch--${pageName}").on("click", function() { $("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title")); $P.fnSearchBssh($(this).attr("title"));
}); });
$("#btnProductSearch--${pageName}").on("click", function() { $("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title")); $P.fnSearchProduct($(this).attr("title"));
}); });
// 버튼 이벤트 // 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가 $("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가 $("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가 $("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@ -702,10 +728,10 @@
// 초기 화면 설정 // 초기 화면 설정
$P.initForm = () => { $P.initForm = () => {
if($("input[name='prgrsSttsCd']").val() == '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) { if($("input[name='prgrsSttsCd']").val() === '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnSave--${pageName}").prop("disabled", true); $("#btnSave--${pageName}").prop("disabled", true);
} }
AppSupport.initDatepicker("bssh--${pageName}"); AppSupport.initDatepicker("bssh--${pageName}");
$("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date()); $("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date());
} }
@ -721,14 +747,14 @@
// 3. Dataset 설정 // 3. Dataset 설정
$P.control.setData([${dsuseReceptInfo}]); $P.control.setData([${dsuseReceptInfo}]);
let productInfo = ${dsuseReceptDtlInfo}; let productInfo = ${dsuseReceptDtlInfo};
let fileInfo = ${fileInfo}; let fileInfo = ${fileInfo};
for(let p of productInfo){ for(let p of productInfo){
p.keyCnt = (""+prdRowKey++); p.keyCnt = (""+prdRowKey++);
for(let f of fileInfo){ for(let f of fileInfo){
if(p.dscdmngSn == f.SUB_TYPE){ if(p.dscdmngSn === f.SUB_TYPE){
p.fileInfo = f; p.fileInfo = f;
} }
} }

@ -14,7 +14,14 @@
<!-- hidden --> <!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" /> <input type="hidden" name="dscdmngId" data-map="dscdmngId" />
<input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" /> <input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" />
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<input type="hidden" name="indutyNm" data-map="indutyNm"/>
<input type="hidden" name="hdntCd" data-map="hdntCd"/>
<input type="hidden" name="hdntNm" data-map="hdntNm"/>
<input type="hidden" name="chrgNm" data-map="chrgNm"/>
<input type="hidden" name="hptlNo" data-map="hptlNo"/>
<input type="hidden" name="joinYn" data-map="joinYn"/>
<input type="hidden" name="bsshSttusNm" data-map="bsshSttusNm"/>
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label> <label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4"> <div class="col-md-4">
@ -55,12 +62,19 @@
<div class="row my-1 mx-1 g-1 border-card rounded"></div> <div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form> </form>
<form id="product--${pageName}" name="product"> <form id="product--${pageName}" name="product">
<input type="hidden" name="prdlstMstCd" data-map="prdlstMstCd"/>
<input type="hidden" name="nrcdSeNm" data-map="nrcdSeNm"/>
<input type="hidden" name="prtmSeNm" data-map="prtmSeNm"/>
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<input type="hidden" name="rgsDt" data-map="rgsDt"/>
<input type="hidden" name="updDt" data-map="updDt"/>
<label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label> <label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-6"> <div class="col-md-6">
<label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label> <label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
<input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly> <input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label> <label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label>
<input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly> <input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
@ -201,6 +215,12 @@
mnfNo: prdInfo.mnfSeqInfos[0].mnfNo, mnfNo: prdInfo.mnfSeqInfos[0].mnfNo,
mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq, mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq,
prdlstMstCd: prdInfo.prdlstMstCd,
nrcdSeNm: prdInfo.nrcdSeNm,
prtmSeNm: prdInfo.prtmSeNm,
bsshCd: prdInfo.bsshCd,
rgsDt: prdInfo.rgsDt,
updDt: prdInfo.updDt
} }
); );
$("#prductCd--${pageName}").prop("readonly", true); $("#prductCd--${pageName}").prop("readonly", true);
@ -278,7 +298,7 @@
if($("input[name='prgrsSttsCd']").val() == '99') { if($("input[name='prgrsSttsCd']").val() == '99') {
$("#btnSave--${pageName}").prop("disabled", true); $("#btnSave--${pageName}").prop("disabled", true);
} }
let checkData = item.data.dsusePrvCd; let checkData = item.data.dsusePrvCd;
if (checkData =="01" || checkData =="02") { if (checkData =="01" || checkData =="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false); $("#dsuseAcdtDe--${pageName}").prop('disabled', false);
@ -287,7 +307,7 @@
$("#dsuseAcdtDe--${pageName}").val(""); $("#dsuseAcdtDe--${pageName}").val("");
} }
} }
$P.productControl.onCurrentChange = item => { $P.productControl.onCurrentChange = item => {
if (!item) return; if (!item) return;
@ -330,11 +350,11 @@
} }
}); });
} }
$P.productControl.getProductInfo = () => { $P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회"; let dialogTitle = "마약류 제품 조회";
let rowData = $P.bsshFormFields.get(); let rowData = $P.bsshFormFields.get();
if(rowData.bsshCd == null || rowData.bsshCd == "") { if(rowData.bsshCd == null || rowData.bsshCd === "") {
dialog.alert({ dialog.alert({
content: "업체를 먼저 선택해주세요." content: "업체를 먼저 선택해주세요."
}); });
@ -360,7 +380,7 @@
} }
}); });
} }
// 저장 // 저장
$P.control.save = (jsonBssh, datasetListPrd, fileArr) => { $P.control.save = (jsonBssh, datasetListPrd, fileArr) => {
let saveBsshData = { let saveBsshData = {
@ -389,13 +409,13 @@
} }
}); });
} }
$P.productList.onAppend = item => { $P.productList.onAppend = item => {
if (!item) return; if (!item) return;
if (item.length < 1) return; if (item.length < 1) return;
// 업무별 DataTables(그리드) tr, td // 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").content; let foundContent = document.getElementById("productListRow--productList").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false); let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
@ -408,37 +428,37 @@
// //
let replacer = (str, dataItem) => str let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');");
for(let i=0; i<item.length; i++){ for(let i=0; i<item.length; i++){
let di = $P.productList.getData(item[i].keyCnt, "item"); let di = $P.productList.getData(item[i].keyCnt, "item");
let tr = di.inString(foundTr.outerHTML, replacer); let tr = di.inString(foundTr.outerHTML, replacer);
$("#tbody--productList").append(tr); $("#tbody--productList").append(tr);
AddsComponentization.fnMakeGridImageViewer( AddsComponentization.fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0], $("#tbody--productList").find("td.prdDsuseImg").last()[0],
"dsusePrdImgFiles", "dsusePrdImgFiles",
di.data.fileInfo di.data.fileInfo
); );
} }
} }
$P.productList.onRemove = item => { $P.productList.onRemove = item => {
let key = item[0].data.keyCnt; let key = item[0].data.keyCnt;
$("#tbody--productList").find("tr[data-key='"+key+"']").remove(); $("#tbody--productList").find("tr[data-key='"+key+"']").remove();
} }
$P.productList.onCurrentChange = item => { $P.productList.onCurrentChange = item => {
if (!item) return; if (!item) return;
let key = item.data.keyCnt; let key = item.data.keyCnt;
$("#tbody--productList").setCurrentRow(key); $("#tbody--productList").setCurrentRow(key);
} }
/************************************************************************** /**************************************************************************
* DataTables 이벤트 * DataTables 이벤트
**************************************************************************/ **************************************************************************/
@ -446,12 +466,12 @@
/************************************************************************** /**************************************************************************
* 사용자 함수(function) * 사용자 함수(function)
**************************************************************************/ **************************************************************************/
$P.fnSearchBssh = (title) => { $P.fnSearchBssh = (title) => {
$P.control.getBsshInfo(); $P.control.getBsshInfo();
} }
$P.fnSearchProduct = (title) => { $P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo(); $P.productControl.getProductInfo();
} }
@ -467,7 +487,7 @@
let bsshData = $P.bsshFormFields.get(); let bsshData = $P.bsshFormFields.get();
if(bsshData.bsshCd == ""){ if(bsshData.bsshCd === ""){
dialog.alert({ dialog.alert({
content: "마약류 취급업체 정보를 입력해주세요." content: "마약류 취급업체 정보를 입력해주세요."
}); });
@ -479,14 +499,14 @@
} }
let dsProd = $P.productList.getDataset(); let dsProd = $P.productList.getDataset();
if(dsProd.length == 0){ if(dsProd.length === 0){
dialog.alert({ dialog.alert({
content: "폐기 제품 정보를 입력해주세요." content: "폐기 제품 정보를 입력해주세요."
}); });
return false; return false;
} }
let fileCount = 0; let fileCount = 0;
$("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() { $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() {
if(this.dataset.url != null){ if(this.dataset.url != null){
fileCount++; fileCount++;
@ -495,7 +515,7 @@
} }
}); });
if(dsProd.length != fileCount){ if(dsProd.length !== fileCount){
dialog.alert({ dialog.alert({
content: "입력되지 않은 폐기 제품 이미지가 있습니다." content: "입력되지 않은 폐기 제품 이미지가 있습니다."
}); });
@ -521,14 +541,14 @@
promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo)); promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo));
} }
}); });
Promise.all(promiseArr).then((values) => { Promise.all(promiseArr).then((values) => {
$P.control.save(bsshData, dsProd, values); $P.control.save(bsshData, dsProd, values);
}).catch((error) => {}); }).catch((error) => {});
} }
}); });
} }
//추가 //추가
$P.fnAdd = () => { $P.fnAdd = () => {
if(!$P.productFormFields.get().prductCd){ if(!$P.productFormFields.get().prductCd){
@ -557,7 +577,7 @@
const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq; const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq;
let isDup = $P.productList let isDup = $P.productList
.getDataset() .getDataset()
.filter(item => prdInfo == ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq) .filter(item => prdInfo === ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.length > 0; .length > 0;
if(isDup){ if(isDup){
const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq; const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq;
@ -566,12 +586,12 @@
}); });
return false; return false;
} }
debugger
const data = {...$P.productFormFields.get(), keyCnt : ""+prdRowKey++}; const data = {...$P.productFormFields.get(), keyCnt : ""+prdRowKey++};
data.prdValidDe = data.prdValidDe.replaceAll('-',''); data.prdValidDe = data.prdValidDe.replaceAll('-','');
$P.productList.append([data]); $P.productList.append([data]);
} }
$P.fnDel = () => { $P.fnDel = () => {
// validate 확인 // validate 확인
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
@ -585,17 +605,17 @@
} }
}); });
} }
$P.fnChangeDsusePrvCd = () => { $P.fnChangeDsusePrvCd = () => {
// validate 확인 // validate 확인
let checkData = $("#dsusePrvCd--${pageName} option:selected").val(); let checkData = $("#dsusePrvCd--${pageName} option:selected").val();
if (checkData =="01" || checkData =="02") { if (checkData ==="01" || checkData ==="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false); $("#dsuseAcdtDe--${pageName}").prop('disabled', false);
}else{ }else{
$("#dsuseAcdtDe--${pageName}").prop('disabled', true); $("#dsuseAcdtDe--${pageName}").prop('disabled', true);
$("#dsuseAcdtDe--${pageName}").val(""); $("#dsuseAcdtDe--${pageName}").val("");
} }
} }
/************************************************************************** /**************************************************************************
@ -607,18 +627,18 @@
$("#btnBsshSearch--${pageName}").on("click", function() { $("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title")); $P.fnSearchBssh($(this).attr("title"));
}); });
$("#btnProductSearch--${pageName}").on("click", function() { $("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title")); $P.fnSearchProduct($(this).attr("title"));
}); });
// 버튼 이벤트 // 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가 $("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가 $("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가 $("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@ -646,10 +666,10 @@
// 초기 화면 설정 // 초기 화면 설정
$P.initForm = () => { $P.initForm = () => {
if($("input[name='prgrsSttsCd']").val() == '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) { if($("input[name='prgrsSttsCd']").val() === '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnSave--${pageName}").prop("disabled", true); $("#btnSave--${pageName}").prop("disabled", true);
} }
AppSupport.initDatepicker("bssh--${pageName}"); AppSupport.initDatepicker("bssh--${pageName}");
$("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date()); $("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date());
} }
@ -665,20 +685,20 @@
// 3. Dataset 설정 // 3. Dataset 설정
$P.control.setData([${dsuseReceptInfo}]); $P.control.setData([${dsuseReceptInfo}]);
let productInfo = ${dsuseReceptDtlInfo}; let productInfo = ${dsuseReceptDtlInfo};
let fileInfo = ${fileInfo}; let fileInfo = ${fileInfo};
for(let p of productInfo){ for(let p of productInfo){
p.keyCnt = (""+prdRowKey++); p.keyCnt = (""+prdRowKey++);
for(let f of fileInfo){ for(let f of fileInfo){
if(p.dscdmngSn == f.SUB_TYPE){ if(p.dscdmngSn === f.SUB_TYPE){
p.fileInfo = f; p.fileInfo = f;
} }
} }
} }
$P.productList.append(productInfo); $P.productList.append(productInfo);
}); });
</script> </script>

@ -228,7 +228,7 @@
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30 $P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize }; $P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize };
$P.control.beforeCurrent = null; $P.control.beforeCurrent = null;
$P.detailControl = new DatasetControl({ $P.detailControl = new DatasetControl({
urls : { urls : {
@ -239,7 +239,7 @@
, keymapper : info => info ? info.DSCDMNG_SN : "" , keymapper : info => info ? info.DSCDMNG_SN : ""
, dataGetter : obj => obj.dsuseMgtDetailList , dataGetter : obj => obj.dsuseMgtDetailList
, formats : { , formats : {
PRD_VALID_DE: dateFormat PRD_VALID_DE: dateFormat
} }
}); });
@ -259,7 +259,7 @@
, func: "pageObject['${pageName}'].control.load({index})" , func: "pageObject['${pageName}'].control.load({index})"
}); });
}; };
$P.detailControl.onDatasetChange = (obj) => { $P.detailControl.onDatasetChange = (obj) => {
@ -269,7 +269,7 @@
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => { $P.control.onCurrentChange = (item) => {
if (!item) { if (!item) {
$P.detailControl.setData([]); $P.detailControl.setData([]);
return; return;
} }
let key = item.data.DSCDMNG_ID; let key = item.data.DSCDMNG_ID;
@ -303,13 +303,13 @@
bsshCd: row.BSSH_CD, bsshCd: row.BSSH_CD,
rprsntvNm: row.RPRSNTV_NM, rprsntvNm: row.RPRSNTV_NM,
prmisnNo: row.PRMISN_NO, prmisnNo: row.PRMISN_NO,
bizrno: row.BIZR_NO, bizrno: row.BIZRNO,
dsusePrvCd: row.DSUSE_PRV_CD, dsusePrvCd: row.DSUSE_PRV_CD,
dsuseAcdtDe: row.DSUSE_ACDT_DE, dsuseAcdtDe: row.DSUSE_ACDT_DE,
prgrsSttsCd: row.PRGRS_STTS_CD prgrsSttsCd: row.PRGRS_STTS_CD
}; };
} }
ajax.get({ ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do") url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data : params , data : params
@ -326,7 +326,7 @@
} }
}); });
} }
// 신청서 정보 dialog // 신청서 정보 dialog
$P.control.removeDsuseMgt = (dscdmngId) => { $P.control.removeDsuseMgt = (dscdmngId) => {
let params = { let params = {
@ -334,7 +334,7 @@
userId: "${currentUser.account}", userId: "${currentUser.account}",
useYn: "N" useYn: "N"
}; };
ajax.get({ ajax.get({
url : wctx.url("/adds/nims/removeDsuseMgt.do") url : wctx.url("/adds/nims/removeDsuseMgt.do")
, data: params , data: params
@ -387,7 +387,7 @@
if(option != null && option.reloaded){ if(option != null && option.reloaded){
initScroll = false; initScroll = false;
} }
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
} }
@ -436,7 +436,7 @@
$P.fnCreateDsuseMGT = () => { $P.fnCreateDsuseMGT = () => {
$P.control.getInfo(); $P.control.getInfo();
} }
// 폐기신청서 접수 등록 버튼 이벤트 // 폐기신청서 접수 등록 버튼 이벤트
$P.fnRemoveDsuseMGT = () => { $P.fnRemoveDsuseMGT = () => {
const row = $P.control.dataset.getCurrent(); const row = $P.control.dataset.getCurrent();
@ -454,7 +454,7 @@
} }
}); });
} }
// 업체 검색 버튼 이벤트 // 업체 검색 버튼 이벤트
$P.fnSearchBssh = (title) => { $P.fnSearchBssh = (title) => {
$P.control.getBsshInfo(); $P.control.getBsshInfo();
@ -532,7 +532,7 @@
$("#btnCreateDsuseMGT--${pageName}").on("click", function() { $("#btnCreateDsuseMGT--${pageName}").on("click", function() {
$P.fnCreateDsuseMGT($(this).attr("title")); $P.fnCreateDsuseMGT($(this).attr("title"));
}); });
// 폐기신청서 삭제 // 폐기신청서 삭제
$("#btnRemoveDsuseMGT--${pageName}").on("click", function() { $("#btnRemoveDsuseMGT--${pageName}").on("click", function() {
$P.fnRemoveDsuseMGT($(this).attr("title")); $P.fnRemoveDsuseMGT($(this).attr("title"));
@ -561,7 +561,7 @@
// DataTables 스크롤 이벤트 생성 // DataTables 스크롤 이벤트 생성
Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList); Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 하단 테이블 행 번호 표시 // 하단 테이블 행 번호 표시
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail') Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
, (tr)=>{ return $(tr).find("td.row-num")[0]; } , (tr)=>{ return $(tr).find("td.row-num")[0]; }

Loading…
Cancel
Save