diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp
index 442a36ef..52e20098 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp
@@ -263,7 +263,7 @@
});
if (resp.saved) {
- $P.refreshDataInfo();
+ $P.refreshDataInfo(); // 자료 재조회
}
}
diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02040-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02040-info.jsp
index bffb8c82..eab0d667 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02040-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02040-info.jsp
@@ -326,7 +326,7 @@
});
if (resp.saved) {
- $P.refreshDataInfo();
+ $P.refreshDataInfo(); // 자료 재조회
}
}
diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02050-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02050-info.jsp
index 7c6e36e5..8dffaae8 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02050-info.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02050-info.jsp
@@ -392,7 +392,7 @@
// 자료 재조회
if (resp.saved) {
- $P.refreshDataInfo();
+ $P.refreshDataInfo(); // 자료 재조회
}
}
@@ -446,7 +446,7 @@
// 자료 재조회
if (resp.saved) {
- $P.refreshDataInfo();
+ $P.refreshDataInfo(); // 자료 재조회
}
}
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 54b002b7..38295422 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 @@
-
@@ -51,7 +51,7 @@
-
+
{REG_DT} |
{WEEK_NM} |
@@ -65,7 +65,7 @@
|
-
+
민원 상담 정보를 찾지 못했습니다. |
@@ -90,285 +90,280 @@
/**************************************************************************
* Global Variable
**************************************************************************/
- // URL
- var ${pageName}PrefixUrl = "/sprt/sprt04";
- // FormFields
- var ${pageName}Fields = new FimsFormFields("#frmEdit--${pageName}");
+ pageObject["${pageName}"] = {};
/**************************************************************************
- * DatasetControl
- **************************************************************************/
- var ${pageName}Control = new DatasetControl({
- prefix : "cvlcptDscsn"
- , prefixName : "민원상담"
- , infoSize : "lg"
- , keymapper : info => info ? info.CVLCPT_DSCSN_ID : ""
- , dataGetter : obj => obj.cvlcptDscsnList
- , appendData : true
- , formats : {
- REG_DT : datetimeFormat
- , MDFCN_DT : datetimeFormat
- }
- });
-
- /**************************************************************************
- * DatasetControl 이벤트
+ * script 진입
**************************************************************************/
- // Dataset 변경 이벤트
- ${pageName}Control.onDatasetChange = obj => {
- renderList${pageName}();
- }
-
- // 현재 선택 자료 변경 이벤트
- ${pageName}Control.onCurrentChange = item => {
- if (!item) return;
-
- let key = item.data.CVLCPT_DSCSN_ID;
-
- $("#tbody--${pageName}").setCurrentRow(key);
-
- $("#dscsnCn--${pageName}").val(item.data.DSCSN_CN); // 상담 내용
- };
-
- // 민원 상담 내용 Dialog
- ${pageName}Control.getInfo = (params) => {
- let dialogTitle = "";
-
- if (params.callPurpose == "create") {
- dialogTitle = ${pageName}Control.prefixName + " 등록";
- } else if (params.callPurpose == "update") {
- dialogTitle = ${pageName}Control.prefixName + " 수정";
- } else {
- return;
- }
-
- ajax.get({
- url : wctx.url(params.taskSeCd + ${pageName}PrefixUrl + "/020/info.do")
- , data : params || {}
- , success : resp => {
- dialog.open({
- id : ${pageName}Control.prefixed("Dialog")
- , title : dialogTitle
- , content : resp
- , size : "lg"
- , init : () => { }
- , onClose : () => { refreshDataInfo${pageName}(); } // callback 자료 재조회
- });
+ $(document).ready(function() {
+ // pageObject
+ var $P = pageObject["${pageName}"];
+
+ // FormFields
+ $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
+
+ /**************************************************************************
+ * DatasetControl
+ **************************************************************************/
+ $P.control = new DatasetControl({
+ prefix : "cvlcptDscsn"
+ , prefixName : "민원상담"
+ , infoSize : "lg"
+ , keymapper : info => info ? info.CVLCPT_DSCSN_ID : ""
+ , dataGetter : obj => obj.cvlcptDscsnList
+ , appendData : true
+ , formats : {
+ REG_DT : datetimeFormat
+ , MDFCN_DT : datetimeFormat
}
});
- }
- // 삭제 callback
- ${pageName}Control.onRemove = (resp) => {
- let btnTitle = $("#btnRemove--${pageName}").attr("title");
- let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, btnTitle);
+ /**************************************************************************
+ * DatasetControl 이벤트
+ **************************************************************************/
+ // Dataset 변경
+ $P.control.onDatasetChange = obj => {
+ $P.renderList();
+ };
- dialog.alert(showMessage);
+ // 현재 선택 자료 변경 이벤트
+ $P.control.onCurrentChange = item => {
+ if (!item) return;
- if (resp.saved) {
- $("#dscsnCn--${pageName}").val(""); // 상담내용 초기화
+ let key = item.data.CVLCPT_DSCSN_ID;
- refreshDataInfo${pageName}(); // 자료 재조회
- }
- }
-
- // 삭제
- ${pageName}Control.remove = (params) => {
- ajax.post({
- url : wctx.url(params.taskSeCd + ${pageName}PrefixUrl + "/010/remove.do")
- , data : params || {}
- , success : resp => ${pageName}Control.onRemove(resp) // 삭제 callback
- });
- }
+ $("#tbody--${pageName}").setCurrentRow(key);
- /**************************************************************************
- * function
- **************************************************************************/
- // DataTables에 click 이벤트
- renderList${pageName} = () => {
- let ${infoPrefix}List = ${pageName}Control.dataset;
- let empty = ${infoPrefix}List.empty;
-
- let trs = empty ?
- [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
- ${infoPrefix}List.inStrings(
- document.getElementById("${infoPrefix}Row--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%>
- (str, dataItem) => str
- .replace(/{onclick}/gi, "${pageName}Control.setCurrent('" + dataItem.getValue("CVLCPT_DSCSN_ID") + "');")
- );
-
- $("#tbody--${pageName}").html(trs.join());
- }
-
- // 자료 재조회
- refreshDataInfo${pageName} = () => {
- let crdnId = $("#crdnId--${pageNameMain}").val();
-
- // 단속 ID 가 없다면.. return
- if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
-
- let params = {
- callPurpose : "refresh"
- , inquiryCondition : "crdnId_vhrno"
- , crdnId : crdnId
- , sggCd : $("#sggCd--${pageNameMain}").val()
- , taskSeCd : $("#taskSeCd--${pageNameMain}").val()
- , vhrno : $("#vhrno--${pageNameMain}").val()
- , delYN : "N"
+ $("#dscsnCn--${pageName}").val(item.data.DSCSN_CN); // 상담 내용
};
- ajax.get({
- url : wctx.url(params.taskSeCd + "/sprt/sprt02/080/info.do")
- , headers: { Accept: "application/json; charset=utf-8" } // json
- , data : params || {}
- , success : resp => {
- // Dataset 초기화
- ${pageName}Control.dataset.clear();
-
- // Dataset 셋팅
- ${pageName}Control.setData(resp.cvlcptDscsn); // 민원상담 정보
- }
- });
- }
-
- // 민원상담 삭제
- removeCvlcptDscsn${pageName} = (obj) => {
- // 서버에 전송할 data(파라미터) 생성
- let params = {
- callPurpose : "remove"
- , crdnId : ${pageName}Control.dataset.getValue("CRDN_ID") // 단속 ID
- , sggCd : ${pageName}Control.dataset.getValue("SGG_CD") // 시군구 코드
- , taskSeCd : ${pageName}Control.dataset.getValue("TASK_SE_CD") // 업무 구분 코드
- , cvlcptDscsnId : ${pageName}Control.dataset.getValue("CVLCPT_DSCSN_ID") // 민원상담 ID
- , delYN : "Y" // 삭제 여부
- , delRsn : obj.reason // 삭제 사유
- };
+ // 민원 상담 내용 Dialog
+ $P.control.getInfo = (params) => {
+ if (!params) return;
+
+ ajax.get({
+ url : wctx.url("/" + params.taskSeCd +"/sprt/sprt04/020/info.do")
+ , data : params || {}
+ , success : resp => {
+ dialog.open({
+ id : $P.control.prefixed("Dialog")
+ , title : params.btnTitle
+ , content : resp
+ , size : "lg"
+ , onClose : () => { $P.refreshDataInfo(); }
+ });
+ }
+ });
+ }
- ajax.post({
- url : wctx.url(params.taskSeCd + ${pageName}PrefixUrl + "/010/remove.do")
- , data : params || {}
- , success : resp => {
- let btnTitle = $("#btnRemoveCvlcptDscsn--${pageName}").attr("title");
- let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, btnTitle);
+ // 삭제 callback
+ $P.control.onRemove = (resp) => {
+ let btnTitle = $("#btnRemoveCvlcptDscsn--${pageName}").attr("title");
+ let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, btnTitle);
- dialog.alert(showMessage); // 메시지 출력
+ dialog.alert({
+ content : showMessage
+ , onOK : () => { }
+ });
- if (resp.saved) {
- $("#dscsnCn--${pageName}").val(""); // 상담내용 초기화
+ if (resp.saved) {
+ $("#dscsnCn--${pageName}").val(""); // 상담내용 초기화
- refreshDataInfo${pageName}(); // 자료 재조회
- }
+ $P.refreshDataInfo(); // 자료 재조회
}
- });
- }
+ }
- /**************************************************************************
- * 버튼 clickEvent
- **************************************************************************/
- // 민원 상담 내용 등록
- fnCreateCvlcptDscsn${pageName} = () => {
- let crdnId = $("#crdnId--${pageNameMain}").val();
-
- // 단속 ID 가 없다면.. return
- if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
-
- let params = {
- callPurpose : "create"
- , crdnId : crdnId
- , sggCd : $("#sggCd--${pageNameMain}").val()
- , taskSeCd : $("#taskSeCd--${pageNameMain}").val()
- };
+ // 삭제
+ $P.control.remove = (params) => {
+ if (!params) return;
- ${pageName}Control.getInfo(params);
- }
+ ajax.post({
+ url : wctx.url("/" + params.taskSeCd + "/sprt/sprt04/010/remove.do")
+ , data : params || {}
+ , success : resp => $P.control.onRemove(resp)
+ });
+ }
- // 민원 상담 내용 수정
- fnUpdateCvlcptDscsn${pageName} = () => {
- let cvlcptDscsnId = ${pageName}Control.dataset.getValue("CVLCPT_DSCSN_ID");
+ /**************************************************************************
+ * DataTables 이벤트
+ **************************************************************************/
+ // DataTables에 click, dbclick 이벤트
+ $P.renderList = () => {
+ let cvlcptDscsnList = $P.control.dataset;
+ let empty = cvlcptDscsnList.empty;
+
+ let trs = empty ?
+ [document.getElementById("cvlcptDscsnNotFound--${pageName}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
+ cvlcptDscsnList.inStrings(
+ document.getElementById("cvlcptDscsnRow--${pageName}").innerHTML, <%-- from template#${infoPrefix}Row --%>
+ (str, dataItem) => str
+ .replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("CVLCPT_DSCSN_ID") + "');")
+ );
+
+ $("#tbody--${pageName}").html(trs.join());
+ }
- // 민원 상담 ID 가 없다면.. return
- if (typeof cvlcptDscsnId == "undefined" || cvlcptDscsnId == null || cvlcptDscsnId == "") return;
+ /**************************************************************************
+ * 사용자 함수(function)
+ **************************************************************************/
+ // 자료 재조회
+ $P.refreshDataInfo = () => {
+ // 단속 ID
+ let crdnId = $("#crdnId--${pageNameMain}").val();
+ // 단속 ID 가 없다면.. return
+ if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
+
+ let params = {
+ callPurpose : "refresh"
+ , inquiryCondition : "crdnId_vhrno"
+ , crdnId : crdnId
+ , sggCd : $("#sggCd--${pageNameMain}").val()
+ , taskSeCd : $("#taskSeCd--${pageNameMain}").val()
+ , vhrno : $("#vhrno--${pageNameMain}").val()
+ , delYN : "N"
+ };
+
+ ajax.get({
+ url : wctx.url("/" + params.taskSeCd + "/sprt/sprt02/080/info.do")
+ , headers: { Accept: "application/json; charset=utf-8" } // json
+ , data : params || {}
+ , success : resp => {
+ // 초기화
+ $("#frmEdit--${pageName}")[0].reset(); // 화면 초기화
+ $P.control.dataset.clear(); // Dataset 초기화
+
+ // Dataset 셋팅
+ $P.control.setData(resp.cvlcptDscsn); // 민원상담 정보
+ }
+ });
+ }
- let params = {
- callPurpose : "update"
- , crdnId : ${pageName}Control.dataset.getValue("CRDN_ID")
- , sggCd : ${pageName}Control.dataset.getValue("SGG_CD")
- , taskSeCd : ${pageName}Control.dataset.getValue("TASK_SE_CD")
- , cvlcptDscsnId : cvlcptDscsnId
- };
+ // 삭제 callback
+ $P.callbackRemove = (obj) => {
+ // 서버에 전송할 data(파라미터) 생성
+ let params = {
+ callPurpose : "remove"
+ , cvlcptDscsnId : $P.control.dataset.getValue("CVLCPT_DSCSN_ID") // 민원상담 ID
+ , sggCd : $P.control.dataset.getValue("SGG_CD") // 시군구 코드
+ , taskSeCd : $P.control.dataset.getValue("TASK_SE_CD") // 업무 구분 코드
+ , delRsn : obj.reason // 삭제 사유
+ };
+
+ $P.control.remove(params);
+ }
- ${pageName}Control.getInfo(params);
- }
-
- // 민원상담 내용 삭제
- fnRemoveCvlcptDscsn${pageName} = () => {
- // 민원상담 ID
- let cvlcptDscsnId = ${pageName}Control.dataset.getValue("CVLCPT_DSCSN_ID");
-
- // 민원상담 ID 가 없다면.. return
- if (typeof cvlcptDscsnId == "undefined" || cvlcptDscsnId == null || cvlcptDscsnId == "") return;
-
- let callbackFuncName = "removeCvlcptDscsn${pageName}";
- let popupWidth = 640;
- let popupHeight = 360;
- let popupX = (window.screen.width / 2) - (popupWidth / 2);
- let popupY= (window.screen.height / 2) - (popupHeight / 2);
-
- window.open(
- wctx.url("/resources/html/inputRsnDialog.html"
- + "?callbackFuncName=" + callbackFuncName
- + "&CALL_PURPOSE=" + "remove"
- )
- , "inputDelRsnDialog"
- , 'status=no, height=' + popupHeight + ', width=' + popupWidth + ', left='+ popupX + ', top='+ popupY
- );
- }
+ /**************************************************************************
+ * 버튼 clickEvent
+ **************************************************************************/
+ // 민원 상담 내용 등록
+ $P.fnCreateCvlcptDscsn = () => {
+ // 버튼 title
+ let btnTitle = $("#btnCreateCvlcptDscsn--${pageName}").attr("title");
+
+ // 단속 ID
+ let crdnId = $("#crdnId--${pageNameMain}").val();
+ // 단속 ID 가 없다면.. return
+ if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
+
+ let params = {
+ callPurpose : "create"
+ , btnTitle : btnTitle
+ , crdnId : crdnId
+ , sggCd : $("#sggCd--${pageNameMain}").val()
+ , taskSeCd : $("#taskSeCd--${pageNameMain}").val()
+ };
+
+ $P.control.getInfo(params);
+ }
- /**************************************************************************
- * 초기 셋팅
- **************************************************************************/
- // 이벤트 설정
- setEvent${pageName} = () => {
- // form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
- $("#frmEdit--${pageName}").find(".form-date").each(function() {
- $(this).on("input",function() {
- let value = this.value.replaceAll("-", "");
-
- if (value.length > 7) {
- this.value = value.substring(0,4) + "-" + value.substring(4,6) + "-" + value.substring(6);
- } else if(value.length > 5) {
- this.value = value.substring(0,4) + "-" + value.substring(4);
+ // 민원 상담 내용 수정
+ $P.fnUpdateCvlcptDscsn = () => {
+ // 버튼 title
+ let btnTitle = $("#btnUpdateCvlcptDscsn--${pageName}").attr("title");
+
+ // 민원 상담 ID
+ let cvlcptDscsnId = $P.control.dataset.getValue("CVLCPT_DSCSN_ID");
+ // 민원 상담 ID 가 없다면.. return
+ if (typeof cvlcptDscsnId == "undefined" || cvlcptDscsnId == null || cvlcptDscsnId == "") return;
+
+ let params = {
+ callPurpose : "update"
+ , btnTitle : btnTitle
+ , cvlcptDscsnId : cvlcptDscsnId
+ , sggCd : $P.control.dataset.getValue("SGG_CD")
+ , taskSeCd : $P.control.dataset.getValue("TASK_SE_CD")
+ };
+
+ $P.control.getInfo(params);
+ }
+
+ // 민원상담 내용 삭제
+ $P.fnRemoveCvlcptDscsn = () => {
+ // 버튼 title
+ let btnTitle = $("#btnRemoveCvlcptDscsn--${pageName}").attr("title");
+
+ // 민원상담 ID
+ let cvlcptDscsnId = $P.control.dataset.getValue("CVLCPT_DSCSN_ID");
+ // 민원상담 ID 가 없다면.. return
+ if (typeof cvlcptDscsnId == "undefined" || cvlcptDscsnId == null || cvlcptDscsnId == "") return;
+
+ // 삭제 메세지 확인
+ dialog.alert({
+ content : "선택한 " + $P.control.prefixName + " 정보를 삭제하시겠습니까?"
+ , onOK : () => {
+ // 사유 입력
+ let popupWidth = 640;
+ let popupHeight = 240;
+ let popupX = (window.screen.width / 2) - (popupWidth / 2);
+ let popupY = (window.screen.height / 2) - (popupHeight / 2);
+
+ window.open(
+ encodeURI(wctx.url("/resources/html/inputRsnDialog.html"
+ + "?openerPageName=${pageName}"
+ + "&prefix=" + $P.control.prefix
+ + "&usePurpose=" + "remove"
+ + "&ttlNm=" + "삭제"
+ ))
+ , "inputDelRsnDialog"
+ , 'status=no, height=' + popupHeight + ', width=' + popupWidth + ', left='+ popupX + ', top='+ popupY
+ );
}
});
- });
- }
-
- // 기본 데이터 설정
- initData${pageName} = () => {
- // 화면 호출(callPurpose)이 view 라면 버튼 비활성화
- if (${pageNameMain}CallPurpose == "view") {
- // button 요소들을 disabled = true
- $("#btnCreateCvlcptDscsn--${pageName}").prop("disabled", true);
- $("#btnUpdateCvlcptDscsn--${pageName}").prop("disabled", true);
- $("#btnRemoveCvlcptDscsn--${pageName}").prop("disabled", true);
}
- }
- /**************************************************************************
- * script 진입
- **************************************************************************/
- $(document).ready(function() {
+ /**************************************************************************
+ * 초기 셋팅
+ **************************************************************************/
// 이벤트 설정
- setEvent${pageName}();
+ $P.setEvent = () => {
+ // 업무 버튼 이벤트
+ $("#btnCreateCvlcptDscsn--${pageName}").on("click", () => $P.fnCreateCvlcptDscsn()); // 민원상담 등록 버튼 이벤트
+ $("#btnUpdateCvlcptDscsn--${pageName}").on("click", () => $P.fnUpdateCvlcptDscsn()); // 민원상담 수정 버튼 이벤트
+ $("#btnRemoveCvlcptDscsn--${pageName}").on("click", () => $P.fnRemoveCvlcptDscsn()); // 민원상담 삭제 버튼 이벤트
+ }
// 기본 데이터 설정
- initData${pageName}();
-
- // Dataset 설정
- let cvlcptDscsn = ${cvlcptDscsn};
- if (cvlcptDscsn) {
- ${pageName}Control.setData(${cvlcptDscsn});
+ $P.initData = () => {
+ // 화면 호출(callPurpose)이 view 라면 버튼 비활성화
+ if (${pageNameMain}CallPurpose == "view") {
+ // button 요소들을 disabled = true
+ $("#btnCreateCvlcptDscsn--${pageName}").prop("disabled", true);
+ $("#btnUpdateCvlcptDscsn--${pageName}").prop("disabled", true);
+ $("#btnRemoveCvlcptDscsn--${pageName}").prop("disabled", true);
+ }
}
+
+ /**************************************************************************
+ * 최초 실행 함수
+ **************************************************************************/
+ // 1. 이벤트 설정
+ $P.setEvent();
+
+ // 2. 기본 데이터 설정
+ $P.initData();
+
+ // 3. Dataset 설정
+ $P.control.setData(${cvlcptDscsn}); // 민원 상담 정보
});