개별총정보 호출 수정.

main
jjh 1 year ago
parent 495bc0cb86
commit 32dee66abf

@ -77,12 +77,12 @@
<option value="mdfcnDt">수정일자</option>
</select>
<span class="form-search-linebox">
<input type="text" id="schDateFrom--${pageName}" name="schDateFrom"
<input type="text" id="schDateFrom--${pageName}" name="schDateFrom"
class="form-control form-date"
data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
~
<input type="text" id="schDateTo--${pageName}" name="schDateTo"
<input type="text" id="schDateTo--${pageName}" name="schDateTo"
class="form-control form-date"
data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
@ -103,13 +103,13 @@
</ul>
</div>
<span id="gridbuttonArea--${pageName}" class="container-window-btn-right">
<button type="button" id="btnOpenCvlcptOrgnl--${pageName}"
<button type="button" id="btnOpenCvlcptOrgnl--${pageName}"
class="btn btn-primary" title="민원원본보기">민원원본보기</button>
<button type="button" id="btnOpenAnswerPreview--${pageName}"
<button type="button" id="btnOpenAnswerPreview--${pageName}"
class="btn btn-primary" title="답변미리보기">답변미리보기</button>
<button type="button" id="btnExecuteAnswer--${pageName}"
<button type="button" id="btnExecuteAnswer--${pageName}"
class="btn btn-primary" title="답변등록 실행">&#x2611; 답변등록 실행</button>
<button type="button" id="btnAnswerComplete--${pageName}"
<button type="button" id="btnAnswerComplete--${pageName}"
class="btn btn-primary" title="답변완료로 수정">&#x2611; 답변완료로 수정</button>
<span slot="button">
<template class="dpv">
@ -134,7 +134,7 @@
data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th style="min-width: 80px;">No.</th>
<th style="min-width: 50px;">
<input type="checkbox" name="gridAllCheckbox"
<input type="checkbox" name="gridAllCheckbox"
onchange="pageObject['${pageName}'].crdnControl.select(this.checked);" />
</th>
<th onclick="searchFromGridTitle('CVLCPT_RCPT_NO',this.innerText,'match','part');"
@ -219,7 +219,7 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
@ -239,7 +239,7 @@ $(document).ready(function(){
$P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
$P.crdnControl.save = (processType) => {
ajax.post({
@ -248,7 +248,7 @@ $(document).ready(function(){
"processType" : processType,
"crdnIDs" : $P.crdnControl.dataset.getKeys("selected").join(",")
},
success : resp => {
success : resp => {
if(resp.saved){
dialog.alert({ content : "저장됐습니다." });
$P.refreshCrdnList();
@ -256,7 +256,7 @@ $(document).ready(function(){
}
});
}
/**************************************************************************
* DatasetControl.on
**************************************************************************/
@ -272,7 +272,7 @@ $(document).ready(function(){
fetchSize: obj["Fetch"],
func: "pageObject['${pageName}'].crdnControl.load({index})"
});
$P.crdnControl.tableRenderComplete = true;
};
@ -281,31 +281,31 @@ $(document).ready(function(){
if(!$P.crdnControl.tableRenderComplete){
return;
}
if($P.crdnControl.beforeCurrent != null){
var beforeCurrentKey = $P.crdnControl.beforeCurrent.key;
var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index;
$P.crdnControl.beforeCurrent = null;
if(!$P.crdnControl.dataset.empty){
var info = $P.crdnControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.crdnControl.dataset.setCurrent(beforeCurrentKey,true);
return;
}
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1];
} else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true);
return;
}
}
$P.crdnControl.tableRenderComplete = false;
if(!item){
$P.clickCrdnList("", true);
@ -323,12 +323,12 @@ $(document).ready(function(){
var checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnExecuteAnswer--${pageName}").prop("disabled", keys.length < 1);
$("#btnAnswerComplete--${pageName}").prop("disabled", keys.length < 1);
$("#btnExecuteDisabledTagInfoInquire--${pageName}").prop("disabled", keys.length < 1);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
@ -339,11 +339,11 @@ $(document).ready(function(){
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
$("#byOutput--${pageName}").val("동적 검색");
$('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-31).date);
$('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', new Date());
$P.crdnControl.setData([]);
}
@ -351,10 +351,10 @@ $(document).ready(function(){
var clsForTask = taskSeCd.toLowerCase();
//업무별 버튼
renderForTask("gridbuttonArea--${pageName}", clsForTask);
//버튼 이벤트 재매핑
//버튼 이벤트 재매핑
$("#btnExecuteDisabledTagInfoInquire--${pageName}").off("click");
$("#btnExecuteDisabledTagInfoInquire--${pageName}").on("click", () => $P.fnExecuteDisabledTagInfoInquire());
$P.fnReset();
$P.crdnControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do");
$P.crdnControl.urls.getInfo = wctx.url("/"+taskSeCd+"/sprt/sprt02/010/main.do");
@ -370,7 +370,7 @@ $(document).ready(function(){
};
$P.crdnControl.load(1);
}
$P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams();
$P.crdnControl.load(1);
@ -378,9 +378,9 @@ $(document).ready(function(){
$P.scrollEnd = (obj) => {
if(obj.dataset.scrollStatus){
return;
return;
}
var el = $(obj);
if(el.scrollTop() == 0){
return;
@ -401,28 +401,32 @@ $(document).ready(function(){
return;
}
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){
$P.crdnControl.setCurrent(dataKey);
}
}
$P.dblclickCrdnList = (dataKey) => {
let params = {
callControlName : "pageObject['${pageName}'].crdnControl"
, crdnId : dataKey
}
ajax.get({
url : $P.crdnControl.urls.getInfo,
data : { "crdnId" : dataKey },
data : params,
success : resp => {
dialog.open({
id : "totalDialog--${pageName}",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
}
$P.renderCrdnList = (total) => {
@ -439,30 +443,30 @@ $(document).ready(function(){
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
}
$("#crdnTbody--${pageName}").find("tr[data-key]").each(function(item){
var crdnId = this.dataset.key;
var data = crdnList.getData(crdnId);
if(data.COPY_EXIST_YN == "Y"){
$(this).addClass("text-red");
} else {
$(this).removeClass("text-red");
}
});
}
@ -480,14 +484,14 @@ $(document).ready(function(){
if(cur == null){
return;
}
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
var dialogId = "cvlcptOrgnlDialog--${pageName}";
ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] },
success : resp => {
success : resp => {
dialog.open({
id : dialogId,
title : "민원내역 원본",
@ -496,7 +500,7 @@ $(document).ready(function(){
init : () => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
@ -504,27 +508,27 @@ $(document).ready(function(){
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 = "answerPreviewDialog--${pageName}";
ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc02/060/info.do"),
data : { crdnId : cur["CRDN_ID"] },
success : resp => {
success : resp => {
dialog.open({
id : dialogId,
title : "답변내용 미리보기",
@ -533,7 +537,7 @@ $(document).ready(function(){
init : () => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
@ -541,18 +545,18 @@ $(document).ready(function(){
parentRes[reqKey] = function(){};
}
}
pageObject.parentRes.push(parentRes);
}
});
}
});
}
$P.fnExecuteAnswer = () => {
var count = $P.crdnControl.dataset.getKeys("selected").length;
dialog.alert({
content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?"
, onOK : () => {
@ -560,11 +564,11 @@ $(document).ready(function(){
}
});
}
$P.fnAnswerComplete = () => {
var count = $P.crdnControl.dataset.getKeys("selected").length;
dialog.alert({
content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?"
, onOK : () => {
@ -572,56 +576,56 @@ $(document).ready(function(){
}
});
}
//표지정보 조회
$P.fnExecuteDisabledTagInfoInquire = () => {
var keys = [];
var selected = $P.crdnControl.dataset.getDataset("selected");
for(var i=0; i < selected.length; i++){
if(selected[i].CVLCPT_PRCS_CD == "02"){
keys.push(selected[i].CRDN_ID);
}
}
if(keys.length == 0){
dialog.alert("표지조회는 부과대상자료만 가능합니다.<br/>선택된 자료 중에 부과대상자료가 없습니다.");
return;
}
var message = "※표지정보 조회 후 장애인차량이 아닌 자료는 서손처리 됩니다."
+"<br/>※현재 날짜("+dateFormat.format(new Date())+")를 기준으로 차량번호로 조회합니다."
+"<br/>표지조회를 실행하시겠습니까?"
+"<br/>부과대상 자료 : "+keys.length+"건";
dialog.alert({
content : message,
onOK : () => {
ajax.get({
url : wctx.url("/DPV/cvlc/cvlc02/040/update.do"),
data : {
data : {
"crdnIDs" : keys.join(",")
},
success : resp => {
dialog.alert("표지정보조회가 실행되었습니다.");
$P.refreshCrdnList();
}
});
}
});
}
$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){
"getNextKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
@ -630,7 +634,7 @@ $(document).ready(function(){
return "";
}
},
"getPrevKey" : function(currentKey){
"getPrevKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
@ -639,14 +643,14 @@ $(document).ready(function(){
return "";
}
},
"selectRow" : function(currentKey){
"selectRow" : function(currentKey){
$P.clickCrdnList(currentKey);
},
"refreshList" : function(){
"refreshList" : function(){
$P.refreshCrdnList();
}
};
/**************************************************************************
* element.on
**************************************************************************/
@ -658,7 +662,7 @@ $(document).ready(function(){
$("#btnAnswerComplete--${pageName}").on("click", () => $P.fnAnswerComplete());
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
/**************************************************************************
* 초기화
**************************************************************************/

@ -70,12 +70,12 @@
<option value="mdfcnDt">수정일자</option>
</select>
<span class="form-search-linebox">
<input type="text" id="schDateFrom--${pageName}" name="schDateFrom"
<input type="text" id="schDateFrom--${pageName}" name="schDateFrom"
class="form-control form-date"
data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
~
<input type="text" id="schDateTo--${pageName}" name="schDateTo"
<input type="text" id="schDateTo--${pageName}" name="schDateTo"
class="form-control form-date"
data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
@ -93,9 +93,9 @@
</ul>
</div>
<span class="container-window-btn-right">
<button type="button" id="btnOpenCvlcptOrgnl--${pageName}"
<button type="button" id="btnOpenCvlcptOrgnl--${pageName}"
class="btn btn-primary" title="민원원본보기">민원원본보기</button>
<button type="button" id="btnDelete--${pageName}"
<button type="button" id="btnDelete--${pageName}"
class="btn btn-primary" title="선택자료 삭제">선택자료 삭제</button>
</span>
</span>
@ -180,7 +180,7 @@
</div>
</div>
</div>
</div>
<jsp:include page="/WEB-INF/jsp/include/bottom.jsp" />
@ -202,20 +202,20 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
$P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), {
animation: true,
autohide: true,
delay: 2000
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.crdnControl = new DatasetControl({
urls : { load : "", getInfo : "", remove : "" },
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
keymapper : info => info ? info.CRDN_ID : "",
formats : {
CRDN_REG_SE_CD : FIM026,
CVLCPT_RCPT_YMD : dateFormat,
@ -227,12 +227,12 @@ $(document).ready(function(){
$P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
/**************************************************************************
* DatasetControl.on
**************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({
@ -256,26 +256,26 @@ $(document).ready(function(){
var beforeCurrentKey = $P.crdnControl.beforeCurrent.key;
var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index;
$P.crdnControl.beforeCurrent = null;
if(!$P.crdnControl.dataset.empty){
var info = $P.crdnControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.crdnControl.dataset.setCurrent(beforeCurrentKey,true);
return;
}
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1];
} else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true);
return;
}
}
$P.crdnControl.tableRenderComplete = false;
if(!item){
$P.clickCrdnList("", true);
@ -283,14 +283,14 @@ $(document).ready(function(){
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
}
$P.crdnControl.onRemove = (selected, resp) => {
if (resp.saved){
$P.toast.show();
$P.refreshCrdnList();
}
}
/**************************************************************************
* pageObject.function
**************************************************************************/
@ -301,11 +301,11 @@ $(document).ready(function(){
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
$("#byOutput--${pageName}").val("동적 검색");
$('#schCvlcptRcptYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schCvlcptRcptYmdTo--${pageName}').datepicker('setDate', new Date());
$P.crdnControl.setData([]);
}
@ -315,7 +315,7 @@ $(document).ready(function(){
$P.crdnControl.urls.getInfo = wctx.url("/"+taskSeCd+"/sprt/sprt02/010/main.do");
$P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
}
$P.refreshCrdnList = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
@ -325,9 +325,9 @@ $(document).ready(function(){
};
$P.crdnControl.load(1);
}
$P.searchCrdnList = () => {
$P.crdnControl.query = $P.getParams();
$P.crdnControl.load(1);
}
@ -354,13 +354,13 @@ $(document).ready(function(){
$P.clickCrdnList = (dataKey, auto) => {
if(dataKey == ""){
if(auto){
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
}
return;
}
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){
@ -371,18 +371,22 @@ $(document).ready(function(){
}
$P.dblclickCrdnList = (dataKey) => {
let params = {
callControlName : "pageObject['${pageName}'].crdnControl"
, crdnId : dataKey
}
ajax.get({
url : $P.crdnControl.urls.getInfo,
data : { "crdnId" : dataKey },
data : params,
success : resp => {
dialog.open({
id : "totalDialog--${pageName}",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
}
@ -401,19 +405,19 @@ $(document).ready(function(){
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
if(total == crdnList.length){
$("#table-responsive--${pageName}").attr("data-scroll-status", "complete");
} else {
$("#table-responsive--${pageName}").removeAttr("data-scroll-status");
}
if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
}
}
$P.getParams = () => {
@ -423,37 +427,37 @@ $(document).ready(function(){
return data;
}
$P.fnRemove = () => {
var cur = $P.crdnControl.getCurrent();
if(cur == null){
return;
}
var curKey = cur["CRDN_ID"];
$P.crdnControl.select(curKey,true);
$P.crdnControl.remove();
}
$P.fnOpenCvlcptOrgnl = () => {
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+"/cvlc/cvlc01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] },
success : resp => {
success : resp => {
dialog.open({
id : dialogId,
title : "민원내역 원본",
@ -462,7 +466,7 @@ $(document).ready(function(){
init : () => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
@ -470,21 +474,21 @@ $(document).ready(function(){
parentRes[reqKey] = function(){};
}
}
pageObject.parentRes.push(parentRes);
}
});
}
});
}
$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){
"getNextKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
@ -493,7 +497,7 @@ $(document).ready(function(){
return "";
}
},
"getPrevKey" : function(currentKey){
"getPrevKey" : function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
@ -502,13 +506,13 @@ $(document).ready(function(){
return "";
}
},
"selectRow" : function(currentKey){
"selectRow" : function(currentKey){
$P.clickCrdnList(currentKey);
},
"refreshList" : function(){
"refreshList" : function(){
$P.refreshCrdnList();
},
"hasData" : function(key){
"hasData" : function(key){
if($P.crdnControl.dataset.getData(key) == null){
return false;
} else {
@ -516,15 +520,15 @@ $(document).ready(function(){
}
},
};
/**************************************************************************
* element.on
**************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove());
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());
/**************************************************************************
@ -540,8 +544,8 @@ $(document).ready(function(){
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
});

Loading…
Cancel
Save