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 25d2e0e6..9440193f 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 @@ -96,6 +96,7 @@ $P.callPurpose = "${callPurpose}"; // datasetControl $P.ctrl = newExcl01020Control("${pageName}", "[data-doctx=${pageName}]"); + // $P.saveCallbackFuncName = "${saveCallbackFuncName}"; $P.savedCallbackFuncName = "${savedCallbackFuncName}"; @@ -154,7 +155,7 @@ AppSupport.initDatepicker($P.findn("frmEdit")); // 기본 데이터 설정 - $P.$findn("levyExclYmd").datepicker("setDate", TODAY()); // 달력 초기화 + $P.$findn("levyExclYmd").datepicker("setDate", TODAY()); // 부과 제외 일자 // 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true if ($P.callPurpose == "view") { diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp index 2a17fa60..07726177 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp @@ -12,13 +12,13 @@ - @@ -36,7 +36,7 @@
수정일시 | 요일 | 수정사용자 | @@ -52,7 +52,7 @@
---|---|---|
{REG_DT} | {WEEK_NM} | {RGTR_NM} | @@ -89,6 +89,8 @@ diff --git a/src/main/webapp/resources/js/fims/sprt/sprt02080.js b/src/main/webapp/resources/js/fims/sprt/sprt02080.js index 15907090..bf4b4aa5 100644 --- a/src/main/webapp/resources/js/fims/sprt/sprt02080.js +++ b/src/main/webapp/resources/js/fims/sprt/sprt02080.js @@ -1,46 +1,84 @@ -function newSprt02030Control(pageName, doctx="[data-doctx='sprt02030']") { - let ctrl = new DatasetControl({ +function newSprt02080Control(pageName, doctx="[data-doctx='sprt02080']", mainPageName="sprt02010") { + let ctrlCvlcptDscsn = new DatasetControl({ doctx: doctx - , prefix: "levyExcl" - , prefixName: "부과제외" - , dataGetter: obj => obj["Info"] - , keys: ["LEVY_EXCL_ID"] + , prefix: "cvlcptDscsn" + , prefixName: "민원상담" + , dataGetter: obj => obj["cvlcptDscsns"] + , keys: ["CVLCPT_DSCSN_ID"] + , appendData: true + , infoSize: "lg" , urls: { load: "/list.do" , getInfo: "/info.do" - , create: "/create.do" - , update: "/update.do" - , remove: "/remove.do" + } + , formats: { + REG_DT: datetimeFormat + , MDFCN_DT: datetimeFormat } }); /************************************************************************** * DatasetControl Events **************************************************************************/ + // Dataset 변경 이벤트 + ctrlCvlcptDscsn.onDatasetChange = (obj, option) => { + // 데이터 셋 + let dataList = ctrlCvlcptDscsn.dataset; + let empty = dataList.empty; + + let replacer = (str, dataItem) => str + .replace(/{onclick}/gi, "pageObject['" + pageName + "'].ctrlCvlcptDscsn.setCurrent('{data-index}');") + + let trs = empty ? + [ctrlCvlcptDscsn.find("[name='tmpltNotFoundCvlcptDscsn']").innerHTML] + : dataList.inStrings(ctrlCvlcptDscsn.find("[name='tmpltCvlcptDscsnRows']").innerHTML, replacer); + + // dataTables(그리드)에 자료 표시 td + $(ctrlCvlcptDscsn.find("[name='tbodyCvlcptDscsnList']")).html(trs.join()); + }; + // 현재 선택 자료 변경 이벤트 - ctrl.onCurrentChange = (item) => { + ctrlCvlcptDscsn.onCurrentChange = (item) => { + Apply.fromDataset.currentRow(ctrlCvlcptDscsn.dataset, item, ctrlCvlcptDscsn.find("[name='tbodyCvlcptDscsnList']")); + if (!item) return; // 화면에 단속 Dataset 셋팅 - let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']")); - formFields.set(ctrl, item); + let formFields = new FimsFormFields(ctrlCvlcptDscsn.selector("[name='frmEditCvlcptDscsn']")); + formFields.set(ctrlCvlcptDscsn, item); + }; - // 업무구분에 따른 URL 변경 - pageObject[pageName].fnSetURL(item.data.TASK_SE_CD); + // 상세 정보 dialog + ctrlCvlcptDscsn.getInfo = (params) => { + if (!params) return; - // 부과제외구분에 따른 부과제외사유 설정 - pageObject[pageName].fnSetFim021(item.data.LEVY_EXCL_SE_CD, item.data.LEVY_EXCL_RSN_CD); + ajax.get({ + url: wctx.url("/" + params.taskSeCd +"/sprt/sprt04/020/info.do") + , data: params || {} + , success: (resp) => { + let dialogName = ctrlCvlcptDscsn.prefixed("Dialog"); + let dialogId = dialogName + "-" + uuid(); - // 부과제외일자 - if (item.data.LEVY_EXCL_YMD == "") { - $(ctrl.find("[name='levyExclYmd']")).datepicker("setDate", TODAY()); - } - }; + dialog.open({ + id: dialogId + , title: params.btnTitle + , size: ctrlCvlcptDscsn.infoSize + , content: resp + , init: () => { + $("#" + dialogId).attr("name", dialogName); + $("#" + dialogId).attr("data-ref-doctx", pageName); + + AppSupport.setDialogZindex(); + } + , onClose: () => { pageObject[pageName].fnRefresh(); } // 정보 새로고침 + }); + } + }); + } - // 저장 callback - ctrl.onSave = (params, resp) => { - let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, ctrl.prefixName); - let modalId = $(document.querySelector(doctx)).parents(".modal")[0].id; + // 삭제 callback + ctrlCvlcptDscsn.onRemove = (params, resp) => { + let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle); // 메시지 출력 dialog.alert({ @@ -48,33 +86,21 @@ function newSprt02030Control(pageName, doctx="[data-doctx='sprt02030']") { , init: () => { AppSupport.setDialogZindex(); } , onOK: () => { } , onClose: () => { - if (pageObject[pageName].savedCallbackFuncName != "") { - pageObject[pageName].savedCallbackFuncName(resp.saved); - } - - if (resp.saved) { dialog.close(modalId); } + if (resp.saved) { pageObject[pageName].fnRefresh(); } // 정보 새로고침 } }); } - // 저장 - ctrl.save = (params) => { + // 삭제 + ctrlCvlcptDscsn.remove = (params) => { if (!params) return; - let create = (params.callPurpose == "create"); - - // 민원 접수 관리에서 호출했다면.. - if (create && pageObject[pageName].saveCallbackFuncName != "") { - pageObject[pageName].saveCallbackFuncName(info); - } else { - ajax.post({ - url: !create ? ctrl.urls.update : ctrl.urls.create - , data: params || {} - , success: (resp) => { ctrl.onSave(params, resp); } - }); - } - + ajax.post({ + url: wctx.url("/" + params.taskSeCd + "/sndb/sndb01/220/remove.do") + , data: params || {} + , success: (resp) => { ctrlCvlcptDscsn.onRemove(params, resp); } + }); } - return ctrl; + return ctrlCvlcptDscsn; } diff --git a/src/main/webapp/resources/js/fims/sprt/sprt04020.js b/src/main/webapp/resources/js/fims/sprt/sprt04020.js new file mode 100644 index 00000000..0fd2cc7e --- /dev/null +++ b/src/main/webapp/resources/js/fims/sprt/sprt04020.js @@ -0,0 +1,61 @@ +function newSprt04020Control(pageName, doctx="[data-doctx='sprt04020']") { + let ctrl = new DatasetControl({ + doctx: doctx + , prefix: "cvlcptDscsn" + , prefixName: "민원상담" + , dataGetter: obj => obj["info"] + , keys: ["CVLCPT_DSCSN_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 + "/020/create.do"); // 등록 + ctrl.urls.update = wctx.url("/" + item.data.TASK_SE_CD + pageObject[pageName].prefixUrl + "/020/update.do"); // 수정 + }; + + // 저장 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.cvlcptDscsnId == ""); + + ajax.post({ + url: !create ? ctrl.urls.update : ctrl.urls.create + , data: params || {} + , success: (resp) => { ctrl.onSave(params, resp); } + }); + } + + return ctrl; +}