From 9f000cdff45a827dfe45550830f69e87a6590f8a Mon Sep 17 00:00:00 2001
From: Leeyh1121 <130335980+Leeyh1121@users.noreply.github.com>
Date: Wed, 12 Jun 2024 16:03:52 +0900
Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=A0=9C=ED=92=88=20=ED=95=AD?=
=?UTF-8?q?=EB=AA=A9=20=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95=EC=A4=91.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../jsp/adds/nims/dsuseMgtReceipt-info.jsp | 320 +++++++++++-------
1 file changed, 193 insertions(+), 127 deletions(-)
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 38dd7fe..0a42392 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
@@ -9,141 +9,148 @@
@@ -182,6 +189,14 @@
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
+
+ $P.productList = new Dataset({
+ prefix: "dsuseMgtReceiptProductList"
+ , prefixName: "마약류 제품 조회"
+ , keymapper: info => info ? info.prductCd : ""
+ , dataGetter: obj => obj
+ , infoSize: "xl"
+ });
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
@@ -271,6 +286,34 @@
});
}
+ $P.productList.onDataSetChange = item => {
+ if (!item) return;
+
+ let empty = $P.productListList.empty;
+
+ // 업무별 DataTables(그리드) tr, td
+ let foundContent = document.getElementById("productListRow--productList").content;
+ let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
+ let foundTds = $(foundContent).find("td");
+
+ foundTds.each(function() {
+ foundTr.appendChild(this.cloneNode(true));
+ });
+
+ //
+ let replacer = (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("prductCd") + "');");
+
+ let trs = empty ? [document.getElementById("$productListNotFound--productList").content.outerHTML]
+ : $P.productList.inStrings(foundTr.outerHTML, replacer);
+
+ $("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true);
+ }
+
+ /**************************************************************************
+ * DataTables 이벤트
+ **************************************************************************/
+
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
@@ -305,6 +348,24 @@
}
});
}
+
+ //추가
+ $P.fnAdd = () => {
+ $P.productList.addData($P.productFormFields.get());
+ }
+
+ $P.fnDel = () => {
+ // validate 확인
+ if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
+
+ dialog.alert({
+ content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
+ , init: () => { setDialogZindex(); }
+ , onOK: () => {
+ $P.control.save($P.bsshFormFields.get()); // formFields
+ }
+ });
+ }
/**************************************************************************
* 초기 셋팅
@@ -322,6 +383,11 @@
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
+
+ $("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
+
+ $("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
+
}
// 초기 화면 설정