From def3fbc181ec61b231fe1e6ea0d790b0000f1573 Mon Sep 17 00:00:00 2001 From: JoJH Date: Fri, 15 Nov 2024 15:54:45 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EB=B0=98=EC=86=A1=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.=202.=20=EA=B3=B5=EC=8B=9C=EC=86=A1=EB=8B=AC?= =?UTF-8?q?=20=ED=98=84=ED=99=A9=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/excl/excl01010-main.jsp | 4 +- .../WEB-INF/jsp/fims/excl/excl01020-info.jsp | 4 +- .../WEB-INF/jsp/fims/sndb/sndb01020-info.jsp | 9 +- .../WEB-INF/jsp/fims/sndb/sndb01030-main.jsp | 4 +- .../WEB-INF/jsp/fims/sndb/sndb01040-info.jsp | 9 +- .../WEB-INF/jsp/fims/sndb/sndb01060-info.jsp | 11 +- .../WEB-INF/jsp/fims/sndb/sndb01070-main.jsp | 4 +- .../WEB-INF/jsp/fims/sndb/sndb01080-info.jsp | 9 +- .../WEB-INF/jsp/fims/sndb/sndb01110-main.jsp | 6 +- .../WEB-INF/jsp/fims/sndb/sndb01120-info.jsp | 9 +- .../WEB-INF/jsp/fims/sndb/sndb01220-main.jsp | 1491 ++++++++--------- .../WEB-INF/jsp/fims/sndb/sndb01240-main.jsp | 1358 +++++++-------- .../WEB-INF/jsp/fims/sndb/sndb01250-info.jsp | 1008 ++++++----- .../WEB-INF/jsp/fims/sndb/sndb01260-info.jsp | 396 ++--- .../resources/js/fims/sndb/sndb01110.js | 2 +- .../resources/js/fims/sndb/sndb01220.js | 152 ++ .../resources/js/fims/sndb/sndb01240.js | 149 ++ .../resources/js/fims/sndb/sndb01250.js | 114 ++ .../resources/js/fims/sndb/sndb01260.js | 79 + 19 files changed, 2507 insertions(+), 2311 deletions(-) create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01220.js create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01240.js create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01250.js create mode 100644 src/main/webapp/resources/js/fims/sndb/sndb01260.js diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp index a25ed129..c0a1a705 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01010-main.jsp @@ -520,8 +520,8 @@ // 삭제 버튼 클릭 이벤트 $P.fnRemove = (btnTitle) => { - let selected = $P.ctrl.getDataset("selected"); // 선택 자료 - + // 선택 자료 확인 + let selected = $P.ctrl.getDataset("selected"); if (selected.length < 1) { dialog.alert({ content: "선택하신 " + $P.ctrl.prefixName + " 정보가 없습니다." diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp index 59ec3c41..8fe78039 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp @@ -47,9 +47,7 @@
-
-
- +
diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp index 35b21add..ace344df 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01020-info.jsp @@ -162,12 +162,12 @@ // URL $P.prefixUrl = "${prefixUrl}"; - // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) - $P.callPurpose = "${callPurpose}"; // datasetControl $P.ctrl = newSndb01020Control("${pageName}", "[data-doctx=${pageName}]"); + // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) + $P.callPurpose = "${callPurpose}"; // main 의 검색 조건을 그대로 유지 - $P.ctrl.query = ${mainQuery}; + $P.mainQuery = ${mainQuery}; /************************************************************************** * DataTables 이벤트 @@ -316,6 +316,9 @@ // 업무 구분에 따른 URL 설정 $P.ctrl.urls.load = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/020/info.do"); // 조회 $P.ctrl.urls.create = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/020/createList.do"); // 등록 + + // 검색 조건 + $P.ctrl.query = $P.mainQuery; } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01030-main.jsp index 5a3e65a6..abe5da3c 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01030-main.jsp @@ -274,12 +274,12 @@ let params = { btnTitle: $P.ctrl.prefixName + " 상세 정보" + , pageNum: 1 // 페이지 번호 + , fetchSize: DEFAULT_FETCH_SIZE // 1번에 조회되는 건수 , callPurpose: "update" , sggCd: $P.ctrl.getValue("SGG_CD") // 시군구 코드 , taskSeCd: $P.ctrl.getValue("TASK_SE_CD") // 업무 구분 코드 , sndngId: $P.ctrl.getValue("SNDNG_ID") // 발송 ID - , pageNum: 1 // 페이지 번호 - , fetchSize: DEFAULT_FETCH_SIZE // 1번에 조회되는 건수 }; $P.ctrl.getInfo(params); diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01040-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01040-info.jsp index cb55f35c..bc99f46d 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01040-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01040-info.jsp @@ -134,12 +134,12 @@ // URL $P.prefixUrl = "${prefixUrl}"; - // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) - $P.callPurpose = "${callPurpose}"; // datasetControl $P.ctrl = newSndb01040Control("${pageName}", "[data-doctx=${pageName}]"); + // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) + $P.callPurpose = "${callPurpose}"; // main 의 검색 조건을 그대로 유지 - $P.ctrl.query = ${mainQuery}; + $P.mainQuery = ${mainQuery}; /************************************************************************** * DataTables 이벤트 @@ -303,6 +303,9 @@ // 업무 구분에 따른 URL 설정 $P.ctrl.urls.create = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/040/list.do"); // 조회 + + // 검색 조건 + $P.ctrl.query = $P.mainQuery; } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01060-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01060-info.jsp index 77234aa7..87ece94c 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01060-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01060-info.jsp @@ -160,14 +160,12 @@ // URL $P.prefixUrl = "${prefixUrl}"; - // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) - $P.callPurpose = "${callPurpose}"; - // 사전통지 일자 - $P.advntceYmdInfo = ${advntceYmdInfo}; // datasetControl $P.ctrl = newSndb01060Control("${pageName}", "[data-doctx=${pageName}]"); + // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) + $P.callPurpose = "${callPurpose}"; // main 의 검색 조건을 그대로 유지 - $P.ctrl.query = ${mainQuery}; + $P.mainQuery = ${mainQuery}; /************************************************************************** * DataTables 이벤트 @@ -321,6 +319,9 @@ // 업무 구분에 따른 URL 설정 $P.ctrl.urls.load = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/060/info.do"); // 조회 $P.ctrl.urls.create = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/060/createList.do"); // 등록 + + // 검색 조건 + $P.ctrl.query = $P.mainQuery; } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01070-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01070-main.jsp index 15f00e62..348ca29e 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01070-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01070-main.jsp @@ -274,12 +274,12 @@ let params = { btnTitle: $P.ctrl.prefixName + " 상세 정보" + , pageNum: 1 // 페이지 번호 + , fetchSize: DEFAULT_FETCH_SIZE // 1번에 조회되는 건수 , callPurpose: "update" , sggCd: $P.ctrl.getValue("SGG_CD") // 시군구 코드 , taskSeCd: $P.ctrl.getValue("TASK_SE_CD") // 업무 구분 코드 , sndngId: $P.ctrl.getValue("SNDNG_ID") // 발송 ID - , pageNum: 1 // 페이지 번호 - , fetchSize: DEFAULT_FETCH_SIZE // 1번에 조회되는 건수 }; $P.ctrl.getInfo(params); diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01080-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01080-info.jsp index 35a9fddc..cf03552a 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01080-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01080-info.jsp @@ -166,12 +166,12 @@ // URL $P.prefixUrl = "${prefixUrl}"; - // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) - $P.callPurpose = "${callPurpose}"; // datasetControl $P.ctrl = newSndb01080Control("${pageName}", "[data-doctx=${pageName}]"); + // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) + $P.callPurpose = "${callPurpose}"; // main 의 검색 조건을 그대로 유지 - $P.ctrl.query = ${mainQuery}; + $P.mainQuery = ${mainQuery}; /************************************************************************** * DataTables 이벤트 @@ -557,6 +557,9 @@ // 업무 구분에 따른 URL 설정 $P.ctrl.urls.load = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/080/list.do"); // 조회 + + // 검색 조건 + $P.ctrl.query = $P.mainQuery; } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01110-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01110-main.jsp index 8d748c12..015711b8 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01110-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01110-main.jsp @@ -251,7 +251,7 @@ // URL $P.prefixUrl = "${prefixUrl}"; // datasetControl - $P.ctrl = newSndb01070Control("${pageName}", "[data-doctx=${pageName}]"); + $P.ctrl = newSndb01110Control("${pageName}", "[data-doctx=${pageName}]"); /************************************************************************** * DataTables 이벤트 @@ -329,12 +329,12 @@ url: wctx.url("/" + params.taskSeCd + $P.prefixUrl + "/100/info.do") , data: params || {} , success: (resp) => { - let dialogName = "userDialog"; + let dialogName = $P.ctrl.prefixed("Dialog"); let dialogId = dialogName + "-" + uuid(); dialog.open({ id: dialogId - , title: "고지서 발송 대상" + , title: params.btnTitle , size: "lg" , content: resp , init: () => { diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01120-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01120-info.jsp index 2bce026a..8f549129 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01120-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01120-info.jsp @@ -160,12 +160,12 @@ // URL $P.prefixUrl = "${prefixUrl}"; - // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) - $P.callPurpose = "${callPurpose}"; // datasetControl $P.ctrl = newSndb01120Control("${pageName}", "[data-doctx=${pageName}]"); + // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) + $P.callPurpose = "${callPurpose}"; // main 의 검색 조건을 그대로 유지 - $P.ctrl.query = ${mainQuery}; + $P.mainQuery = ${mainQuery}; /************************************************************************** * DataTables 이벤트 @@ -470,6 +470,9 @@ // 업무 구분에 따른 URL 설정 $P.ctrl.urls.load = wctx.url("/" + "${taskSeCd}" + $P.prefixUrl + "/120/list.do"); + + // 검색 조건 + $P.ctrl.query = $P.mainQuery; } /************************************************************************** diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01220-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01220-main.jsp index 58f27e73..7529a079 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01220-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01220-main.jsp @@ -3,808 +3,705 @@ 반송 현황 - -
- -
-
- -
- - - - - -
- - - -
- - - - -
+
+ + + + + ~ + + + +
+
+ + + + +
+
+
+ + + + +
+ + +
+ +
    +
