diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp index 56dadf1f..1e051fa0 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp @@ -401,42 +401,10 @@ $(document).ready(function(){ var childReq = pageObject.childReq.pop(); for(var reqKey in childReq) { - if(reqKey == "getCountStatus"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - return (index+1) + " of " + ds.length; - }; - } - else if(reqKey == "getNextKey"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - if(ds.length > index+1){ - return ds[index+1]["CRDN_ID"]; - } else { - return ""; - } - }; - } - else if(reqKey == "getPrevKey"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - if(index != 0 && ds.length > 1){ - return ds[index-1]["CRDN_ID"]; - } else { - return ""; - } - }; - } - else if(reqKey == "selectRow"){ - parentRes[reqKey] = function(currentKey){ - $P.clickCrdnList(currentKey); - }; - } - else { - parentRes[reqKey] = function(){} + if($P.provide[reqKey]){ + parentRes[reqKey] = $P.provide[reqKey]; + } else { + parentRes[reqKey] = function(){}; } } @@ -447,6 +415,36 @@ $(document).ready(function(){ }); } + $P.provide = { + "getCountStatus" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + return (index+1) + " of " + ds.length; + }, + "getNextKey" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + if(ds.length > index+1){ + return ds[index+1]["CRDN_ID"]; + } else { + return ""; + } + }, + "getPrevKey" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + if(index != 0 && ds.length > 1){ + return ds[index-1]["CRDN_ID"]; + } else { + return ""; + } + }, + "selectRow" : function(currentKey){ + $P.clickCrdnList(currentKey); + } + }; + + /************************************************************************** * element.on **************************************************************************/ diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp index e24ff8db..d911c01d 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01030-main.jsp @@ -73,7 +73,7 @@ 민원원본보기 - 답변미리보기 + 답변미리보기 선택자료답변등록실행 답변완료로 수정 @@ -90,6 +90,7 @@ No. + 등록구분 {ROW_NUM} + {CRDN_REG_SE_CD} {VLTN_ARTCL} {CVLCPT_APLCNT_NM} @@ -136,7 +138,7 @@ @@ -312,42 +314,47 @@ $(document).ready(function(){ var childReq = pageObject.childReq.pop(); for(var reqKey in childReq) { - if(reqKey == "getCountStatus"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - return (index+1) + " of " + ds.length; - }; + if($P.provide[reqKey]){ + parentRes[reqKey] = $P.provide[reqKey]; + } else { + parentRes[reqKey] = function(){}; } - else if(reqKey == "getNextKey"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - if(ds.length > index+1){ - return ds[index+1]["CRDN_ID"]; - } else { - return ""; - } - }; - } - else if(reqKey == "getPrevKey"){ - parentRes[reqKey] = function(currentKey){ - var ds = $P.crdnControl.dataset.getDataset(); - var index = ds.findIndex(item => item.CRDN_ID == currentKey); - if(index != 0 && ds.length > 1){ - return ds[index-1]["CRDN_ID"]; - } else { - return ""; - } - }; - } - else if(reqKey == "selectRow"){ - parentRes[reqKey] = function(currentKey){ - $P.clickCrdnList(currentKey); - }; - } - else { - parentRes[reqKey] = function(){} + } + + pageObject.parentRes.push(parentRes); + } + }); + } + }); + } + + $P.fnOpenAnswerPreview = () => { + var cur = $P.crdnControl.getCurrent(); + if(cur == null){ + return; + } + + var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val(); + + var dialogId = "cvlcptOrgnlDialog--${pageName}"; + ajax.get({ + url : wctx.url("/"+taskSeCd+"/crdn/crdn01/060/info.do"), + data : { crdnId : cur["CRDN_ID"] }, + success : resp => { + dialog.open({ + id : dialogId, + title : "민원내역 원본", + content : resp, + size : "xl", + init : () => { + var parentRes = new Object(); + var childReq = pageObject.childReq.pop(); + + for(var reqKey in childReq) { + if($P.provide[reqKey]){ + parentRes[reqKey] = $P.provide[reqKey]; + } else { + parentRes[reqKey] = function(){}; } } @@ -357,14 +364,47 @@ $(document).ready(function(){ } }); } + + $P.provide = { + "getCountStatus" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + return (index+1) + " of " + ds.length; + }, + "getNextKey" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + if(ds.length > index+1){ + return ds[index+1]["CRDN_ID"]; + } else { + return ""; + } + }, + "getPrevKey" : function(currentKey){ + var ds = $P.crdnControl.dataset.getDataset(); + var index = ds.findIndex(item => item.CRDN_ID == currentKey); + if(index != 0 && ds.length > 1){ + return ds[index-1]["CRDN_ID"]; + } else { + return ""; + } + }, + "selectRow" : function(currentKey){ + $P.clickCrdnList(currentKey); + } + }; + /************************************************************************** * element.on **************************************************************************/ $('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); + $("#btnOpenAnswerPreview--${pageName}").on("click", () => $P.fnOpenAnswerPreview()); + $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); }); + /************************************************************************** * 초기화 **************************************************************************/ diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp index 716ac977..22c11753 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01050-info.jsp @@ -74,7 +74,7 @@ \ No newline at end of file