+
+ + + + + + + +
+
+ + + +
+ +
+ +
+ + + +
- + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01240-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01240-main.jsp index d7eb06db..ac082020 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01240-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01240-main.jsp @@ -3,721 +3,657 @@ 공시송달 현황 - -
- -
-
- -
- - - - - -
- - - -
- - - - -
+
+ + + + +
+
+
+ + + + +
+ + +
+ +
    +
+
+ + + + + + +
+
+ + + +
+ +
+ +
+ + + +
- + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01250-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01250-info.jsp index 2777dc1d..8bc3cba9 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01250-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01250-info.jsp @@ -1,543 +1,481 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> -공시송달 상세 - - -
- -
- - -
- -
- -
- - - -
- - -
- -
    -
-
- - - - - - -
-
- - -
- -
-
- - - -
- +고지서 발송 현황 상세 정보 + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + +
+ +
    +
+
+ + + + + + +
+
+ + +
+ +
+
+ +
+
- + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01260-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01260-info.jsp index a3324e85..3c9f331f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01260-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sndb/sndb01260-info.jsp @@ -1,249 +1,169 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> -공시송달 정보 +공시송달 등록 -
- -
- - -
- -
- - - - - -
- -
- - -
- -
- - - -
- -
- - - -
- -
- - -
- -
- - -
- -
- - -
-
-
- - - -
- - - - - - -
-
- - -
- +
+ +
+
+ +
+ + + + + +
+ +
+ + +
+
+ + + + + ~ + + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + +
+ + + + + + +
+ +
+
diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01110.js b/src/main/webapp/resources/js/fims/sndb/sndb01110.js index 1d6d953f..22ab26b4 100644 --- a/src/main/webapp/resources/js/fims/sndb/sndb01110.js +++ b/src/main/webapp/resources/js/fims/sndb/sndb01110.js @@ -1,4 +1,4 @@ -function newSndb01070Control(pageName, doctx="[data-doctx='sndb01070']") { +function newSndb01110Control(pageName, doctx="[data-doctx='sndb01110']") { let ctrl = new DatasetControl({ doctx: doctx , prefix: "nhtSndng" diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01220.js b/src/main/webapp/resources/js/fims/sndb/sndb01220.js new file mode 100644 index 00000000..8786eb2c --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01220.js @@ -0,0 +1,152 @@ +function newSndb01220Control(pageName, doctx="[data-doctx='sndb01220']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "sndbk" + , prefixName: "반송" + , dataGetter: obj => obj["List"] + , keys: ["SNDNG_DTL_ID"] + , appendData: true + , infoSize: "xxl" + , urls: { + load: "/list.do" + , getInfo: "/info.do" + , remove: "/remove.do" + } + , formats: { + DLVR_YMD: dateFormat + , DLVR_TM: timeFormat + , SNDNG_YMD: dateFormat + , CRDN_YMD_TM: datetimeFormat + , FFNLG_AMT: numberFormat + , PCPTAX: numberFormat + , ADAMT: numberFormat + , REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat + } + }); + + // 검색 조건 + ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인 + // paging + ctrl.pagingSupport = new FimsPagingSupport({ + ctrl: ctrl // DatasetControl + , ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시 + , linkContainer: "[name='dataPaging']" //
    + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + // Dataset 변경 이벤트 + ctrl.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrl.dataset; + let empty = dataList.empty; + let clsForTask = $(ctrl.find("[name='frmSearch']")).find("[name='taskSeCd']:checked").val().toLowerCase(); + + // 업무별 dataTables(그리드) tr, td + let foundContent = ctrl.find("[name='tmpltRows']").content; + let foundTr = $(foundContent).find("tr")[0].cloneNode(false); + let foundTds = $(foundContent).find("." + clsForTask + ",.cmn"); + + foundTds.each(function() { + foundTr.appendChild(this.cloneNode(true)); + }); + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');") + .replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{data-index}');"); + + let trs = empty ? + [ctrl.find("[name='tmpltNotFound']").content.querySelector("." + clsForTask + ",.cmn").outerHTML] + : dataList.inStrings(foundTr.outerHTML, replacer); + + let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수 + let initScroll = (ctrl.query.pageNum < 2); + + if (option != null && option.reloaded) { + initScroll = false; + } + + // dataTables(그리드)에 자료 표시 td + ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore); + + // checkbox 체크 해제 + $(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false); + + // dataTables(그리드)에 페이지 표시 pagingInfo + ctrl.pagingSupport.setPagingInfo(obj); + + // 보안모드 + fn_securityModeToggle($("#securityMode--top").is(":checked")); + }; + + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); + }; + + // 선택(체크) 변경 이벤트 + ctrl.onSelectionChange = (selectedArr) => { + // gridCheckbox + Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr); + // gridButton + Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnCreateSlctnSndngLink']"), selectedArr); // 선택 대상 통합우편 발송 버튼 + }; + + // 상세 정보 dialog + ctrl.getInfo = (params) => { + if (!params) return; + + ajax.get({ + url: ctrl.urls.getInfo + , data: params || {} + , success: (resp) => { + let dialogName = ctrl.prefixed("Dialog"); + let dialogId = dialogName + "-" + uuid(); + + dialog.open({ + id: dialogId + , title: params.btnTitle + , size: ctrl.infoSize + , content: resp + , init: () => { + $("#" + dialogId).attr("name", dialogName); + $("#" + dialogId).attr("data-ref-doctx", pageName); + + AppSupport.setDialogZindex(); + } + , onClose: () => { ctrl.reload({all : true}); } // 자료 재조회 + }); + } + }); + } + + // 삭제 callback + ctrl.onRemove = (params, resp) => { + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle); + + // 메시지 출력 + dialog.alert({ + content: showMessage + , init: () => { AppSupport.setDialogZindex(); } + , onOK: () => { } + , onClose: () => { + if (resp.saved) { ctrl.reload({ all: true }); } // 자료 재조회 + } + }); + } + + // 삭제 + ctrl.remove = (params) => { + if (!params) return; + + ajax.post({ + url: ctrl.urls.remove + , data: params || {} + , success: (resp) => { ctrl.onRemove(params, resp); } + }); + } + + return ctrl; +} diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01240.js b/src/main/webapp/resources/js/fims/sndb/sndb01240.js new file mode 100644 index 00000000..97405b47 --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01240.js @@ -0,0 +1,149 @@ +function newSndb01240Control(pageName, doctx="[data-doctx='sndb01240']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "svbtc" + , prefixName: "공시송달" + , dataGetter: obj => obj["List"] + , keys: ["SVBTC_ID"] + , appendData: true + , infoSize: "xxl" + , urls: { + load: "/list.do" + , getInfo: "/info.do" + , remove: "/remove.do" + } + , formats: { + SVBTC_YMD: dateFormat + , SVBTC_END_YMD: dateFormat + , TNOCS: numberFormat + , GRAMT: numberFormat + , REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat + } + }); + + // 검색 조건 + ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인 + // paging + ctrl.pagingSupport = new FimsPagingSupport({ + ctrl: ctrl // DatasetControl + , ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시 + , linkContainer: "[name='dataPaging']" //
      + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + // Dataset 변경 이벤트 + ctrl.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrl.dataset; + let empty = dataList.empty; + let clsForTask = $(ctrl.find("[name='frmSearch']")).find("[name='taskSeCd']:checked").val().toLowerCase(); + + // 업무별 dataTables(그리드) tr, td + let foundContent = ctrl.find("[name='tmpltRows']").content; + let foundTr = $(foundContent).find("tr")[0].cloneNode(false); + let foundTds = $(foundContent).find("." + clsForTask + ",.cmn"); + + foundTds.each(function() { + foundTr.appendChild(this.cloneNode(true)); + }); + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');") + .replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{data-index}');"); + + let trs = empty ? + [ctrl.find("[name='tmpltNotFound']").content.querySelector("." + clsForTask + ",.cmn").outerHTML] + : dataList.inStrings(foundTr.outerHTML, replacer); + + let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수 + let initScroll = (ctrl.query.pageNum < 2); + + if (option != null && option.reloaded) { + initScroll = false; + } + + // dataTables(그리드)에 자료 표시 td + ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore); + + // checkbox 체크 해제 + $(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false); + + // dataTables(그리드)에 페이지 표시 pagingInfo + ctrl.pagingSupport.setPagingInfo(obj); + + // 보안모드 + fn_securityModeToggle($("#securityMode--top").is(":checked")); + }; + + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); + }; + + // 선택(체크) 변경 이벤트 + ctrl.onSelectionChange = (selectedArr) => { + // gridCheckbox + Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr); + // gridButton + Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnRemove']"), selectedArr); // 선택 대상 통합우편 발송 버튼 + }; + + // 상세 정보 dialog + ctrl.getInfo = (params) => { + if (!params) return; + + ajax.get({ + url: ctrl.urls.getInfo + , data: params || {} + , success: (resp) => { + let dialogName = ctrl.prefixed("Dialog"); + let dialogId = dialogName + "-" + uuid(); + + dialog.open({ + id: dialogId + , title: params.btnTitle + , size: ctrl.infoSize + , content: resp + , init: () => { + $("#" + dialogId).attr("name", dialogName); + $("#" + dialogId).attr("data-ref-doctx", pageName); + + AppSupport.setDialogZindex(); + } + , onClose: () => { ctrl.reload({all : true}); } // 자료 재조회 + }); + } + }); + } + + // 삭제 callback + ctrl.onRemove = (params, resp) => { + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle); + + // 메시지 출력 + dialog.alert({ + content: showMessage + , init: () => { AppSupport.setDialogZindex(); } + , onOK: () => { } + , onClose: () => { + if (resp.saved) { ctrl.reload({ all: true }); } // 자료 재조회 + } + }); + } + + // 삭제 + ctrl.remove = (params) => { + if (!params) return; + + ajax.post({ + url: ctrl.urls.remove + , data: params || {} + , success: (resp) => { ctrl.onRemove(params, resp); } + }); + } + + return ctrl; +} diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01250.js b/src/main/webapp/resources/js/fims/sndb/sndb01250.js new file mode 100644 index 00000000..6607f89d --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01250.js @@ -0,0 +1,114 @@ +function newSndb01250Control(pageName, doctx="[data-doctx='sndb01250']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "svbtcDtl" + , prefixName: "공시송달 상세 정보" + , dataGetter: obj => obj["List"] + , keys: ["SNDNG_DTL_ID"] + , appendData: true + , urls: { + load: "/list.do" + } + , formats: { + SVBTC_YMD: dateFormat + , SVBTC_END_YMD: dateFormat + , SNDNG_YMD: dateFormat + , SNDNG_END_YMD: dateFormat + , DLVR_YMD: dateFormat + , LEVY_YMD: dateFormat + , DUDT_YMD: dateFormat + , FFNLG_AMT: numberFormat + , PCPTAX: numberFormat + , ADAMT: numberFormat + , REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat + } + }); + + // 검색 조건 + ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인 + // paging + ctrl.pagingSupport = new FimsPagingSupport({ + ctrl: ctrl // DatasetControl + , ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시 + , linkContainer: "[name='dataPaging']" //
        + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + ctrl.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrl.dataset; + let empty = dataList.empty; + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');") + .replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{data-index}');"); + + let trs = empty ? + [ctrl.find("[name='tmpltNotFound']").innerHTML] + : dataList.inStrings(ctrl.find("[name='tmpltRows']").innerHTML, replacer); + + let noMore = (dataList.length >= obj["Paging"]?.totalSize); // 전체 건수 + let initScroll = (ctrl.query.pageNum < 2); + + if (option != null && option.reloaded) { + initScroll = false; + } + + // dataTables(그리드)에 자료 표시 td + ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore); + + // checkbox 체크 해제 + $(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false); + + // dataTables(그리드)에 페이지 표시 pagingInfo + ctrl.pagingSupport.setPagingInfo(obj); + + // 보안모드 + fn_securityModeToggle($("#securityMode--top").is(":checked")); + }; + + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); + }; + + // 선택(체크) 변경 이벤트 + ctrl.onSelectionChange = (selectedArr) => { + // gridCheckbox + Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr); + // gridButton + Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnPrintHwp']"), selectedArr); // 한글파일 출력 버튼 + Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnRemove']"), selectedArr); // 공시송달 삭제 버튼 + }; + + // 삭제 callback + ctrl.onRemove = (params, resp) => { + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle); + + // 메시지 출력 + dialog.alert({ + content: showMessage + , init: () => { AppSupport.setDialogZindex(); } + , onOK: () => { } + , onClose: () => { + if (resp.saved) { ctrl.reload({ all: true }); } // 자료 재조회 + } + }); + } + + // 삭제 + ctrl.remove = (params) => { + if (!params) return; + + ajax.post({ + url: ctrl.urls.remove + , data: params || {} + , success: (resp) => { ctrl.onRemove(params, resp); } + }); + } + + return ctrl; +} diff --git a/src/main/webapp/resources/js/fims/sndb/sndb01260.js b/src/main/webapp/resources/js/fims/sndb/sndb01260.js new file mode 100644 index 00000000..571668b3 --- /dev/null +++ b/src/main/webapp/resources/js/fims/sndb/sndb01260.js @@ -0,0 +1,79 @@ +function newSndb01260Control(pageName, doctx="[data-doctx='sndb01260']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "svbtc" + , prefixName: "공시송달" + , dataGetter: obj => obj["Info"] + , keys: ["SVBTC_ID"] + , urls: { + create: "/create.do" + , update: "/update.do" + } + }); + + /************************************************************************** + * DatasetControl Events + **************************************************************************/ + // 현재 선택 자료 변경 이벤트 + ctrl.onCurrentChange = (item) => { + if (!item) return; + + // 화면에 단속 Dataset 셋팅 + let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']")); + formFields.set(ctrl, item); + + // 업무구분에 따른 URL 변경 + ctrl.urls.create = wctx.url("/" + item.data.TASK_SE_CD + pageObject[pageName].prefixUrl + "/260/create.do"); // 등록 + ctrl.urls.update = wctx.url("/" + item.data.TASK_SE_CD + pageObject[pageName].prefixUrl + "/260/update.do"); // 수정 + + // 등록이라면.. + if (!item.data.SVBTC_ID) { + let taskSeCd = item.data.TASK_SE_CD; + let sndngSeCd = item.data.SNDNG_SE_CD; + let ttlNm = ""; + + // 공시송달일자 + $(ctrl.find("[name='svbtcYmd']")).datepicker("setDate", TODAY()); + $(ctrl.find("[name='svbtcEndYmd']")).datepicker("setDate", DateSupport.getAddDay(15)); + + if (sndngSeCd) { + ttlNm = pageObject[pageName].FIM047[sndngSeCd].value.replace("(개별)", "") + " 공시송달"; + } else { + ttlNm = "공시송달"; + } + $(ctrl.find("[name='ttlNm']")).val(ttlNm); + } + } + + // 저장 callback + ctrl.onSave = (params, resp) => { + let modalId = $(document.querySelector(doctx)).parents(".modal")[0].id; + let dialogTitle = $("#" + modalId).find("h5.modal-title").html(); + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); + + // 메시지 출력 + dialog.alert({ + content: showMessage + , init: () => { AppSupport.setDialogZindex(); } + , onOK: () => { } + , onClose: () => { + if (resp.saved) { dialog.close(modalId); } + } + }); + } + + // 저장 + ctrl.save = (params) => { + if (!params) return; + + let create = (!params.svbtcId); + + ajax.post({ + url: !create ? ctrl.urls.update : ctrl.urls.create + , data: params || {} + , success: (resp) => { ctrl.onSave(params, resp); } + }); + } + + return ctrl; +}