jsp 소스 수정

main
이범준 9 months ago
parent 98b2afe204
commit e3be084feb

@ -77,7 +77,7 @@ function executeBatch(batch){
ajax.get({ ajax.get({
url : wctx.url("/admin/executeBatch.do"), url : wctx.url("/admin/executeBatch.do"),
data : { batch : batch}, data : { batch : batch},
success : resp => { success : (resp) => {
dialog.alert("실행되었습니다."); dialog.alert("실행되었습니다.");
} }
}); });
@ -100,7 +100,7 @@ function exceuteAlert(alertName){
alertName : alertName, alertName : alertName,
interfaceKey : interfaceKey interfaceKey : interfaceKey
}, },
success : resp => { success : (resp) => {
dialog.alert("실행되었습니다."); dialog.alert("실행되었습니다.");
} }
}); });
@ -131,7 +131,7 @@ function customContextMenu(node){
data : { data : {
directories : pathArray directories : pathArray
}, },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
getFileTree(); getFileTree();
} else { } else {
@ -166,7 +166,7 @@ function customContextMenu(node){
data : { data : {
directories : pathArray directories : pathArray
}, },
success : resp => { success : (resp) => {
$("#viewCn").val(resp.fileCn); $("#viewCn").val(resp.fileCn);
} }
}); });
@ -220,7 +220,7 @@ function getFileTree(){
url : wctx.url("/admin/getFileTree.do"), url : wctx.url("/admin/getFileTree.do"),
data : {}, data : {},
headers: { Accept: "application/json; charset=utf-8" }, headers: { Accept: "application/json; charset=utf-8" },
success : resp => { success : (resp) => {
$('#fileTree').jstree(true).settings.core.data = resp.tree; $('#fileTree').jstree(true).settings.core.data = resp.tree;
$('#fileTree').jstree(true).refresh(); $('#fileTree').jstree(true).refresh();
@ -246,7 +246,7 @@ function fnImportFile(obj){
data : form, data : form,
processData : false, processData : false,
contentType : false, contentType : false,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
getFileTree(); getFileTree();
} else { } else {

@ -406,17 +406,23 @@ $(document).ready(function(){
$P.photoInspectionControl.defaultFetchSize = FETCH_XS; $P.photoInspectionControl.defaultFetchSize = FETCH_XS;
$P.photoInspectionControl.untilPageNum = 0; $P.photoInspectionControl.untilPageNum = 0;
$P.photoInspectionControl.beforeCurrent = null; $P.photoInspectionControl.beforeCurrent = null;
$P.photoInspectionControl.tableRenderComplete = false;
//동일차량검사 datasetControl 인스턴스 //동일차량검사 datasetControl 인스턴스
$P.sameVehicleControl = new InspectionControl({ $P.sameVehicleMainControl = new DatasetControl({
urls : { load : "", getInfo : "" }, urls : { load : "", getInfo : "" },
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID_LIST : "", keymapper : info => info ? info.CRDN_ID_LIST : "",
formats: { CRDN_CNT : numberFormat, FFNLG_CRDN_AMT : numberFormat } formats: {
}, CRDN_CNT : numberFormat,
{ FFNLG_CRDN_AMT : numberFormat
}
});
$P.sameVehicleMainControl.defaultFetchSize = FETCH_XS;
$P.sameVehicleMainControl.untilPageNum = 0;
$P.sameVehicleMainControl.beforeCurrent = null;
$P.sameVehicleSubControl = new DatasetControl({
urls : { load : "", getInfo : "" }, urls : { load : "", getInfo : "" },
dataGetter : obj => obj["List"], dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
@ -426,13 +432,7 @@ $(document).ready(function(){
CRDN_STTS_CD : FIM010, CRDN_STTS_CD : FIM010,
FFNLG_CRDN_AMT : numberFormat FFNLG_CRDN_AMT : numberFormat
} }
} });
);
$P.sameVehicleControl.defaultFetchSize = FETCH_XS;
$P.sameVehicleControl.untilPageNum = 0;
$P.sameVehicleControl.main.beforeCurrent = null;
$P.sameVehicleControl.main.tableRenderComplete = false;
$P.sameVehicleControl.sub.tableRenderComplete = false;
$P.photoInspectionControl.getNext = (key) => { $P.photoInspectionControl.getNext = (key) => {
@ -446,126 +446,61 @@ $(document).ready(function(){
} }
} }
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.photoInspectionControl.onDatasetChange = (obj) => { $P.photoInspectionControl.dataset.onDatasetChange = (obj) => {
$P.renderInspectionDataList(obj["Total"], "photoInspection");
$("#photoInspectionPaging--${pageName}").setPagingInfo({ var t = $P.getGridTemplate("photoInspection");
list : $P.photoInspectionControl.dataset, var trs = Apply.fromDataset.getTbody($P.photoInspectionControl.dataset, t.found, t.notFound, t.replacer);
prefix : "photoInspectionPaging--${pageName}", $P.renderInspectionDataList(obj["Total"], $P.photoInspectionControl.dataset.length, trs, "photoInspection");
totalSize : obj["Total"]
});
$P.photoInspectionControl.tableRenderComplete = true; Apply.fromDataset.paging($P.photoInspectionControl.dataset, obj, "photoInspectionPaging--${pageName}");
}; };
$P.photoInspectionControl.onCurrentChange = (DI) => { $P.photoInspectionControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.photoInspectionControl.dataset, dataItem, $("#photoInspectionTbody--${pageName}")[0]);
if(!$P.photoInspectionControl.tableRenderComplete){
return;
}
if($P.photoInspectionControl.beforeCurrent != null){
var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
var beforeCurrentIndex = $P.photoInspectionControl.beforeCurrent.index;
$P.photoInspectionControl.beforeCurrent = null;
var dataKey = "";
var curDataVhrno = "";
var nextDataKey = "";
var nextDataVhrno = "";
if(!$P.photoInspectionControl.dataset.empty){ if(!$P.photoInspectionControl.dataset.empty){
var info = $P.photoInspectionControl.dataset.getData(beforeCurrentKey); dataKey = $P.photoInspectionControl.dataset.getKey(dataItem);
curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
if(info != null){ var nextData = $P.photoInspectionControl.getNext(dataKey);
$P.photoInspectionControl.dataset.setCurrent(beforeCurrentKey, true); nextDataKey = nextData != null ? nextData.CRDN_ID : "";
return; nextDataVhrno = nextData != null ? nextData.VHRNO : "";
}
if(beforeCurrentIndex > ($P.photoInspectionControl.dataset.length - 1)){
info = $P.photoInspectionControl.dataset.getDataset()[$P.photoInspectionControl.dataset.length - 1];
} else {
info = $P.photoInspectionControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.photoInspectionControl.dataset.setCurrent(info["CRDN_ID"], true);
return;
}
} }
$P.photoInspectionControl.tableRenderComplete = false; $P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
if(!DI){
$P.clickInspectionDataList("","photoInspection", true);
} else {
$P.clickInspectionDataList($P.photoInspectionControl.getCurrent()["CRDN_ID"],"photoInspection", true);
}
} }
$P.sameVehicleControl.main.onDatasetChange = (obj) => { $P.sameVehicleMainControl.dataset.onDatasetChange = (obj) => {
$P.renderInspectionDataList(obj["Total"], "sameVehicleInspectionMain"); var t = $P.getGridTemplate("sameVehicleInspectionMain");
var trs = Apply.fromDataset.getTbody($P.sameVehicleMainControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleMainControl.dataset.length, trs, "sameVehicleInspectionMain");
$("#sameVehicleInspectionMainPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.sameVehicleMainControl.dataset, obj, "sameVehicleInspectionMainPaging--${pageName}");
list : $P.sameVehicleControl.main.dataset,
prefix : "sameVehicleInspectionMainPaging--${pageName}",
totalSize : obj["Total"]
});
$P.sameVehicleControl.main.tableRenderComplete = true;
}; };
$P.sameVehicleControl.main.onCurrentChange = (DI) => { $P.sameVehicleMainControl.dataset.onCurrentChange = (dataItem) => {
if(!$P.sameVehicleControl.main.tableRenderComplete){ Apply.fromDataset.currentRow($P.sameVehicleMainControl.dataset, dataItem, $("#sameVehicleInspectionMainTbody--${pageName}")[0]);
return; if(dataItem){
} $P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]);
if($P.sameVehicleControl.main.beforeCurrent != null){
var beforeCurrentKey = $P.sameVehicleControl.main.beforeCurrent.key;
var beforeCurrentIndex = $P.sameVehicleControl.main.beforeCurrent.index;
$P.sameVehicleControl.main.beforeCurrent = null;
if(!$P.sameVehicleControl.main.dataset.empty){
var info = $P.sameVehicleControl.main.dataset.getData(beforeCurrentKey);
if(info != null){
$P.sameVehicleControl.main.dataset.setCurrent(beforeCurrentKey,true);
return;
}
if(beforeCurrentIndex > ($P.sameVehicleControl.main.dataset.length - 1)){
info = $P.sameVehicleControl.main.dataset.getDataset()[$P.sameVehicleControl.main.dataset.length - 1];
} else { } else {
info = $P.sameVehicleControl.main.dataset.getDataset()[beforeCurrentIndex]; $("#sameVehicleInspectionSubTbody--${pageName}").html("");
}
$P.sameVehicleControl.main.dataset.setCurrent(info["CRDN_ID_LIST"],true);
return;
}
}
$P.sameVehicleControl.main.tableRenderComplete = false;
if(!DI){
$P.clickInspectionDataList("","sameVehicleInspectionMain", true);
} else {
$P.clickInspectionDataList($P.sameVehicleControl.main.getCurrent()["CRDN_ID_LIST"],"sameVehicleInspectionMain", true);
} }
} }
$P.sameVehicleControl.sub.onDatasetChange = (obj) => { $P.sameVehicleSubControl.dataset.onDatasetChange = (obj) => {
$P.renderInspectionDataList(obj["Total"], "sameVehicleInspectionSub"); var t = $P.getGridTemplate("sameVehicleInspectionSub");
$P.sameVehicleControl.sub.tableRenderComplete = true; var trs = Apply.fromDataset.getTbody($P.sameVehicleSubControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleSubControl.dataset.length, trs, "sameVehicleInspectionSub");
}; };
$P.sameVehicleControl.sub.onCurrentChange = (DI) => { $P.sameVehicleSubControl.dataset.onCurrentChange = (dataItem) => {
if(!$P.sameVehicleControl.sub.tableRenderComplete){ Apply.fromDataset.currentRow($P.sameVehicleSubControl.dataset, dataItem, $("#sameVehicleInspectionSubTbody--${pageName}")[0]);
return;
}
$P.sameVehicleControl.sub.tableRenderComplete = false;
if(!DI){
$P.clickInspectionDataList("","sameVehicleInspectionSub", true);
} else {
$P.clickInspectionDataList($P.sameVehicleControl.sub.getCurrent()["CRDN_ID"],"sameVehicleInspectionSub", true);
}
}; };
/************************************************************************** /**************************************************************************
@ -583,17 +518,17 @@ $(document).ready(function(){
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-7).date); $('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-7).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date()); $('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
$P.photoInspectionControl.setData([]); $P.photoInspectionControl.setData([]);
$P.sameVehicleControl.main.setData([]); $P.sameVehicleMainControl.setData([]);
}; };
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset(); $P.fnReset();
$P.photoInspectionControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); $P.photoInspectionControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.photoInspectionControl.urls.getInfo = ""; $P.photoInspectionControl.urls.getInfo = "";
$P.sameVehicleControl.main.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); $P.sameVehicleMainControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.sameVehicleControl.main.urls.getInfo = ""; $P.sameVehicleMainControl.urls.getInfo = "";
$P.sameVehicleControl.sub.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do"); $P.sameVehicleSubControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.sameVehicleControl.sub.urls.getInfo = ""; $P.sameVehicleSubControl.urls.getInfo = "";
var clsForTask = taskSeCd.toLowerCase(); var clsForTask = taskSeCd.toLowerCase();
//업무별 조회조건 //업무별 조회조건
@ -607,29 +542,17 @@ $(document).ready(function(){
$('#btnPhotoInspection--${pageName}').trigger("click"); $('#btnPhotoInspection--${pageName}').trigger("click");
} }
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
$P.refreshInspectionList = () => { if($P.currentDisplay == "photoInspection"){
switch ($P.currentDisplay) { data.fetchSize = $P.photoInspectionControl.defaultFetchSize;
case "photoInspection": } else if($P.currentDisplay == "sameVehicleInspection"){
$P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum; data.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum;
$P.photoInspectionControl.beforeCurrent = {
key : $P.photoInspectionControl.getCurrent()["CRDN_ID"],
index : $P.photoInspectionControl.getCurrent()["ROW_NUM"] - 1
};
$P.photoInspectionControl.load(1);
break;
case "sameVehicleInspection":
$P.sameVehicleControl.untilPageNum = $P.sameVehicleControl.main.query.pageNum;
$P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize * $P.sameVehicleControl.main.query.pageNum;
$P.sameVehicleControl.main.beforeCurrent = {
key : $P.sameVehicleControl.main.getCurrent()["CRDN_ID_LIST"],
index : $P.sameVehicleControl.main.getCurrent()["ROW_NUM"] - 1
};
$P.sameVehicleControl.main.load(1);
break;
default: break;
} }
return data;
} }
$P.searchInspectionList = () => { $P.searchInspectionList = () => {
@ -640,19 +563,20 @@ $(document).ready(function(){
$P.photoInspectionControl.load(1); $P.photoInspectionControl.load(1);
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.sameVehicleControl.main.query = $P.getParams(); $P.sameVehicleMainControl.query = $P.getParams();
$P.sameVehicleControl.main.query.inspectionDataType = "sameVehicleMain"; $P.sameVehicleMainControl.query.inspectionDataType = "sameVehicleMain";
$P.sameVehicleControl.main.load(1); $P.sameVehicleMainControl.load(1);
break; break;
default: break; default: break;
} }
} }
$P.searchDetailInspectionDataList = (dataKey) => { $P.searchDetailInspectionDataList = (dataKey) => {
$P.sameVehicleControl.sub.query = {}; $P.sameVehicleSubControl.query = {};
$P.sameVehicleControl.sub.query.inspectionDataType = "sameVehicleSub"; $P.sameVehicleSubControl.query.inspectionDataType = "sameVehicleSub";
$P.sameVehicleControl.sub.query.crdnIDs = dataKey; $P.sameVehicleSubControl.query.crdnIDs = dataKey;
$P.sameVehicleControl.sub.query.taskSeCd = $P.sameVehicleControl.main.query.taskSeCd; $P.sameVehicleSubControl.query.taskSeCd = $P.sameVehicleMainControl.query.taskSeCd;
$P.sameVehicleControl.sub.load(0); $P.sameVehicleSubControl.load(0);
} }
$P.scrollInspectionDataList = () => { $P.scrollInspectionDataList = () => {
@ -661,91 +585,252 @@ $(document).ready(function(){
$P.photoInspectionControl.load($P.photoInspectionControl.query.pageNum + 1); $P.photoInspectionControl.load($P.photoInspectionControl.query.pageNum + 1);
break; break;
case "sameVehicleInspection": case "sameVehicleInspection":
$P.sameVehicleControl.main.load($P.sameVehicleControl.main.query.pageNum + 1); $P.sameVehicleMainControl.load($P.sameVehicleMainControl.query.pageNum + 1);
break; break;
default: break; default: break;
} }
} }
$P.clickInspectionDataList = (dataKey, gridType, auto) => {
switch (gridType) { $P.refreshInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection": case "photoInspection":
$P.photoInspectionControl.untilPageNum = $P.photoInspectionControl.query.pageNum;
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize * $P.photoInspectionControl.query.pageNum;
$P.photoInspectionControl.beforeCurrent = {
key : $P.photoInspectionControl.getCurrent()["CRDN_ID"],
index : $P.photoInspectionControl.getCurrent()["ROW_NUM"] - 1
};
if(dataKey == ""){ Apply.fromDatasetControl.load($P.photoInspectionControl, 1).then((resp)=>{
$("#curDataVhrno--${pageName}").html(""); Apply.toDataset.set($P.photoInspectionControl.dataset, resp);
$("#nextDataVhrno--${pageName}").html(""); $P.photoInspectionControl.dataset.onDatasetChange(resp);
$("#curDataFiles--${pageName}").html("");
$("#nextDataFiles--${pageName}").html("");
return;
}
$("#photoInspectionTbody--${pageName}").setCurrentRow(dataKey); if($P.photoInspectionControl.untilPageNum != 0){
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
$P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum;
$P.photoInspectionControl.untilPageNum = 0;
}
var curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"]; if($P.photoInspectionControl.beforeCurrent != null){
var nextData = $P.photoInspectionControl.getNext(dataKey); var beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
var nextDataKey = nextData != null ? nextData.CRDN_ID : ""; var beforeCurrentIndex = $P.photoInspectionControl.beforeCurrent.index;
var nextDataVhrno = nextData != null ? nextData.VHRNO : ""; $P.photoInspectionControl.beforeCurrent = null;
$("#curDataVhrno--${pageName}").html(curDataVhrno); if(!$P.photoInspectionControl.dataset.empty){
$("#nextDataVhrno--${pageName}").html(nextDataVhrno); var info = $P.photoInspectionControl.dataset.getData(beforeCurrentKey);
ajax.get({ if(info != null){
url:"file/list.do", $P.photoInspectionControl.dataset.setCurrent(beforeCurrentKey, true);
data: {
infoType : "100",
infoKeys : [dataKey, nextDataKey],
fetchSize : 0
},
success : resp => {
var fileList = resp.fileList; } else {
var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey); if(beforeCurrentIndex > ($P.photoInspectionControl.dataset.length - 1)){
var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey); info = $P.photoInspectionControl.dataset.getDataset()[$P.photoInspectionControl.dataset.length - 1];
} else {
info = $P.photoInspectionControl.dataset.getDataset()[beforeCurrentIndex];
}
$("#curDataFiles--${pageName}").html(""); $P.photoInspectionControl.dataset.setCurrent(info["CRDN_ID"], true);
$("#nextDataFiles--${pageName}").html("");
currentDataFileList.forEach(function(item, index, array){ }
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC); }
$("#curDataFiles--${pageName}").append(output); }
});
nextDataFileList.forEach(function(item, index, array){
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC);
$("#nextDataFiles--${pageName}").append(output);
}); });
break;
case "sameVehicleInspection":
$P.sameVehicleMainControl.untilPageNum = $P.sameVehicleMainControl.query.pageNum;
$P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize * $P.sameVehicleMainControl.query.pageNum;
$P.sameVehicleMainControl.beforeCurrent = {
key : $P.sameVehicleMainControl.getCurrent()["CRDN_ID_LIST"],
index : $P.sameVehicleMainControl.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.load($P.sameVehicleMainControl, 1).then((resp)=>{
Apply.toDataset.set($P.sameVehicleMainControl.dataset, resp);
$P.sameVehicleMainControl.dataset.onDatasetChange(resp);
if($P.sameVehicleMainControl.untilPageNum != 0){
$P.sameVehicleMainControl.query.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
$P.sameVehicleMainControl.query.pageNum = $P.sameVehicleMainControl.untilPageNum;
$P.sameVehicleMainControl.untilPageNum = 0;
}
if($P.sameVehicleMainControl.beforeCurrent != null){
var beforeCurrentKey = $P.sameVehicleMainControl.beforeCurrent.key;
var beforeCurrentIndex = $P.sameVehicleMainControl.beforeCurrent.index;
$P.sameVehicleMainControl.beforeCurrent = null;
if(!$P.sameVehicleMainControl.dataset.empty){
var info = $P.sameVehicleMainControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.sameVehicleMainControl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.sameVehicleMainControl.dataset.length - 1)){
info = $P.sameVehicleMainControl.dataset.getDataset()[$P.sameVehicleMainControl.dataset.length - 1];
} else {
info = $P.sameVehicleMainControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.sameVehicleMainControl.dataset.setCurrent(info["CRDN_ID_LIST"],true);
}
} }
}
}); });
if(!auto){ break;
$P.photoInspectionControl.setCurrent(dataKey); default: break;
}
}
$P.fnExcelDown = () => {
if($P.currentDisplay == "photoInspection"){
if($P.photoInspectionControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
$($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.photoInspectionControl.query.cellDefs = cellDefs;
$P.photoInspectionControl.download();
} else {
if($P.sameVehicleMainControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
} }
if(confirm("단속건수 엑셀저장은 확인버튼, 상세내역 엑셀저장시 취소버튼을 누르세요.")){
var cellDefs = getCellDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
$($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td"));
$P.sameVehicleMainControl.query.cellDefs = cellDefs;
$P.sameVehicleMainControl.download();
} else {
var cellDefs = getCellDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"),
$($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask"));
$P.sameVehicleSubControl.query.cellDefs = cellDefs;
$P.sameVehicleSubControl.download();
}
}
}
$P.getGridTemplate = (gridType) => {
var notFound;
var found;
var replacer;
switch (gridType) {
case "photoInspection":
notFound = [document.getElementById("photoInspectionNotFound--${pageName}").innerHTML]
found = document.getElementById("photoInspectionRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
break;
case "sameVehicleInspectionMain":
notFound = [document.getElementById("sameVehicleInspectionMainNotFound--${pageName}").innerHTML];
found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
break;
case "sameVehicleInspectionSub":
notFound = [document.getElementById("sameVehicleInspectionSubNotFound--${pageName}").innerHTML]
found = document.getElementById("sameVehicleInspectionSubRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');");
break;
}
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderInspectionDataList = (total, listLength, trs, renderDataType) => {
switch (renderDataType) {
case "photoInspection":
var noMore = (total == listLength);
var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0);
$("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break;
case "sameVehicleInspectionMain":
var noMore = (total == listLength);
var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2) && ($P.sameVehicleMainControl.untilPageNum == 0);
$("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break;
case "sameVehicleInspectionSub":
$("#sameVehicleInspectionSubTbody--${pageName}").html(trs);
break;
default: break;
}
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
$P.clickInspectionDataList = (dataKey, gridType) => {
switch (gridType) {
case "photoInspection":
if(dataKey != ""){
$("#photoInspectionTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.photoInspectionControl.dataset, dataKey);
}
var curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.photoInspectionControl.getNext(dataKey);
var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
break; break;
case "sameVehicleInspectionMain": case "sameVehicleInspectionMain":
if(dataKey == ""){ if(dataKey == ""){
$P.sameVehicleControl.sub.setData([]);
return; return;
} }
$("#sameVehicleInspectionMainTbody--${pageName}").setCurrentRow(dataKey); $("#sameVehicleInspectionMainTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.sameVehicleMainControl.dataset, dataKey);
$P.searchDetailInspectionDataList(dataKey); $P.searchDetailInspectionDataList(dataKey);
if(!auto){
$P.sameVehicleControl.main.setCurrent(dataKey);
}
break; break;
case "sameVehicleInspectionSub": case "sameVehicleInspectionSub":
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
$("#sameVehicleInspectionSubTbody--${pageName}").setCurrentRow(dataKey); $("#sameVehicleInspectionSubTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){
$P.sameVehicleControl.sub.setCurrent(dataKey); Apply.toDataset.current($P.sameVehicleSubControl.dataset, dataKey);
}
break; break;
} }
} }
$P.dblclickInspectionDataList = (dataKey, gridType) => { $P.dblclickInspectionDataList = (dataKey) => {
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
@ -759,7 +844,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : dialogUrl, url : dialogUrl,
data : params, data : params,
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : "totalInfoMainDialog", id : "totalInfoMainDialog",
@ -771,13 +856,56 @@ $(document).ready(function(){
}); });
} }
$P.showPhoto = (dataKey, nextDataKey, curDataVhrno, nextDataVhrno) => {
if(dataKey == ""){
$("#curDataVhrno--${pageName}").html("");
$("#nextDataVhrno--${pageName}").html("");
$("#curDataFiles--${pageName}").html("");
$("#nextDataFiles--${pageName}").html("");
return;
}
$("#curDataVhrno--${pageName}").html(curDataVhrno);
$("#nextDataVhrno--${pageName}").html(nextDataVhrno);
ajax.get({
url:"file/list.do",
data: {
infoType : "100",
infoKeys : [dataKey, nextDataKey],
fetchSize : 0
},
success : (resp) => {
var fileList = resp.fileList;
var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey);
var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey);
$("#curDataFiles--${pageName}").html("");
$("#nextDataFiles--${pageName}").html("");
currentDataFileList.forEach(function(item, index, array){
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC);
$("#curDataFiles--${pageName}").append(output);
});
nextDataFileList.forEach(function(item, index, array){
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC);
$("#nextDataFiles--${pageName}").append(output);
});
}
});
}
$P.openLevyExclPop = (levyExclSeCd) => { $P.openLevyExclPop = (levyExclSeCd) => {
var info = ""; var info = "";
if ($P.currentDisplay == "photoInspection") { if ($P.currentDisplay == "photoInspection") {
info = $P.photoInspectionControl.dataset.getCurrent("item"); info = $P.photoInspectionControl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") { } else if ($P.currentDisplay == "sameVehicleInspection") {
info = $P.sameVehicleControl.sub.dataset.getCurrent("item"); info = $P.sameVehicleSubControl.dataset.getCurrent("item");
} else { } else {
return; return;
} }
@ -798,7 +926,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url(taskSeCd + "/excl/excl01/020/info.do"), url : wctx.url(taskSeCd + "/excl/excl01/020/info.do"),
data : params, data : params,
success : resp => { success : (resp) => {
if((typeof resp) != "string"){ if((typeof resp) != "string"){
dialog.alert({ dialog.alert({
@ -844,7 +972,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/PVS/crdn/crdn02/050/info.do"), url : wctx.url("/PVS/crdn/crdn02/050/info.do"),
data : params, data : params,
success : resp => { success : (resp) => {
if((typeof resp) != "string"){ if((typeof resp) != "string"){
dialog.alert({ dialog.alert({
@ -874,81 +1002,6 @@ $(document).ready(function(){
} }
} }
$P.renderInspectionDataList = (total, renderDataType) => {
switch (renderDataType) {
case "photoInspection":
var DS = $P.photoInspectionControl.dataset;
var empty = DS.empty;
var notFound = [document.getElementById("photoInspectionNotFound--${pageName}").innerHTML]
var found = document.getElementById("photoInspectionRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
var trs = empty ? notFound : DS.inStrings(found, replacer);
var noMore = (total == DS.length);
var initScroll = ($P.photoInspectionControl.query.pageNum < 2) && ($P.photoInspectionControl.untilPageNum == 0);
$("#photoInspection-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if($P.photoInspectionControl.untilPageNum != 0){
$P.photoInspectionControl.query.fetchSize = $P.photoInspectionControl.defaultFetchSize;
$P.photoInspectionControl.query.pageNum = $P.photoInspectionControl.untilPageNum;
$P.photoInspectionControl.untilPageNum = 0;
}
break;
case "sameVehicleInspectionMain":
var DS = $P.sameVehicleControl.main.dataset;
var empty = DS.empty;
var notFound = [document.getElementById("sameVehicleInspectionMainNotFound--${pageName}").innerHTML];
var found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
var trs = empty ? notFound : DS.inStrings(found, replacer);
var noMore = (total == DS.length);
var initScroll = ($P.sameVehicleControl.main.query.pageNum < 2) && ($P.sameVehicleControl.untilPageNum == 0);
$("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if($P.sameVehicleControl.untilPageNum != 0){
$P.sameVehicleControl.main.query.fetchSize = $P.sameVehicleControl.defaultFetchSize;
$P.sameVehicleControl.main.query.pageNum = $P.sameVehicleControl.untilPageNum;
$P.sameVehicleControl.untilPageNum = 0;
}
break;
case "sameVehicleInspectionSub":
var DS = $P.sameVehicleControl.sub.dataset;
var empty = DS.empty;
var notFound = [document.getElementById("sameVehicleInspectionSubNotFound--${pageName}").innerHTML]
var found = document.getElementById("sameVehicleInspectionSubRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');");
var trs = empty ? notFound : DS.inStrings(found, replacer);
$("#sameVehicleInspectionSubTbody--${pageName}").html(trs.join());
break;
default: break;
}
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
if($P.currentDisplay == "photoInspection"){
data.fetchSize = $P.photoInspectionControl.defaultFetchSize;
} else if($P.currentDisplay == "sameVehicleInspection"){
data.fetchSize = $P.sameVehicleControl.defaultFetchSize;
}
return data;
}
/************************************************************************** /**************************************************************************
* element.on * element.on
@ -974,48 +1027,7 @@ $(document).ready(function(){
}); });
$('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼 $('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼
$('#btnExcel--${pageName}').on('click', function(){ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
if($P.currentDisplay == "photoInspection"){
if($P.photoInspectionControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
$($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.photoInspectionControl.query.cellDefs = cellDefs;
$P.photoInspectionControl.download();
} else {
if($P.sameVehicleControl.main.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
if(confirm("단속건수 엑셀저장은 확인버튼, 상세내역 엑셀저장시 취소버튼을 누르세요.")){
var cellDefs = getCellDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
$($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td"));
$P.sameVehicleControl.main.query.cellDefs = cellDefs;
$P.sameVehicleControl.main.download();
} else {
var cellDefs = getCellDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"),
$($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask"));
$P.sameVehicleControl.sub.query.cellDefs = cellDefs;
$P.sameVehicleControl.sub.download();
}
}
});
$("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1")); $("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1"));

@ -48,45 +48,24 @@ $(document).ready(function(){
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.crdnControl = new DatasetControl({ $P.crdnControl = new DatasetControl({
urls : { update : wctx.url("/PVS/crdn/crdn02/050/update.do") }, urls : {
update : wctx.url("/PVS/crdn/crdn02/050/update.do")
},
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
dataGetter : obj => obj.crdnInfo, dataGetter : obj => obj.crdnInfo,
formats: {} formats: {}
}); });
$P.crdnControl.save = (info) => {
if (!info) return;
ajax.post({
url : $P.crdnControl.urls.update,
data : info,
success : resp => { $P.crdnControl.onSave(resp); }
});
};
/************************************************************************** /**************************************************************************
* DatasetControl.on, Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(DI); $P.formFields.set(dataItem);
} }
$P.crdnControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
}
});
dialog.close("overTimeProcessDialog--${openerPageName}");
if ("${savedCallbackFuncName}" != "") {
${savedCallbackFuncName}(resp.saved);
}
}
};
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -121,7 +100,19 @@ $(document).ready(function(){
} }
if(confirm(alertMessage)){ if(confirm(alertMessage)){
$P.crdnControl.save($P.formFields.get()); var info = $P.formFields.get();
if (!info) {
return;
}
ajax.post({
url : $P.crdnControl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
}
});
} }
} }
@ -141,10 +132,33 @@ $(document).ready(function(){
if(confirm("원금 복원하시겠습니까?")){ if(confirm("원금 복원하시겠습니까?")){
var info = $P.formFields.get(); var info = $P.formFields.get();
info.chgAmtSe = "0"; info.chgAmtSe = "0";
$P.crdnControl.save(info);
ajax.post({
url : $P.crdnControl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
}
});
} }
} }
$P.saveCallback = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
}
});
dialog.close("overTimeProcessDialog--${openerPageName}");
if ("${savedCallbackFuncName}" != "") {
${savedCallbackFuncName}(resp.saved);
}
}
};
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/

@ -158,45 +158,47 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
$("#crdnPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
list : $P.crdnControl.dataset,
prefix : "crdnPaging--${pageName}",
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true;
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
if(!$P.crdnControl.tableRenderComplete){
return;
}
$P.crdnControl.tableRenderComplete = false;
if(!DI){
$P.clickCrdnList("", true);
} else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
}; };
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.refreshCrdnList = () => { $P.fnReset = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; var searchForm = $("#frmSearch--${pageName}");
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
$P.crdnControl.load(1); searchForm.find("input[type='checkbox']").prop("checked", false);
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("동적 검색");
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
$P.crdnControl.setData([]);
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.taskSeCd = "DPV";
data.fetchSize = $P.crdnControl.defaultFetchSize;
return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -208,55 +210,81 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.clickCrdnList = (dataKey, auto) => { $P.refreshCrdnList = () => {
if(dataKey == ""){ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
return; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
}
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); Apply.fromDatasetControl.load($P.crdnControl, 1).then((resp)=>{
Apply.toDataset.set($P.crdnControl.dataset, resp);
$P.crdnControl.dataset.onDatasetChange(resp);
if(!auto){ if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.setCurrent(dataKey); $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
} $P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
} }
$P.dblclickCrdnList = (dataKey) => { if($P.crdnControl.beforeCurrent != null){
let params = { var beforeCurrentKey = $P.crdnControl.beforeCurrent.key;
callControlName : "pageObject['${pageName}'].crdnControl" var beforeCurrentIndex = $P.crdnControl.beforeCurrent.index;
, crdnId : dataKey $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);
} else {
if(beforeCurrentIndex > ($P.crdnControl.dataset.length - 1)){
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1];
} else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex];
} }
ajax.get({ $P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true);
url : $P.crdnControl.urls.getInfo, }
data : params, }
success : resp => { }
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
}); });
}
$P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
} }
});
var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download();
} }
$P.renderCrdnList = (total) => { $P.getGridTemplate = () => {
var crdnDS = $P.crdnControl.dataset;
var empty = crdnDS.empty;
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML; var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnDS.inStrings(found,replacer); return {
var noMore = (total == crdnDS.length); found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0); var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
@ -269,52 +297,38 @@ $(document).ready(function(){
} }
} }
$P.getParams = () => { $P.clickCrdnList = (dataKey) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); if(dataKey == ""){
var data = formFields.get(); return;
data.taskSeCd = "DPV";
data.fetchSize = $P.crdnControl.defaultFetchSize;
return data;
} }
$P.fnReset = () => { $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
var searchForm = $("#frmSearch--${pageName}"); Apply.toDataset.current($P.crdnControl.dataset, dataKey);
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
searchForm.find("input[type='checkbox']").prop("checked", false);
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("동적 검색");
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', new Date());
$P.crdnControl.setData([]);
} }
/************************************************************************** $P.dblclickCrdnList = (dataKey) => {
* element.on let params = {
**************************************************************************/ callControlName : "pageObject['${pageName}'].crdnControl"
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); , crdnId : dataKey
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
} }
var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"), ajax.get({
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); url : $P.crdnControl.urls.getInfo,
$P.crdnControl.query.cellDefs = cellDefs; data : params,
success : (resp) => {
$P.crdnControl.download(); dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
}); });
fnMakeResizableTable($("#table-responsive--${pageName}")[0]); }
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList); });
$('#btnUpdateToConfirmData--${pageName}').on('click', () => { }
$P.save = () => {
if(!$P.crdnControl.getCurrent()) { if(!$P.crdnControl.getCurrent()) {
dialog.alert({ dialog.alert({
@ -332,10 +346,40 @@ $(document).ready(function(){
focusOK(); focusOK();
}, },
onOK : () => { onOK : () => {
$P.crdnControl.save({ 'crdnId' : $P.crdnControl.getCurrent()["CRDN_ID"] }); var info = { 'crdnId' : $P.crdnControl.getCurrent()["CRDN_ID"] };
ajax.post({
url : $P.crdnControl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
} }
}); });
}
}); });
}
$P.saveCallback = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
onClose : () => {
$P.refreshCrdnList();
}
});
}
}
/**************************************************************************
* element.on
**************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollCrdnList);
$('#btnUpdateToConfirmData--${pageName}').on('click', () => $P.save());
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -135,7 +135,6 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
$P.crdnControl.urls.newInfoByFile = ""; $P.crdnControl.urls.newInfoByFile = "";
$P.crdnControl.urls.newInfoByHand = ""; $P.crdnControl.urls.newInfoByHand = "";
@ -157,7 +156,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : url, url : url,
data : {}, data : {},
success:resp => { success : (resp) => {
dialog.open({ dialog.open({
id: dialogId, id: dialogId,
title: title, title: title,
@ -170,34 +169,19 @@ $(document).ready(function(){
}; };
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
$P.renderCrdnList(obj["Total"]); Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
$("#crdnPaging--${pageName}").setPagingInfo({
list : $P.crdnControl.dataset,
prefix : "crdnPaging--${pageName}",
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true;
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
if(!$P.crdnControl.tableRenderComplete){
return;
}
$P.crdnControl.tableRenderComplete = false;
if(!DI){
$P.clickCrdnList("", true);
} else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
} }
/************************************************************************** /**************************************************************************
@ -229,10 +213,11 @@ $(document).ready(function(){
} }
} }
$P.refreshCrdnList = () => { $P.getParams = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; var data = formFields.get();
$P.crdnControl.load(1); data.fetchSize = $P.crdnControl.defaultFetchSize;
return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -244,32 +229,33 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.clickCrdnList = (dataKey, auto) => { $P.refreshCrdnList = () => {
if(dataKey == ""){ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
return; $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
} $P.crdnControl.load(1);
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
if(!auto) {
$P.crdnControl.setCurrent(dataKey);
}
} }
$P.renderCrdnList = (total) => {
var crdnDS = $P.crdnControl.dataset; $P.getGridTemplate = () => {
var empty = crdnDS.empty;
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML; var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : crdnDS.inStrings(found,replacer); return {
var noMore = (total == crdnDS.length); found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0); var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
@ -281,11 +267,14 @@ $(document).ready(function(){
} }
} }
$P.getParams = () => { $P.clickCrdnList = (dataKey) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); if(dataKey == ""){
var data = formFields.get(); return;
data.fetchSize = $P.crdnControl.defaultFetchSize; }
return data; $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
$P.crdnControl.setCurrent(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey);
} }
/************************************************************************** /**************************************************************************

@ -189,38 +189,36 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.parsedInfoControl.onDatasetChange = (obj) => { $P.parsedInfoControl.dataset.onDatasetChange = (obj) => {
$P.renderParsedInfoList(obj["Total"]); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.parsedInfoControl.dataset, t.found, t.notFound, t.replacer);
$P.renderParsedInfoList(obj["Total"], $P.parsedInfoControl.dataset.length, trs);
$("#parsedInfoPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.parsedInfoControl.dataset, obj, "parsedInfoPaging--${pageName}");
list : $P.parsedInfoControl.dataset,
prefix : "parsedInfoPaging--${pageName}",
totalSize : obj["Total"]
});
}; };
$P.parsedInfoControl.onCurrentChange = (DI) => { $P.parsedInfoControl.dataset.onCurrentChange = (dataItem) => {
$("#imageArea--${pageName}").html(""); $("#imageArea--${pageName}").html("");
if(DI && DI.data){ if(dataItem && dataItem.data){
var dataKey = DI.data.FILE_NAME; var dataKey = dataItem.data.FILE_NAME;
$("#table-responsive--${pageName}").find("tbody").setCurrentRow(dataKey); $("#table-responsive--${pageName}").find("tbody").setCurrentRow(dataKey);
if(DI.data.FILE_GROUP_TYPE == "BIN"){ if(dataItem.data.FILE_GROUP_TYPE == "BIN"){
var srcArr = []; var srcArr = [];
for(var i=1; i <= DI.data.PHOTO_CNT; i++){ for(var i=1; i <= dataItem.data.PHOTO_CNT; i++){
srcArr.push("data:image/jpg;base64," + DI.data["B64IMAGE"+i]) srcArr.push("data:image/jpg;base64," + dataItem.data["B64IMAGE"+i])
} }
$P.renderImage(srcArr); $P.renderImage(srcArr);
} else { } else {
if(!dataKey.endsWith(".txt") && !dataKey.endsWith(".TXT")){ if(!dataKey.endsWith(".txt") && !dataKey.endsWith(".TXT")){
var src = DI.data.FILE_PATH; var src = dataItem.data.FILE_PATH;
$P.renderImage(src); $P.renderImage(src);
} }
} }
@ -313,21 +311,24 @@ $(document).ready(function(){
}); });
} }
//테이블 렌더링 $P.getGridTemplate = () => {
$P.renderParsedInfoList = (total) => {
var parsedInfoDS = $P.parsedInfoControl.dataset;
var empty = parsedInfoDS.empty;
var notFound = [$("#table-responsive--${pageName}").find("template.notFound")[0].innerHTML]; var notFound = [$("#table-responsive--${pageName}").find("template.notFound")[0].innerHTML];
var found = $("#table-responsive--${pageName}").find("template.found")[0].innerHTML; var found = $("#table-responsive--${pageName}").find("template.found")[0].innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
var trs = empty ? notFound : parsedInfoDS.inStrings(found,replacer); return {
found : found,
notFound : notFound,
replacer : replacer
};
}
//테이블 렌더링
$P.renderParsedInfoList = (total, listLength, trs) => {
$("#table-responsive--${pageName}").find("tbody").html(trs.join()); $("#table-responsive--${pageName}").find("tbody").html(trs);
if(!empty){ if(listLength != 0){
fnDownsizeCheck($("#table-responsive--${pageName}").find("table")[0]); fnDownsizeCheck($("#table-responsive--${pageName}").find("table")[0]);
} }

@ -1,6 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="pageKorName" scope="request">단속자료 수기 등록</c:set>
<div class="d-flex flex-row justify-content-evenly"> <div class="d-flex flex-row justify-content-evenly">
<div class="card" style="max-width:1100px;"> <div class="card" style="max-width:1100px;">
<form id="frmEdit--${pageName}"> <form id="frmEdit--${pageName}">
@ -382,7 +382,10 @@ $(document).ready(function(){
$P.uploadSet = uploadSupport("#inputUploadSet--${pageName}"); $P.uploadSet = uploadSupport("#inputUploadSet--${pageName}");
$P.crdnControl = new DatasetControl({ $P.crdnControl = new DatasetControl({
urls : { load : "", create : wctx.url("/${taskSeCd}/crdn/crdn05/030/create.do") }, urls : {
load : "",
create : wctx.url("/${taskSeCd}/crdn/crdn05/030/create.do")
},
keymapper : info => info ? info.CRDN_ID : "", keymapper : info => info ? info.CRDN_ID : "",
dataGetter : obj => obj["List"], appendData : true, dataGetter : obj => obj["List"], appendData : true,
formats: { formats: {
@ -390,37 +393,8 @@ $(document).ready(function(){
} }
}); });
$P.crdnControl.save = (info) => {
if (!info) return;
var item = $P.crdnControl.getCurrent("item"),
create = "added" == item.state;
var formData = new FormData(document.getElementById("frmFile--${pageName}"));
for(var key in info) {
var value = info[key];
formData.append(key,value);
}
formData.delete("newFileList");
if($P.localUploadArr.length > 0){
$P.localUploadArr.forEach(item => formData.append("newFileList",item));
}
if($P.captureFileArr.length > 0){
$P.captureFileArr.forEach(item => formData.append("newFileList",item));
}
ajax.post({
url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create,
data: formData, contentType : false, processData : false,
success:resp => $P.crdnControl.onSave(resp)
});
};
/************************************************************************** /**************************************************************************
* DatasetControl.on, Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.uploadSet.onDatasetChange = () => { $P.uploadSet.onDatasetChange = () => {
var files = $P.uploadSet.getDataset(); var files = $P.uploadSet.getDataset();
@ -430,18 +404,6 @@ $(document).ready(function(){
}; };
$P.uploadSet.onRemove = () => { }; $P.uploadSet.onRemove = () => { };
$P.crdnControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
}
});
dialog.close("manualdialog");
}
};
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -494,11 +456,52 @@ $(document).ready(function(){
} }
if(confirm("현재 단속 정보를 저장하시겠습니까?")){ if(confirm("현재 단속 정보를 저장하시겠습니까?")){
$P.crdnControl.save($P.formFields.get()); var info = $P.formFields.get();
if (!info) {
return;
}
var formData = new FormData(document.getElementById("frmFile--${pageName}"));
for(var key in info) {
var value = info[key];
formData.append(key,value);
}
formData.delete("newFileList");
if($P.localUploadArr.length > 0){
$P.localUploadArr.forEach(item => formData.append("newFileList",item));
}
if($P.captureFileArr.length > 0){
$P.captureFileArr.forEach(item => formData.append("newFileList",item));
}
ajax.post({
url : $P.crdnControl.urls.create,
data : formData, contentType : false, processData : false,
success : (resp) => {
$P.saveCallback(resp);
}
});
} }
}; };
$P.saveCallback = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function(){
setDialogZindex();
focusClose();
}
});
dialog.close("manualdialog");
}
}
$P.videoCallback = (snapshots) => { $P.videoCallback = (snapshots) => {
snapshots.forEach(function(canvas, index, array){ snapshots.forEach(function(canvas, index, array){
canvas.toBlob(function(blob){ canvas.toBlob(function(blob){
@ -592,7 +595,7 @@ $(document).ready(function(){
vhrno : vhrno, vhrno : vhrno,
levy_stdde : crdnYmd levy_stdde : crdnYmd
}, },
success:resp => { success : (resp) => {
if(!resp.found){ if(!resp.found){
dialog.alert({ dialog.alert({
content : "차량정보가 없습니다.", content : "차량정보가 없습니다.",
@ -673,7 +676,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url: wctx.url("/${taskSeCd}/crdn/crdn07/010/info.do"), url: wctx.url("/${taskSeCd}/crdn/crdn07/010/info.do"),
data: { "teamId" : this.value}, data: { "teamId" : this.value},
success:resp => { success : (resp) => {
if(resp.teamInfo != null){ if(resp.teamInfo != null){
var teamInfo = resp.teamInfo; var teamInfo = resp.teamInfo;
$("#teamer1--${pageName}").val(teamInfo.TEAMER_1); $("#teamer1--${pageName}").val(teamInfo.TEAMER_1);

@ -176,7 +176,7 @@
<th style="width: 80px;" class="cmn">No.</th> <th style="width: 80px;" class="cmn">No.</th>
<th class="cmn" style="width: 56px;"> <th class="cmn" style="width: 56px;">
<input type="checkbox" class="form-check-input" <input type="checkbox" class="form-check-input"
onchange="pageObject['${pageName}'].crdnControl.select(this.checked);" /> onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);" />
</th> </th>
<th onclick="searchFromGridTitle('CRDN_INPT_SE_CD',this.innerText,'codeValue','FIM003');" <th onclick="searchFromGridTitle('CRDN_INPT_SE_CD',this.innerText,'codeValue','FIM003');"
style="width: 160px;" class="pvs bpv dpv eca">자료출처</th> style="width: 160px;" class="pvs bpv dpv eca">자료출처</th>
@ -207,7 +207,7 @@
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end cmn">{ROW_NUM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end cmn">{ROW_NUM}</td>
<td class="cmn text-center"> <td class="cmn text-center">
<input type="checkbox" class="form-check-input" value="{CRDN_ID}" <input type="checkbox" class="form-check-input" value="{CRDN_ID}"
onchange="pageObject['${pageName}'].crdnControl.select('{CRDN_ID}', this.checked);"> onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);">
</td> </td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{CRDN_INPT_SE_CD}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{CRDN_INPT_SE_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{VHRNO}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{VHRNO}</td>
@ -314,49 +314,25 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
$P.renderCrdnList(obj["Total"]); Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
$("#crdnPaging--${pageName}").setPagingInfo({
list : $P.crdnControl.dataset,
prefix : "crdnPaging--${pageName}",
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true;
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
if(!$P.crdnControl.tableRenderComplete){
return;
} }
$P.crdnControl.tableRenderComplete = false; $P.crdnControl.dataset.onSelectionChange = (selectedArr) => {
if(!DI){ Apply.fromDataset.gridCheckbox($P.crdnControl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr);
$P.clickCrdnList("", true); Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnSendCrdn--${pageName}")[0], selectedArr);
} else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
}
$P.crdnControl.onSelectionChange = (selectedArr) => {
var crdnDS = $P.crdnControl.dataset;
var keys = selectedArr.map(item => crdnDS.getKey(item));
$("#crdnTbody--${pageName} input[type='checkbox']").each(function() {
var checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnSendCrdn--${pageName}").prop("disabled", keys.length < 1);
}; };
/************************************************************************** /**************************************************************************
@ -407,10 +383,12 @@ $(document).ready(function(){
} }
} }
$P.refreshCrdnList = () => { $P.getParams = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; var data = formFields.get();
$P.crdnControl.load(1); data.fetchSize = $P.crdnControl.defaultFetchSize;
return data;
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -422,65 +400,70 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.clickCrdnList = (dataKey, auto) => { $P.refreshCrdnList = () => {
if(dataKey == ""){ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
$P.crdnControl.load(1);
}
$P.fnExcelDown = (forApproval) => {
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return; return;
} }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey); var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
if(!auto){ if(forApproval){
$P.crdnControl.setCurrent(dataKey); $P.crdnControl.query.includePhoto = "Y";
} } else {
$P.crdnControl.query.includePhoto = "N";
} }
$P.dblclickCrdnList = (dataKey) => { $P.crdnControl.download();
var params = {
callControlName : "pageObject['${pageName}'].crdnControl",
crdnId : dataKey
};
ajax.get({ $P.crdnControl.query.includePhoto = null;
url : $P.crdnControl.urls.getInfo, };
data : params,
success : resp => {
dialog.open({ $P.checkCrdnList = (element, bool) => {
id : "totalInfoMainDialog", Grid.checkbox.sync(element, bool);
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
} var atLeastOne = Grid.checkbox.countChecked(element) > 0;
}); $("#btnSendCrdn--${pageName}").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.crdnControl.dataset, element, bool);
} }
$P.renderCrdnList = (total) => { $P.getGridTemplate = () => {
var crdnDS = $P.crdnControl.dataset;
var empty = crdnDS.empty;
var clsForTask = $("#frmSearch--${pageName} [name='taskSeCd']:checked").val().toLowerCase(); var clsForTask = $("#frmSearch--${pageName} [name='taskSeCd']:checked").val().toLowerCase();
var notFound = [document.getElementById("crdnNotFound--${pageName}").content.querySelector("."+clsForTask+",.cmn").outerHTML]; var notFound = [document.getElementById("crdnNotFound--${pageName}").content.querySelector("."+clsForTask+",.cmn").outerHTML];
var foundContent = document.getElementById("crdnRow--${pageName}").content; var foundContent = document.getElementById("crdnRow--${pageName}").content;
var foundTr = $(foundContent).find("tr")[0].cloneNode(false); var foundTr = $(foundContent).find("tr")[0].cloneNode(false);
var foundTds = $(foundContent).find("."+clsForTask+",.cmn"); var foundTds = $(foundContent).find("."+clsForTask+",.cmn");
foundTds.each(function(){ foundTds.each(function(){
foundTr.appendChild(this.cloneNode(true)); foundTr.appendChild(this.cloneNode(true));
}); });
var found = foundTr.outerHTML; var found = foundTr.outerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnDS.inStrings(found, replacer); return {
var noMore = (total == crdnDS.length); found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0); var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드 fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
@ -491,12 +474,35 @@ $(document).ready(function(){
} }
} }
$P.getParams = () => { $P.clickCrdnList = (dataKey) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); if(dataKey == ""){
var data = formFields.get(); return;
data.fetchSize = $P.crdnControl.defaultFetchSize; }
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
var params = {
callControlName : "pageObject['${pageName}'].crdnControl",
crdnId : dataKey
};
ajax.get({
url : $P.crdnControl.urls.getInfo,
data : params,
success : (resp) => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
return data;
} }
$P.fnSendCrdn = () => { $P.fnSendCrdn = () => {
@ -508,7 +514,7 @@ $(document).ready(function(){
ajax.post({ ajax.post({
url : wctx.url("/"+taskSeCd+"/crdn/crdn06/010/sendCrdn.do"), url : wctx.url("/"+taskSeCd+"/crdn/crdn06/010/sendCrdn.do"),
data : { "crdnIDs" : keys.join(",") }, data : { "crdnIDs" : keys.join(",") },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.alert({ dialog.alert({
content : "처리되었습니다.", content : "처리되었습니다.",
@ -526,26 +532,7 @@ $(document).ready(function(){
} }
}); });
} }
$P.fnExcelDown = (forApproval) => {
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
if(forApproval){
$P.crdnControl.query.includePhoto = "Y";
} else {
$P.crdnControl.query.includePhoto = "N";
}
$P.crdnControl.download();
$P.crdnControl.query.includePhoto = null;
};
/************************************************************************** /**************************************************************************
* element.on * element.on

@ -288,22 +288,27 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.useTeamControl.onDatasetChange = (obj) => { $P.useTeamControl.dataset.onDatasetChange = (obj) => {
$P.renderUseTeamList(obj["Total"]); var t = $P.getGridTemplate("useTeam");
var trs = Apply.fromDataset.getTbody($P.useTeamControl.dataset, t.found, t.notFound, t.replacer);
$P.renderUseTeamList(obj["Total"], $P.useTeamControl.dataset.length, trs);
$("#useTeamPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.useTeamControl.dataset, obj, "useTeamPaging--${pageName}");
list : $P.useTeamControl.dataset, };
prefix : "useTeamPaging--${pageName}",
totalSize : obj["Total"] $P.delTeamControl.dataset.onDatasetChange = (obj) => {
});
var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody($P.delTeamControl.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], $P.delTeamControl.dataset.length, trs);
}; };
$P.useTeamControl.onCurrentChange = (DI) => { $P.useTeamControl.dataset.onCurrentChange = (dataItem) => {
if(!DI){ if(!dataItem){
$("#teamNm--${pageName}").val(""); $("#teamNm--${pageName}").val("");
$("#crdnSeCd--${pageName}").val(""); $("#crdnSeCd--${pageName}").val("");
$("#teamer1--${pageName}").val(""); $("#teamer1--${pageName}").val("");
@ -314,35 +319,20 @@ $(document).ready(function(){
return; return;
} }
$("#useTeamTbody--${pageName}").setCurrentRow(DI.data.TEAM_ID); Apply.fromDataset.currentRow($P.useTeamControl.dataset, dataItem, $("#useTeamTbody--${pageName}")[0]);
$("#teamNm--${pageName}").val(DI.data.TEAM_NM); $("#teamNm--${pageName}").val(dataItem.data.TEAM_NM);
$("#crdnSeCd--${pageName}").val(DI.data.CRDN_SE_CD); $("#crdnSeCd--${pageName}").val(dataItem.data.CRDN_SE_CD);
$("#teamer1--${pageName}").val(DI.data.TEAMER_1); $("#teamer1--${pageName}").val(dataItem.data.TEAMER_1);
$("#teamer2--${pageName}").val(DI.data.TEAMER_2); $("#teamer2--${pageName}").val(dataItem.data.TEAMER_2);
$("#teamer3--${pageName}").val(DI.data.TEAMER_3); $("#teamer3--${pageName}").val(dataItem.data.TEAMER_3);
$("#teamer4--${pageName}").val(DI.data.TEAMER_4); $("#teamer4--${pageName}").val(dataItem.data.TEAMER_4);
$("#etcCn--${pageName}").val(DI.data.ETC_CN); $("#etcCn--${pageName}").val(dataItem.data.ETC_CN);
$("#deletedTeamNm--${pageName}").val(DI.data.TEAM_NM); $("#deletedTeamNm--${pageName}").val(dataItem.data.TEAM_NM);
} }
$P.delTeamControl.onDatasetChange = (obj) => {
var delTeamDS = $P.delTeamControl.dataset;
var empty = delTeamDS.empty;
var notFound = [document.getElementById("delTeamNotFound--${pageName}").innerHTML];
var found = document.getElementById("delTeamRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "")
.replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : delTeamDS.inStrings(found,replacer);
$("#delTeamTbody--${pageName}").html(trs.join());
};
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -369,43 +359,63 @@ $(document).ready(function(){
$P.useTeamControl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do"); $P.useTeamControl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do");
} }
$P.refreshUseTeamList = () => { $P.getParams = () => {
if($P.useTeamControl.query.pageNum == null){ var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.useTeamControl.query.pageNum = 1; var data = formFields.get();
}
$P.useTeamControl.load(1); return data;
} }
$P.searchUseTeamList = () => { $P.searchUseTeamList = () => {
$P.useTeamControl.query = $P.getParams(); $P.useTeamControl.query = $P.getParams();
$P.useTeamControl.load(1); $P.useTeamControl.load(1);
} }
$P.clickUseTeamList = (dataKey) => { $P.refreshUseTeamList = () => {
$P.useTeamControl.setCurrent(dataKey); if($P.useTeamControl.query.pageNum == null){
$P.useTeamControl.query.pageNum = 1;
} }
$P.renderUseTeamList = (total) => { $P.useTeamControl.load(1);
}
$P.getGridTemplate = (gridType) => {
var found;
var notFound;
var replacer;
var useTeamDS = $P.useTeamControl.dataset; if(gridType == "useTeam"){
var empty = useTeamDS.empty; notFound = [document.getElementById("useTeamNotFound--${pageName}").innerHTML];
var notFound = [document.getElementById("useTeamNotFound--${pageName}").innerHTML]; found = document.getElementById("useTeamRow--${pageName}").innerHTML;
var found = document.getElementById("useTeamRow--${pageName}").innerHTML; replacer = (str, dataItem) => str
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickUseTeamList('" + dataItem.getValue("TEAM_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickUseTeamList('" + dataItem.getValue("TEAM_ID") + "');")
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
} else {
notFound = [document.getElementById("delTeamNotFound--${pageName}").innerHTML];
found = document.getElementById("delTeamRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "")
.replace(/{ondblclick}/gi, "");
}
var trs = empty ? notFound : useTeamDS.inStrings(found,replacer); return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$("#useTeamTbody--${pageName}").html(trs.join()); $P.renderUseTeamList = (total, listLength, trs) => {
$("#useTeamTbody--${pageName}").html(trs);
} }
$P.getParams = () => { $P.renderDelTeamList = (total, listLength, trs) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); $("#delTeamTbody--${pageName}").html(trs);
var data = formFields.get(); }
return data; $P.clickUseTeamList = (dataKey) => {
$P.useTeamControl.setCurrent(dataKey);
} }
$P.fnSave = () => { $P.fnSave = () => {
@ -417,7 +427,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.useTeamControl.urls.save, url : $P.useTeamControl.urls.save,
data : data, data : data,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
$P.refreshUseTeamList(); $P.refreshUseTeamList();
} }
@ -432,7 +442,7 @@ $(document).ready(function(){
data : { data : {
"teamId" : dataKey "teamId" : dataKey
}, },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
$P.refreshUseTeamList(); $P.refreshUseTeamList();
} }
@ -452,7 +462,7 @@ $(document).ready(function(){
"teamNm" : teamNm, "teamNm" : teamNm,
"taskSeCd" : taskSeCd "taskSeCd" : taskSeCd
}, },
success:resp => { success:(resp) => {
$P.delTeamControl.setData(resp); $P.delTeamControl.setData(resp);
} }

@ -179,14 +179,12 @@ $(document).ready(function(){
$P.exmptnVhclControl.defaultFetchSize = FETCH_XS; $P.exmptnVhclControl.defaultFetchSize = FETCH_XS;
$P.exmptnVhclControl.untilPageNum = 0; $P.exmptnVhclControl.untilPageNum = 0;
$P.exmptnVhclControl.beforeCurrent = null; $P.exmptnVhclControl.beforeCurrent = null;
$P.exmptnVhclControl.tableRenderComplete = false;
$P.exmptnVhclControl.newInfo = () => { $P.exmptnVhclControl.newInfo = () => {
ajax.get({ ajax.get({
url : $P.exmptnVhclControl.urls.newInfo, url : $P.exmptnVhclControl.urls.newInfo,
data: {}, data: {},
success:resp => { success:(resp) => {
dialog.open({ dialog.open({
id: "exmptnvhcldialog", id: "exmptnvhcldialog",
title: "면제차량 등록", title: "면제차량 등록",
@ -215,7 +213,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.exmptnVhclControl.urls.getInfo, url : $P.exmptnVhclControl.urls.getInfo,
data: param, data: param,
success:resp => { success:(resp) => {
dialog.open({ dialog.open({
id: "exmptnvhcldialog", id: "exmptnvhcldialog",
title: "면제차량 수정", title: "면제차량 수정",
@ -241,35 +239,18 @@ $(document).ready(function(){
}; };
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.exmptnVhclControl.onDatasetChange = (obj) => { $P.exmptnVhclControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
$P.renderExmptnVhclList(obj["Total"]); var trs = Apply.fromDataset.getTbody($P.exmptnVhclControl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.exmptnVhclControl.dataset.length, trs);
$("#exmptnVhclPaging--${pageName}").setPagingInfo({
list : $P.exmptnVhclControl.dataset,
prefix : "exmptnVhclPaging--${pageName}",
totalSize : obj["Total"]
});
$P.exmptnVhclControl.tableRenderComplete = true;
Apply.fromDataset.paging($P.exmptnVhclControl.dataset, obj, "exmptnVhclPaging--${pageName}");
}; };
$P.exmptnVhclControl.onCurrentChange = (DI) => { $P.exmptnVhclControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.exmptnVhclControl.dataset, dataItem, $("#exmptnVhclTbody--${pageName}")[0]);
if(!$P.exmptnVhclControl.tableRenderComplete){
return;
}
$P.exmptnVhclControl.tableRenderComplete = false;
if(!DI){
$P.clickExmptnVhclList("", true);
} else {
$P.clickExmptnVhclList($P.exmptnVhclControl.getCurrent()["EXMPTN_VHCL_ID"], true);
}
} }
/************************************************************************** /**************************************************************************
@ -283,6 +264,23 @@ $(document).ready(function(){
$P.exmptnVhclControl.setData([]); $P.exmptnVhclControl.setData([]);
} }
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.taskSeCd = "BPV";
data.fetchSize = $P.exmptnVhclControl.defaultFetchSize;
return data;
}
$P.searchExmptnVhclList = () => {
$P.exmptnVhclControl.query = $P.getParams();
$P.exmptnVhclControl.load(1);
}
$P.scrollExmptnVhclList = () => {
$P.exmptnVhclControl.load($P.exmptnVhclControl.query.pageNum + 1);
}
$P.refreshExmptnVhclList = () => { $P.refreshExmptnVhclList = () => {
if($P.exmptnVhclControl.query.pageNum == null){ if($P.exmptnVhclControl.query.pageNum == null){
$P.exmptnVhclControl.query.pageNum = 1; $P.exmptnVhclControl.query.pageNum = 1;
@ -292,16 +290,51 @@ $(document).ready(function(){
$P.exmptnVhclControl.load(1); $P.exmptnVhclControl.load(1);
} }
$P.searchExmptnVhclList = () => { $P.fnExcelDown = () => {
$P.exmptnVhclControl.query = $P.getParams(); if($P.exmptnVhclControl.dataset.empty){
$P.exmptnVhclControl.load(1); alert("조회된 자료가 없습니다.");
return;
} }
$P.scrollExmptnVhclList = () => { var cellDefs = getCellDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$P.exmptnVhclControl.load($P.exmptnVhclControl.query.pageNum + 1); $($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.exmptnVhclControl.query.cellDefs = cellDefs;
$P.exmptnVhclControl.download();
} }
$P.clickExmptnVhclList = (dataKey, auto) => { $P.getGridTemplate = () => {
var notFound = [document.getElementById("exmptnVhclNotFound--${pageName}").innerHTML];
var found = document.getElementById("exmptnVhclRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');");
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderExmptnVhclList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.exmptnVhclControl.query.pageNum < 2) && ($P.exmptnVhclControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
if($P.exmptnVhclControl.untilPageNum != 0){
$P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize;
$P.exmptnVhclControl.query.pageNum = $P.exmptnVhclControl.untilPageNum;
$P.exmptnVhclControl.untilPageNum = 0;
}
}
$P.clickExmptnVhclList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
$("#btnOpenDelRsn--${pageName}").prop("disabled", true); $("#btnOpenDelRsn--${pageName}").prop("disabled", true);
$("#btnHistory--${pageName}").prop("disabled", true); $("#btnHistory--${pageName}").prop("disabled", true);
@ -317,9 +350,7 @@ $(document).ready(function(){
$("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey); $("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey);
if(!auto) { Apply.toDataset.current($P.exmptnVhclControl.dataset, dataKey);
$P.exmptnVhclControl.setCurrent(dataKey);
}
} }
$P.dblclickExmptnVhclList = (dataKey) => { $P.dblclickExmptnVhclList = (dataKey) => {
@ -339,39 +370,6 @@ $(document).ready(function(){
$P.exmptnVhclControl.getInfo({"exmptnVhclId" : dataKey}); $P.exmptnVhclControl.getInfo({"exmptnVhclId" : dataKey});
} }
$P.renderExmptnVhclList = (total) => {
var exmptnVhclDS = $P.exmptnVhclControl.dataset;
var empty = exmptnVhclDS.empty;
var notFound = [document.getElementById("exmptnVhclNotFound--${pageName}").innerHTML];
var found = document.getElementById("exmptnVhclRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickExmptnVhclList('" + dataItem.getValue("EXMPTN_VHCL_ID") + "');");
var trs = empty ? notFound : exmptnVhclDS.inStrings(found,replacer);
var noMore = (total == exmptnVhclDS.length);
var initScroll = ($P.exmptnVhclControl.query.pageNum < 2) && ($P.exmptnVhclControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
if($P.exmptnVhclControl.untilPageNum != 0){
$P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize;
$P.exmptnVhclControl.query.pageNum = $P.exmptnVhclControl.untilPageNum;
$P.exmptnVhclControl.untilPageNum = 0;
}
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.taskSeCd = "BPV";
data.fetchSize = $P.exmptnVhclControl.defaultFetchSize;
return data;
}
$P.fnOpenDelRsnDialog = () => { $P.fnOpenDelRsnDialog = () => {
dialog.open({ dialog.open({
@ -396,7 +394,7 @@ $(document).ready(function(){
"exmptnVhclId" : dataKey, "exmptnVhclId" : dataKey,
"delRsn" : $("#delRsn--${pageName}").val() "delRsn" : $("#delRsn--${pageName}").val()
}, },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("delRsnDialog--${pageName}"); dialog.close("delRsnDialog--${pageName}");
$P.refreshExmptnVhclList(); $P.refreshExmptnVhclList();
@ -411,7 +409,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/BPV/crdn/crdn08/030/list.do"), url : wctx.url("/BPV/crdn/crdn08/030/list.do"),
data: { "exmptnVhclId" : dataKey }, data: { "exmptnVhclId" : dataKey },
success:resp => { success:(resp) => {
dialog.open({ dialog.open({
id: "exmptnvhclHistorydialog", id: "exmptnvhclHistorydialog",
title: "면제차량 이력", title: "면제차량 이력",
@ -437,19 +435,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList()); $("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList());
$('#btnExcel--${pageName}').on('click', function(){ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
if($P.exmptnVhclControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.exmptnVhclControl.query.cellDefs = cellDefs;
$P.exmptnVhclControl.download();
});
$("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); }); $("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); });
$("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); }); $("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); });

@ -107,6 +107,9 @@ $(document).ready(function(){
} }
}); });
/**************************************************************************
* DatasetControl.set
**************************************************************************/
$P.exmptnVhclControl.setInfo = (item) => { $P.exmptnVhclControl.setInfo = (item) => {
$P.formFields.set(item); $P.formFields.set(item);
@ -114,23 +117,36 @@ $(document).ready(function(){
$("#vhrno--${pageName}").prop("readonly", !create); $("#vhrno--${pageName}").prop("readonly", !create);
} }
$P.exmptnVhclControl.save = (info) => {
if (!info) return; /**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnSave = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return;
if(confirm("면제 차량 정보를 저장하시겠습니까?")){
var info = $P.formFields.get();
if (!info) {
return;
}
var create = isEmpty(info.exmptnVhclId); var create = isEmpty(info.exmptnVhclId);
ajax.post({ ajax.post({
url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create, url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create,
data : info, data : info,
success : resp => $P.exmptnVhclControl.onSave(resp) success : (resp) => {
$P.saveCallback(resp);
}
}); });
}; }
/************************************************************************** };
* DatasetControl.on, Dataset.on
**************************************************************************/
$P.exmptnVhclControl.onSave = (resp) => { $P.saveCallback = (resp) => {
if (resp.saved) { if (resp.saved) {
dialog.alert({ dialog.alert({
content : "저장됐습니다.", content : "저장됐습니다.",
@ -143,20 +159,6 @@ $(document).ready(function(){
$P.provided.refreshList(); $P.provided.refreshList();
} }
}; };
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnSave = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return;
if(confirm("면제 차량 정보를 저장하시겠습니까?")){
$P.exmptnVhclControl.save($P.formFields.get());
}
};
/************************************************************************** /**************************************************************************
* element.on * element.on

@ -89,18 +89,36 @@ $(document).ready(function(){
} }
}); });
$P.exmptnVhclControl.onDatasetChange = (obj) => { /**************************************************************************
var exmptnVhclDS = $P.exmptnVhclControl.dataset; * Dataset.on
var empty = exmptnVhclDS.empty; **************************************************************************/
$P.exmptnVhclControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.exmptnVhclControl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.exmptnVhclControl.dataset.length, trs);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.getGridTemplate = () => {
var notFound = [document.getElementById("exmptnVhclNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("exmptnVhclNotFound--${pageName}").innerHTML];
var found = document.getElementById("exmptnVhclRow--${pageName}").innerHTML; var found = document.getElementById("exmptnVhclRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "") .replace(/{onclick}/gi, "")
.replace(/{ondblclick}/gi, ""); .replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : exmptnVhclDS.inStrings(found,replacer); return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$("#exmptnVhclTbody--${pageName}").html(trs.join()); $P.renderExmptnVhclList = (total, listLength, trs) => {
$("#exmptnVhclTbody--${pageName}").html(trs);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));

@ -246,65 +246,40 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
$("#crdnPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
list : $P.crdnControl.dataset,
prefix : "crdnPaging--${pageName}",
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true;
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
if(!$P.crdnControl.tableRenderComplete){ Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
return; if(!dataItem){
} $("#bottomCrdnPlc--${pageName}").val("");
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)){ $("#btnOpenCvlcptOrgnl--${pageName}").hide();
info = $P.crdnControl.dataset.getDataset()[$P.crdnControl.dataset.length - 1]; $("#btnDelete--${pageName}").hide();
$("#btnDeleteSameRcptYmd--${pageName}").hide();
} else { } else {
info = $P.crdnControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true); $("#bottomCrdnPlc--${pageName}").val(dataItem.data["CRDN_PLC"]);
return;
}
}
$P.crdnControl.tableRenderComplete = false; if($P.holdList.includes(dataItem.data["CRDN_ID"])){
if(!DI){ $("#btnOpenCvlcptOrgnl--${pageName}").hide();
$P.clickCrdnList("", true); $("#btnDelete--${pageName}").hide();
$("#btnDeleteSameRcptYmd--${pageName}").hide();
} else { } else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true); $("#btnOpenCvlcptOrgnl--${pageName}").show();
} $("#btnDelete--${pageName}").show();
$("#btnDeleteSameRcptYmd--${pageName}").show();
} }
$P.crdnControl.onRemove = (selected, resp) => {
if (resp.saved){
$P.toast.show();
sleep(1000).then(() => $P.refreshCrdnList());
} }
} }
@ -338,14 +313,12 @@ $(document).ready(function(){
$P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); $P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
} }
$P.refreshCrdnList = () => { $P.getParams = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; var data = formFields.get();
$P.crdnControl.beforeCurrent = { data.fetchSize = $P.crdnControl.defaultFetchSize;
key : $P.crdnControl.getCurrent()["CRDN_ID"],
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1 return data;
};
$P.crdnControl.load(1);
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -362,13 +335,98 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.clickCrdnList = (dataKey, auto) => { $P.refreshCrdnList = () => {
if(dataKey == ""){ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
$("#bottomCrdnPlc--${pageName}").val(""); $P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
$P.crdnControl.beforeCurrent = {
key : $P.crdnControl.getCurrent()["CRDN_ID"],
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.load($P.crdnControl, 1).then((resp)=>{
Apply.toDataset.set($P.crdnControl.dataset, resp);
$P.crdnControl.dataset.onDatasetChange(resp);
if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
}
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);
} else {
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);
}
}
}
if(auto){
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd"); $("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
});
} }
$P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download();
}
$P.getGridTemplate = () => {
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.holdList.forEach(function(item){
$("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").addClass("bg-dark");
});
}
$P.clickCrdnList = (dataKey) => {
if(dataKey == ""){
$("#bottomCrdnPlc--${pageName}").val("");
return; return;
} }
@ -386,11 +444,7 @@ $(document).ready(function(){
$("#btnDeleteSameRcptYmd--${pageName}").show(); $("#btnDeleteSameRcptYmd--${pageName}").show();
} }
if(!auto){ Apply.toDataset.current($P.crdnControl.dataset, dataKey);
$P.crdnControl.setCurrent(dataKey);
} else {
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
}
} }
$P.dblclickCrdnList = (dataKey) => { $P.dblclickCrdnList = (dataKey) => {
@ -407,7 +461,7 @@ $(document).ready(function(){
"crdnId" : dataKey, "crdnId" : dataKey,
"openerPageName" : "${pageName}" "openerPageName" : "${pageName}"
}, },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "민원접수 초기자료 편집", title : "민원접수 초기자료 편집",
@ -434,45 +488,6 @@ $(document).ready(function(){
}); });
} }
$P.renderCrdnList = (total) => {
var crdnDS = $P.crdnControl.dataset;
var empty = crdnDS.empty;
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnDS.inStrings(found, replacer);
var noMore = (total == crdnDS.length);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
}
$P.holdList.forEach(function(item){
$("#crdnTbody--${pageName}").find("tr[data-key='"+item+"']").addClass("bg-dark");
});
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.fetchSize = $P.crdnControl.defaultFetchSize;
return data;
}
$P.fnHold = () => { $P.fnHold = () => {
var curKey = $P.crdnControl.getCurrent()["CRDN_ID"]; var curKey = $P.crdnControl.getCurrent()["CRDN_ID"];
@ -516,8 +531,30 @@ $(document).ready(function(){
$P.crdnControl.select(curKey,true); $P.crdnControl.select(curKey,true);
} }
$P.crdnControl.remove(); var selected = $P.crdnControl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
}
var params = {
"IDs" : selected.join(",")
};
ajax.post({
url : $P.crdnControl.urls.remove,
data : params,
success : (resp) => {
$P.removeCallback(selected, resp);
}
});
}
$P.removeCallback = (selected, resp) => {
if (resp.saved){
$P.toast.show();
sleep(1000).then(() => $P.refreshCrdnList());
} }
};
$P.fnRemoveSameRcptYmd = () => { $P.fnRemoveSameRcptYmd = () => {
var cur = $P.crdnControl.getCurrent(); var cur = $P.crdnControl.getCurrent();
@ -549,7 +586,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"), url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] }, data : { crdnId : cur["CRDN_ID"] },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "민원내역 원본", title : "민원내역 원본",
@ -630,19 +667,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download();
});
$("#btnHold--${pageName}").on("click", () => $P.fnHold()); $("#btnHold--${pageName}").on("click", () => $P.fnHold());
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove());

@ -437,65 +437,14 @@ $(document).ready(function(){
}); });
$P.crdnControl.save = (info, accept) => {
if (!info) return;
var formData = new FormData(document.getElementById("frmEdit--${pageName}"));
if(accept){
formData.append("acceptYn", "Y");
} else {
formData.append("acceptYn", "N");
}
ajax.post({
url : $P.crdnControl.urls.update,
data : formData, contentType : false, processData : false,
success : resp => { $P.crdnControl.onSave(resp); }
});
};
/************************************************************************** /**************************************************************************
* DatasetControl.on, Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(DI); $P.formFields.set(dataItem);
} }
$P.crdnControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function() {
setDialogZindex();
focusClose();
}
});
if($("#levyExcldialog--${pageName}").length > 0){
dialog.close("levyExcldialog--${pageName}");
}
var crdnId = $("#crdnId--${pageName}").val();
var cursorKey = "";
var nextKey = $P.provided.getNextKey(crdnId);
if(nextKey != ""){
cursorKey = nextKey;
} else {
var prevKey = $P.provided.getPrevKey(crdnId);
if(prevKey != ""){
cursorKey = prevKey;
}
}
$("#refreshEnd--${pageName}").attr("data-cursor-key", cursorKey);
$P.provided.refreshList();
}
};
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
@ -531,7 +480,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/${taskSeCd}/excl/excl01/020/info.do"), url : wctx.url("/${taskSeCd}/excl/excl01/020/info.do"),
data : params, data : params,
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : "levyExcldialog--${pageName}", id : "levyExcldialog--${pageName}",
@ -547,6 +496,26 @@ $(document).ready(function(){
}); });
}; };
$P.save = (info, accept) => {
if (!info) return;
var formData = new FormData(document.getElementById("frmEdit--${pageName}"));
if(accept){
formData.append("acceptYn", "Y");
} else {
formData.append("acceptYn", "N");
}
ajax.post({
url : $P.crdnControl.urls.update,
data : formData, contentType : false, processData : false,
success : (resp) => {
$P.saveCallback(resp);
}
});
};
$P.exclSaveCallback = function(exclInfo){ $P.exclSaveCallback = function(exclInfo){
var mergeInfo = $P.formFields.get(); var mergeInfo = $P.formFields.get();
@ -556,8 +525,42 @@ $(document).ready(function(){
mergeInfo.levyExclRsnCd = exclInfo.levyExclRsnCd; mergeInfo.levyExclRsnCd = exclInfo.levyExclRsnCd;
mergeInfo.levyExclSeCd = exclInfo.levyExclSeCd; mergeInfo.levyExclSeCd = exclInfo.levyExclSeCd;
$P.crdnControl.save(mergeInfo, false); $P.save(mergeInfo, false);
}
$P.saveCallback = (resp) => {
if (resp.saved) {
dialog.alert({
content : "저장됐습니다.",
init : function() {
setDialogZindex();
focusClose();
} }
});
if($("#levyExcldialog--${pageName}").length > 0){
dialog.close("levyExcldialog--${pageName}");
}
var crdnId = $("#crdnId--${pageName}").val();
var cursorKey = "";
var nextKey = $P.provided.getNextKey(crdnId);
if(nextKey != ""){
cursorKey = nextKey;
} else {
var prevKey = $P.provided.getPrevKey(crdnId);
if(prevKey != ""){
cursorKey = prevKey;
}
}
$("#refreshEnd--${pageName}").attr("data-cursor-key", cursorKey);
$P.provided.refreshList();
}
};
$P.fnPrev = () => { $P.fnPrev = () => {
var prevKey = $P.provided.getPrevKey($("#crdnId--${pageName}").val()); var prevKey = $P.provided.getPrevKey($("#crdnId--${pageName}").val());
@ -580,7 +583,7 @@ $(document).ready(function(){
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
}, },
success : resp => { success : (resp) => {
var crdnInfo = resp.crdnInfo; var crdnInfo = resp.crdnInfo;
crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN); crdnInfo.CVLCPT_APLY_CN = escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.crdnControl.setData([crdnInfo]); $P.crdnControl.setData([crdnInfo]);
@ -614,7 +617,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.crdnControl.urls.create, url : $P.crdnControl.urls.create,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : resp => { success : (resp) => {
if (resp.saved) { if (resp.saved) {
dialog.alert({ dialog.alert({
content : "복사 자료가 생성되었습니다.", content : "복사 자료가 생성되었습니다.",
@ -641,7 +644,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/${taskSeCd}/cvlc/cvlc01/050/info.do"), url : wctx.url("/${taskSeCd}/cvlc/cvlc01/050/info.do"),
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "민원내역 원본", title : "민원내역 원본",
@ -705,7 +708,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/"+params.taskSeCd + "/payer/info.do"), url : wctx.url("/"+params.taskSeCd + "/payer/info.do"),
data : params || {}, data : params || {},
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : "payerDialog", id : "payerDialog",
title : dialogTitle, title : dialogTitle,
@ -732,7 +735,7 @@ $(document).ready(function(){
url : wctx.url("/"+params.taskSeCd + "/sprt/sprt02/020/info.do"), url : wctx.url("/"+params.taskSeCd + "/sprt/sprt02/020/info.do"),
headers: { Accept: "application/json; charset=utf-8" }, headers: { Accept: "application/json; charset=utf-8" },
data : params || {}, data : params || {},
success : resp => { success : (resp) => {
if (resp.crdnPayer) { if (resp.crdnPayer) {
var payer = resp.crdnPayer; var payer = resp.crdnPayer;
@ -795,7 +798,7 @@ $(document).ready(function(){
} }
if(confirm("현재 단속 정보를 저장하시겠습니까?")){ if(confirm("현재 단속 정보를 저장하시겠습니까?")){
$P.crdnControl.save($P.formFields.get(), true); $P.save($P.formFields.get(), true);
} }
}; };
@ -811,7 +814,7 @@ $(document).ready(function(){
ajax.post({ ajax.post({
url : $P.crdnControl.urls.remove, url : $P.crdnControl.urls.remove,
data : { crdnId : crdnId }, data : { crdnId : crdnId },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
var message = "민원회수 요청이 등록되었습니다.\n" var message = "민원회수 요청이 등록되었습니다.\n"
+"30~60분 사이에 서버에서 민원시스템으로 전송이 진행되니 이후에 민원시스템에서 확인하시기 바랍니다."; +"30~60분 사이에 서버에서 민원시스템으로 전송이 진행되니 이후에 민원시스템에서 확인하시기 바랍니다.";

@ -130,10 +130,10 @@ $(document).ready(function() {
}); });
/************************************************************************** /**************************************************************************
* DatasetControl.on, Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.cvlcptControl.onCurrentChange = (DI) => { $P.cvlcptControl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(DI); $P.formFields.set(dataItem);
} }
/************************************************************************** /**************************************************************************
@ -161,7 +161,7 @@ $(document).ready(function() {
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
}, },
success : resp => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.setData([cvlcptInfo]); $P.cvlcptControl.setData([cvlcptInfo]);
@ -178,7 +178,7 @@ $(document).ready(function() {
ajax.post({ ajax.post({
url : wctx.url("/"+$P.taskSeCd+"/cvlc/cvlc01/050/makeFileFromHwpFormat.do"), url : wctx.url("/"+$P.taskSeCd+"/cvlc/cvlc01/050/makeFileFromHwpFormat.do"),
data : { crdnId : $("#crdnId--${pageName}").val() }, data : { crdnId : $("#crdnId--${pageName}").val() },
success : resp => { success : (resp) => {
var a = document.createElement("a"); var a = document.createElement("a");
a.href = resp.filePath; a.href = resp.filePath;

@ -146,7 +146,7 @@
<th style="width: 80px;">No.</th> <th style="width: 80px;">No.</th>
<th style="width: 60px;"> <th style="width: 60px;">
<input type="checkbox" name="gridAllCheckbox" <input type="checkbox" name="gridAllCheckbox"
onchange="pageObject['${pageName}'].crdnControl.select(this.checked);" /> onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);" />
</th> </th>
<th onclick="searchFromGridTitle('CVLCPT_RCPT_NO',this.innerText,'match','part');" <th onclick="searchFromGridTitle('CVLCPT_RCPT_NO',this.innerText,'match','part');"
style="width: 180px;">접수번호</th> style="width: 180px;">접수번호</th>
@ -181,7 +181,7 @@
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
<td class="text-center"> <td class="text-center">
<input type="checkbox" name="gridCheckbox" value="{CRDN_ID}" <input type="checkbox" name="gridCheckbox" value="{CRDN_ID}"
onchange="pageObject['${pageName}'].crdnControl.select('{CRDN_ID}', this.checked);" /> onchange="pageObject['${pageName}'].checkCrdnList(this, this.checked);" />
</td> </td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CVLCPT_RCPT_NO}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CVLCPT_RCPT_NO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CVLCPT_LIST_NO}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CVLCPT_LIST_NO}</td>
@ -252,97 +252,28 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
$P.crdnControl.save = (processType) => {
ajax.post({
url : $P.crdnControl.urls.update,
data : {
"processType" : processType,
"crdnIDs" : $P.crdnControl.dataset.getKeys("selected").join(",")
},
success : resp => {
if(resp.saved){
dialog.alert({
content : "처리되었습니다.",
init : function() {
focusClose();
}
});
$P.refreshCrdnList();
}
}
});
}
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]); var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
$("#crdnPaging--${pageName}").setPagingInfo({ Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
list : $P.crdnControl.dataset,
prefix : "crdnPaging--${pageName}",
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true;
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
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(!DI){
$P.clickCrdnList("", true);
} else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
} }
$P.crdnControl.onSelectionChange = (selectedArr) => { $P.crdnControl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.crdnControl.dataset, document.getElementById("crdnTbody--${pageName}"), 1, selectedArr);
var crdnDS = $P.crdnControl.dataset; Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnExecuteAnswer--${pageName}")[0], selectedArr);
var keys = selectedArr.map(item => crdnDS.getKey(item)); Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnAnswerComplete--${pageName}")[0], selectedArr);
Apply.fromDataset.gridButton($P.crdnControl.dataset, $("#btnExecuteDisabledTagInfoInquire--${pageName}")[0], selectedArr);
$("#table-responsive--${pageName}").find("input[name='gridCheckbox']").each(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);
}; };
/************************************************************************** /**************************************************************************
@ -377,14 +308,12 @@ $(document).ready(function(){
$P.crdnControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do"); $P.crdnControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do");
} }
$P.refreshCrdnList = () => { $P.getParams = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; var data = formFields.get();
$P.crdnControl.beforeCurrent = { data.fetchSize = $P.crdnControl.defaultFetchSize;
key : $P.crdnControl.getCurrent()["CRDN_ID"],
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1 return data;
};
$P.crdnControl.load(1);
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -396,6 +325,16 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.refreshCrdnList = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
$P.crdnControl.beforeCurrent = {
key : $P.crdnControl.getCurrent()["CRDN_ID"],
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1
};
$P.crdnControl.load(1);
}
$P.fnExcelDown = (forApproval) => { $P.fnExcelDown = (forApproval) => {
if($P.crdnControl.dataset.empty){ if($P.crdnControl.dataset.empty){
@ -418,54 +357,27 @@ $(document).ready(function(){
$P.crdnControl.query.includePhoto = null; $P.crdnControl.query.includePhoto = null;
}; };
$P.clickCrdnList = (dataKey, auto) => {
if(dataKey == ""){
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 : params,
success : resp => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
}
$P.renderCrdnList = (total) => {
var crdnDS = $P.crdnControl.dataset; $P.getGridTemplate = () => {
var empty = crdnDS.empty;
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML; var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnDS.inStrings(found, replacer); return {
var noMore = (total == crdnDS.length); found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0); var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
@ -479,7 +391,7 @@ $(document).ready(function(){
$("#crdnTbody--${pageName}").find("tr[data-key]").each(function(item){ $("#crdnTbody--${pageName}").find("tr[data-key]").each(function(item){
var crdnId = this.dataset.key; var crdnId = this.dataset.key;
var data = crdnDS.getData(crdnId); var data = $P.crdnControl.dataset.getData(crdnId);
if(data.COPY_EXIST_YN == "Y"){ if(data.COPY_EXIST_YN == "Y"){
$(this).addClass("text-red"); $(this).addClass("text-red");
@ -491,12 +403,46 @@ $(document).ready(function(){
} }
$P.getParams = () => { $P.checkCrdnList = (element, bool) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); Grid.checkbox.sync(element, bool);
var data = formFields.get();
data.fetchSize = $P.crdnControl.defaultFetchSize; var atLeastOne = Grid.checkbox.countChecked(element) > 0;
$("#btnExecuteAnswer--${pageName}").prop("disabled", !atLeastOne);
$("#btnAnswerComplete--${pageName}").prop("disabled", !atLeastOne);
$("#btnExecuteDisabledTagInfoInquire--${pageName}").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.crdnControl.dataset, element, bool);
}
$P.clickCrdnList = (dataKey) => {
if(dataKey == ""){
return;
}
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.crdnControl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
let params = {
callControlName : "pageObject['${pageName}'].crdnControl"
, crdnId : dataKey
}
ajax.get({
url : $P.crdnControl.urls.getInfo,
data : params,
success : (resp) => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
return data;
} }
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
@ -511,7 +457,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"), url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] }, data : { crdnId : cur["CRDN_ID"] },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "민원내역 원본", title : "민원내역 원본",
@ -548,7 +494,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc02/060/info.do"), url : wctx.url("/"+taskSeCd+"/cvlc/cvlc02/060/info.do"),
data : { crdnId : cur["CRDN_ID"] }, data : { crdnId : cur["CRDN_ID"] },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "답변내용 미리보기", title : "답변내용 미리보기",
@ -583,7 +529,7 @@ $(document).ready(function(){
focusOK(); focusOK();
}, },
onOK : () => { onOK : () => {
$P.crdnControl.save('answerExecute'); $P.save('answerExecute');
} }
}); });
} }
@ -598,7 +544,30 @@ $(document).ready(function(){
focusOK(); focusOK();
}, },
onOK : () => { onOK : () => {
$P.crdnControl.save('answerComplete'); $P.save('answerComplete');
}
});
}
//
$P.save = (processType) => {
ajax.post({
url : $P.crdnControl.urls.update,
data : {
"processType" : processType,
"crdnIDs" : $P.crdnControl.dataset.getKeys("selected").join(",")
},
success : (resp) => {
if(resp.saved){
dialog.alert({
content : "처리되었습니다.",
init : function() {
focusClose();
}
});
$P.refreshCrdnList();
}
} }
}); });
} }
@ -643,7 +612,7 @@ $(document).ready(function(){
data : { data : {
"crdnIDs" : keys.join(",") "crdnIDs" : keys.join(",")
}, },
success : resp => { success : (resp) => {
dialog.alert({ dialog.alert({
content : "표지정보조회가 실행되었습니다.", content : "표지정보조회가 실행되었습니다.",
init : function() { init : function() {

@ -100,34 +100,12 @@ $(document).ready(function() {
} }
}); });
$P.cvlcptControl.save = (info) => {
if (!info) return;
ajax.post({
url : $P.cvlcptControl.urls.update,
data : info,
success : resp => { $P.cvlcptControl.onSave(resp); }
});
};
/************************************************************************** /**************************************************************************
* DatasetControl.on, Dataset.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.cvlcptControl.onCurrentChange = (DI) => { $P.cvlcptControl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(DI); $P.formFields.set(dataItem);
}
$P.cvlcptControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert({
content : "표지정보조회가 실행되었습니다.",
init : function() {
setDialogZindex();
focusClose();
}
});
}
} }
/************************************************************************** /**************************************************************************
@ -155,7 +133,7 @@ $(document).ready(function() {
headers: { headers: {
Accept: "application/json; charset=utf-8" Accept: "application/json; charset=utf-8"
}, },
success : resp => { success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo; var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN); cvlcptInfo.CVLCPT_APLY_CN = escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.cvlcptControl.setData([cvlcptInfo]); $P.cvlcptControl.setData([cvlcptInfo]);
@ -172,9 +150,33 @@ $(document).ready(function() {
if(!customValidate($("#frmEdit--${pageName} input"))) return; if(!customValidate($("#frmEdit--${pageName} input"))) return;
if(confirm("현재 답변 내용을 저장하시겠습니까?")){ if(confirm("현재 답변 내용을 저장하시겠습니까?")){
$P.cvlcptControl.save($P.formFields.get()); var info = $P.formFields.get();
if (!info) {
return;
} }
ajax.post({
url : $P.cvlcptControl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
}
});
}
}
$P.saveCallback = (resp) => {
if (resp.saved) {
dialog.alert({
content : "표지정보조회가 실행되었습니다.",
init : function() {
setDialogZindex();
focusClose();
}
});
}
} }
/************************************************************************** /**************************************************************************

@ -242,67 +242,24 @@ $(document).ready(function(){
$P.crdnControl.defaultFetchSize = FETCH_XS; $P.crdnControl.defaultFetchSize = FETCH_XS;
$P.crdnControl.untilPageNum = 0; $P.crdnControl.untilPageNum = 0;
$P.crdnControl.beforeCurrent = null; $P.crdnControl.beforeCurrent = null;
$P.crdnControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.crdnControl.dataset.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]);
$("#crdnPaging--${pageName}").setPagingInfo({ var t = $P.getGridTemplate();
list : $P.crdnControl.dataset, var trs = Apply.fromDataset.getTbody($P.crdnControl.dataset, t.found, t.notFound, t.replacer);
prefix : "crdnPaging--${pageName}", $P.renderCrdnList(obj["Total"], $P.crdnControl.dataset.length, trs);
totalSize : obj["Total"]
});
$P.crdnControl.tableRenderComplete = true; Apply.fromDataset.paging($P.crdnControl.dataset, obj, "crdnPaging--${pageName}");
}; };
$P.crdnControl.onCurrentChange = (DI) => { $P.crdnControl.dataset.onCurrentChange = (dataItem) => {
if(!$P.crdnControl.tableRenderComplete){ Apply.fromDataset.currentRow($P.crdnControl.dataset, dataItem, $("#crdnTbody--${pageName}")[0]);
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(!DI){
$P.clickCrdnList("", true);
} else {
$P.clickCrdnList($P.crdnControl.getCurrent()["CRDN_ID"], true);
}
}
$P.crdnControl.onRemove = (selected, resp) => {
if (resp.saved){
$P.toast.show();
sleep(1000).then(() => $P.refreshCrdnList());
}
}
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
@ -329,14 +286,13 @@ $(document).ready(function(){
$P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do"); $P.crdnControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
} }
$P.refreshCrdnList = () => {
$P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum; $P.getParams = () => {
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum; var formFields = new FimsFormFields("#frmSearch--${pageName}");
$P.crdnControl.beforeCurrent = { var data = formFields.get();
key : $P.crdnControl.getCurrent()["CRDN_ID"], data.fetchSize = $P.crdnControl.defaultFetchSize;
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1
}; return data;
$P.crdnControl.load(1);
} }
$P.searchCrdnList = () => { $P.searchCrdnList = () => {
@ -349,81 +305,120 @@ $(document).ready(function(){
$P.crdnControl.load($P.crdnControl.query.pageNum + 1); $P.crdnControl.load($P.crdnControl.query.pageNum + 1);
} }
$P.clickCrdnList = (dataKey, auto) => { $P.refreshCrdnList = () => {
if(dataKey == ""){ $P.crdnControl.untilPageNum = $P.crdnControl.query.pageNum;
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize * $P.crdnControl.query.pageNum;
$P.crdnControl.beforeCurrent = {
key : $P.crdnControl.getCurrent()["CRDN_ID"],
index : $P.crdnControl.getCurrent()["ROW_NUM"] - 1
};
if(auto){ Apply.fromDatasetControl.load($P.crdnControl, 1).then((resp)=>{
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd"); Apply.toDataset.set($P.crdnControl.dataset, resp);
} $P.crdnControl.dataset.onDatasetChange(resp);
return;
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}").setCurrentRow(dataKey); 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(!auto){ if(info != null){
$P.crdnControl.setCurrent(dataKey); $P.crdnControl.dataset.setCurrent(beforeCurrentKey,true);
} else { } else {
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd"); 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.dblclickCrdnList = (dataKey) => { $P.crdnControl.dataset.setCurrent(info["CRDN_ID"],true);
let params = { }
callControlName : "pageObject['${pageName}'].crdnControl" }
, crdnId : dataKey
} }
ajax.get({ $("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
url : $P.crdnControl.urls.getInfo,
data : params,
success : resp => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
}); });
} }
});
$P.fnExcelDown = () => {
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
} }
$P.renderCrdnList = (total) => { var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download();
}
var crdnDS = $P.crdnControl.dataset; $P.getGridTemplate = () => {
var empty = crdnDS.empty;
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML];
var found = document.getElementById("crdnRow--${pageName}").innerHTML; var found = document.getElementById("crdnRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');"); .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
var trs = empty ? notFound : crdnDS.inStrings(found, replacer);
var noMore = (total == crdnDS.length); return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderCrdnList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0); var initScroll = ($P.crdnControl.query.pageNum < 2) && ($P.crdnControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
//보안모드 //보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked")); fn_securityModeToggle($("#securityMode--top").is(":checked"));
if($P.crdnControl.untilPageNum != 0){
$P.crdnControl.query.fetchSize = $P.crdnControl.defaultFetchSize;
$P.crdnControl.query.pageNum = $P.crdnControl.untilPageNum;
$P.crdnControl.untilPageNum = 0;
} }
$P.clickCrdnList = (dataKey) => {
if(dataKey == ""){
return;
} }
$P.getParams = () => { $("#crdnTbody--${pageName}").setCurrentRow(dataKey);
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.fetchSize = $P.crdnControl.defaultFetchSize;
return data; Apply.toDataset.current($P.crdnControl.dataset, dataKey);
} }
$P.dblclickCrdnList = (dataKey) => {
let params = {
callControlName : "pageObject['${pageName}'].crdnControl"
, crdnId : dataKey
}
ajax.get({
url : $P.crdnControl.urls.getInfo,
data : params,
success : (resp) => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
}
$P.fnRemove = () => { $P.fnRemove = () => {
@ -435,10 +430,30 @@ $(document).ready(function(){
var curKey = cur["CRDN_ID"]; var curKey = cur["CRDN_ID"];
$P.crdnControl.select(curKey,true); $P.crdnControl.select(curKey,true);
$P.crdnControl.remove(); var selected = $P.crdnControl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
} }
var params = {
"IDs" : selected.join(",")
};
ajax.post({
url : $P.crdnControl.urls.remove,
data : params,
success : (resp) => {
$P.saveCallback(selected, resp);
}
});
}
$P.saveCallback = (selected, resp) => {
if (resp.saved){
$P.toast.show();
sleep(1000).then(() => $P.refreshCrdnList());
}
}
$P.fnOpenCvlcptOrgnl = () => { $P.fnOpenCvlcptOrgnl = () => {
var cur = $P.crdnControl.getCurrent(); var cur = $P.crdnControl.getCurrent();
@ -452,7 +467,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"), url : wctx.url("/"+taskSeCd+"/cvlc/cvlc01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] }, data : { crdnId : cur["CRDN_ID"] },
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : dialogId, id : dialogId,
title : "민원내역 원본", title : "민원내역 원본",
@ -522,19 +537,7 @@ $(document).ready(function(){
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList());
$('#btnExcel--${pageName}').on('click', function(){ $('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
if($P.crdnControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download();
});
$("#btnDelete--${pageName}").on("click", () => $P.fnRemove()); $("#btnDelete--${pageName}").on("click", () => $P.fnRemove());
$("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl());

@ -193,67 +193,20 @@ $(document).ready(function(){
$P.dmndControl.defaultFetchSize = FETCH_XS; $P.dmndControl.defaultFetchSize = FETCH_XS;
$P.dmndControl.untilPageNum = 0; $P.dmndControl.untilPageNum = 0;
$P.dmndControl.beforeCurrent = null; $P.dmndControl.beforeCurrent = null;
$P.dmndControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.dmndControl.onDatasetChange = (obj) => { $P.dmndControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.dmndControl.dataset, t.found, t.notFound, t.replacer);
$P.renderDmndList(obj["Total"], $P.dmndControl.dataset.length, trs);
$P.renderDmndList(obj["Total"]); Apply.fromDataset.paging($P.dmndControl.dataset, obj, "dmndPaging--${pageName}");
$("#dmndPaging--${pageName}").setPagingInfo({
list : $P.dmndControl.dataset,
prefix : "dmndPaging--${pageName}",
totalSize : obj["Total"]
});
$P.dmndControl.tableRenderComplete = true;
}; };
$P.dmndControl.onCurrentChange = (DI) => { $P.dmndControl.dataset.onCurrentChange = (dataItem) => {
if(!$P.dmndControl.tableRenderComplete){ Apply.fromDataset.currentRow($P.dmndControl.dataset, dataItem, $("#dmndTbody--${pageName}")[0]);
return;
}
if($P.dmndControl.beforeCurrent != null){
var beforeCurrentKey = $P.dmndControl.beforeCurrent.key;
var beforeCurrentIndex = $P.dmndControl.beforeCurrent.index;
$P.dmndControl.beforeCurrent = null;
if(!$P.dmndControl.dataset.empty){
var info = $P.dmndControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.dmndControl.dataset.setCurrent(beforeCurrentKey,true);
return;
}
if(beforeCurrentIndex > ($P.dmndControl.dataset.length - 1)){
info = $P.dmndControl.dataset.getDataset()[$P.dmndControl.dataset.length - 1];
} else {
info = $P.dmndControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.dmndControl.dataset.setCurrent(info["INDIV_ID"],true);
return;
}
}
$P.dmndControl.tableRenderComplete = false;
if(!DI){
$P.clickDmndList("", true);
} else {
$P.clickDmndList($P.dmndControl.getCurrent()["INDIV_ID"], true);
}
}
$P.dmndControl.onRemove = (selected, resp) => {
if (resp.saved){
$("#toastText--${pageName}").html("삭제 되었습니다.");
$P.toast.show();
sleep(1000).then(() => $P.refreshDmndList());
}
} }
/************************************************************************** /**************************************************************************
@ -273,6 +226,23 @@ $(document).ready(function(){
$P.dmndControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do"); $P.dmndControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
} }
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.fetchSize = $P.dmndControl.defaultFetchSize;
return data;
}
$P.searchDmndList = () => {
$P.dmndControl.query = $P.getParams();
$P.dmndControl.load(1);
}
$P.scrollDmndList = () => {
$P.dmndControl.load($P.dmndControl.query.pageNum + 1);
}
$P.refreshDmndList = () => { $P.refreshDmndList = () => {
$P.dmndControl.untilPageNum = $P.dmndControl.query.pageNum; $P.dmndControl.untilPageNum = $P.dmndControl.query.pageNum;
$P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize * $P.dmndControl.query.pageNum; $P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize * $P.dmndControl.query.pageNum;
@ -284,51 +254,61 @@ $(document).ready(function(){
}; };
} }
$P.dmndControl.load(1); Apply.fromDatasetControl.load($P.dmndControl, 1).then((resp)=>{
Apply.toDataset.set($P.dmndControl.dataset, resp);
$P.dmndControl.dataset.onDatasetChange(resp);
if($P.dmndControl.untilPageNum != 0){
$P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize;
$P.dmndControl.query.pageNum = $P.dmndControl.untilPageNum;
$P.dmndControl.untilPageNum = 0;
} }
$P.searchDmndList = () => { if($P.dmndControl.beforeCurrent != null){
var beforeCurrentKey = $P.dmndControl.beforeCurrent.key;
var beforeCurrentIndex = $P.dmndControl.beforeCurrent.index;
$P.dmndControl.beforeCurrent = null;
$P.dmndControl.query = $P.getParams(); if(!$P.dmndControl.dataset.empty){
var info = $P.dmndControl.dataset.getData(beforeCurrentKey);
$P.dmndControl.load(1); if(info != null){
} $P.dmndControl.dataset.setCurrent(beforeCurrentKey,true);
} else {
$P.scrollDmndList = () => { if(beforeCurrentIndex > ($P.dmndControl.dataset.length - 1)){
$P.dmndControl.load($P.dmndControl.query.pageNum + 1); info = $P.dmndControl.dataset.getDataset()[$P.dmndControl.dataset.length - 1];
} else {
info = $P.dmndControl.dataset.getDataset()[beforeCurrentIndex];
} }
$P.clickDmndList = (dataKey, auto) => { $P.dmndControl.dataset.setCurrent(info["INDIV_ID"],true);
if(dataKey == ""){
if(auto){
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
}
return;
} }
$("#dmndTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){
$P.dmndControl.setCurrent(dataKey);
} else {
$("label[for='table-responsive--${pageName}']").trigger("refreshEnd");
} }
} }
$P.renderDmndList = (total) => { });
}
var dmndDS = $P.dmndControl.dataset; $P.getGridTemplate = () => {
var empty = dmndDS.empty;
var notFound = [document.getElementById("dmndNotFound--${pageName}").innerHTML]; var notFound = [document.getElementById("dmndNotFound--${pageName}").innerHTML];
var found = document.getElementById("dmndRow--${pageName}").innerHTML; var found = document.getElementById("dmndRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickDmndList('" + dataItem.getValue("INDIV_ID") + "');"); .replace(/{onclick}/gi, "pageObject['${pageName}'].clickDmndList('" + dataItem.getValue("INDIV_ID") + "');");
var trs = empty ? notFound : dmndDS.inStrings(found, replacer); return {
var noMore = (total == dmndDS.length); found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderDmndList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.dmndControl.query.pageNum < 2) && ($P.dmndControl.untilPageNum == 0); var initScroll = ($P.dmndControl.query.pageNum < 2) && ($P.dmndControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore); $("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
if($P.dmndControl.untilPageNum != 0){ if($P.dmndControl.untilPageNum != 0){
$P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize; $P.dmndControl.query.fetchSize = $P.dmndControl.defaultFetchSize;
@ -337,12 +317,13 @@ $(document).ready(function(){
} }
} }
$P.getParams = () => { $P.clickDmndList = (dataKey) => {
var formFields = new FimsFormFields("#frmSearch--${pageName}"); if(dataKey == ""){
var data = formFields.get(); return;
data.fetchSize = $P.dmndControl.defaultFetchSize; }
return data; $("#dmndTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.dmndControl.dataset, dataKey);
} }
$P.fnRemove = (allCompleteDataIds) => { $P.fnRemove = (allCompleteDataIds) => {
@ -359,7 +340,31 @@ $(document).ready(function(){
$P.dmndControl.select(curKey,true); $P.dmndControl.select(curKey,true);
} }
$P.dmndControl.remove(); var selected = $P.dmndControl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
}
var params = {
"IDs" : selected.join(",")
};
ajax.post({
url : $P.dmndControl.urls.remove,
data : params,
success : (resp) => {
$P.removeCallback(selected, resp);
}
});
}
$P.removeCallback = (selected, resp) => {
if (resp.saved){
$("#toastText--${pageName}").html("삭제 되었습니다.");
$P.toast.show();
sleep(1000).then(() => $P.refreshDmndList());
}
} }
$P.fnRemoveAllCompleteData = () => { $P.fnRemoveAllCompleteData = () => {
@ -425,7 +430,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.dmndControl.urls.create, url : $P.dmndControl.urls.create,
data : info, data : info,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
dialog.close("seallDmndDialog--${pageName}"); dialog.close("seallDmndDialog--${pageName}");

@ -380,7 +380,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.load, url : $P.ansBodyControl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : resp => { success : (resp) => {
$("#headerCn--${pageName}").val(resp.headerCn); $("#headerCn--${pageName}").val(resp.headerCn);
$("#footerCn--${pageName}").val(resp.footerCn); $("#footerCn--${pageName}").val(resp.footerCn);
@ -561,7 +561,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.load, url : $P.ansBodyControl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : resp => { success : (resp) => {
$("#headerCn--${pageName}").val(resp.headerCn); $("#headerCn--${pageName}").val(resp.headerCn);
$("#footerCn--${pageName}").val(resp.footerCn); $("#footerCn--${pageName}").val(resp.footerCn);
@ -625,7 +625,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.update, url : $P.ansBodyControl.urls.update,
data : info, data : info,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
$P.toast.show(); $P.toast.show();
sleep(1000).then(() => $P.refreshAnsWordsInfo()); sleep(1000).then(() => $P.refreshAnsWordsInfo());
@ -649,7 +649,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.remove, url : $P.ansBodyControl.urls.remove,
data : info, data : info,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
$P.toast.show(); $P.toast.show();
sleep(1000).then(() => $P.refreshAnsWordsInfo()); sleep(1000).then(() => $P.refreshAnsWordsInfo());

@ -184,7 +184,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.load, url : $P.warningWordsControl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : resp => { success : (resp) => {
$P.warningWordsControl.setData(resp.List); $P.warningWordsControl.setData(resp.List);
@ -258,7 +258,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.load, url : $P.warningWordsControl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : resp => { success : (resp) => {
$P.warningWordsControl.setData(resp.List); $P.warningWordsControl.setData(resp.List);
$P.renderWarningWordsList(resp.List.length); $P.renderWarningWordsList(resp.List.length);
@ -291,7 +291,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.warningWordsControl.urls.update, url : $P.warningWordsControl.urls.update,
data : info, data : info,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
$P.toast.show(); $P.toast.show();
sleep(1000).then(() => $P.refreshWarningWordsInfo()); sleep(1000).then(() => $P.refreshWarningWordsInfo());

@ -166,51 +166,26 @@ $(document).ready(function(){
$P.deptControl.defaultFetchSize = FETCH_XS; $P.deptControl.defaultFetchSize = FETCH_XS;
$P.deptControl.untilPageNum = 0; $P.deptControl.untilPageNum = 0;
$P.deptControl.beforeCurrent = null; $P.deptControl.beforeCurrent = null;
$P.deptControl.tableRenderComplete = false;
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.deptControl.onDatasetChange = (obj) => { $P.deptControl.dataset.onDatasetChange = (obj) => {
var t = $P.getGridTemplate();
$P.renderDeptList(obj["Total"]); var trs = Apply.fromDataset.getTbody($P.deptControl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.deptControl.dataset.length, trs);
$("#deptPaging--${pageName}").setPagingInfo({
list: $P.deptControl.dataset,
prefix: "deptPaging--${pageName}",
start: obj["Start"],
totalSize: obj["Total"],
fetchSize: obj["Fetch"],
func: "pageObject['${pageName}'].deptControl.load({index})"
});
$P.deptControl.tableRenderComplete = true; Apply.fromDataset.paging($P.deptControl.dataset, obj, "deptPaging--${pageName}");
}; };
$P.deptControl.onCurrentChange = (item) => { $P.deptControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.deptControl.dataset, dataItem, $("#deptTbody--${pageName}")[0]);
if(!$P.deptControl.tableRenderComplete){
return;
} }
$P.deptControl.tableRenderComplete = false; $P.deptControl.dataset.onSelectionChange = (selectedArr) => {
if(!item){ Apply.fromDataset.gridCheckbox($P.deptControl.dataset, document.getElementById("deptTbody--${pageName}"), 1, selectedArr);
$P.clickDeptList("", true); Apply.fromDataset.gridButton($P.deptControl.dataset, $("#btnDel--${pageName}")[0], selectedArr);
} else {
$P.clickDeptList($P.deptControl.getCurrent()["DEPT_CD"], true);
}
}
$P.deptControl.onSelectionChange = (selected) => {
var deptDS = $P.deptControl.dataset;
var keys = selected.map(e => deptDS.getKey(e));
$("#deptTbody--${pageName} input[type='checkbox']").each(function() {
var checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
$("#btnDel--${pageName}").prop("disabled", keys.length < 1);
}; };
/************************************************************************** /**************************************************************************
@ -228,11 +203,12 @@ $(document).ready(function(){
$P.deptControl.setData([]); $P.deptControl.setData([]);
} }
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.fetchSize = $P.deptControl.defaultFetchSize;
$P.refreshDeptList = () => { return data;
$P.deptControl.untilPageNum = $P.deptControl.query.pageNum;
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize * $P.deptControl.query.pageNum;
$P.deptControl.load(1);
} }
$P.searchDeptList = () => { $P.searchDeptList = () => {
@ -244,16 +220,50 @@ $(document).ready(function(){
$P.deptControl.load($P.deptControl.query.pageNum + 1); $P.deptControl.load($P.deptControl.query.pageNum + 1);
} }
$P.clickDeptList = (dataKey, auto) => { $P.refreshDeptList = () => {
$P.deptControl.untilPageNum = $P.deptControl.query.pageNum;
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize * $P.deptControl.query.pageNum;
$P.deptControl.load(1);
}
$P.getGridTemplate = () => {
var notFound = [document.getElementById("deptNotFound--${pageName}").innerHTML];
var found = document.getElementById("deptRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickDeptList('" + dataItem.getValue("DEPT_CD") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickDeptList('" + dataItem.getValue("DEPT_CD") + "');");
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderDeptList = (total, listLength, trs) => {
var noMore = (total == listLength);
var initScroll = ($P.deptControl.query.pageNum < 2) && ($P.deptControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
if($P.deptControl.untilPageNum != 0){
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize;
$P.deptControl.query.pageNum = $P.deptControl.untilPageNum;
$P.deptControl.untilPageNum = 0;
}
}
$P.clickDeptList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
$("#deptTbody--${pageName}").setCurrentRow(dataKey); $("#deptTbody--${pageName}").setCurrentRow(dataKey);
if(!auto){ Apply.toDataset.current($P.deptControl.dataset, dataKey);
$P.deptControl.setCurrent(dataKey);
}
} }
$P.dblclickDeptList = (dataKey) => { $P.dblclickDeptList = (dataKey) => {
@ -264,7 +274,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : $P.deptControl.urls.getInfo, url : $P.deptControl.urls.getInfo,
data : params, data : params,
success : resp => { success : (resp) => {
dialog.open({ dialog.open({
id : "deptInfoDialog", id : "deptInfoDialog",
@ -278,48 +288,13 @@ $(document).ready(function(){
} }
$P.renderDeptList = (total) => {
var deptDS = $P.deptControl.dataset;
var empty = deptDS.empty;
var found = document.getElementById("deptRow--${pageName}").innerHTML;
var notFound = [document.getElementById("deptNotFound--${pageName}").innerHTML];
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickDeptList('" + dataItem.getValue("DEPT_CD") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickDeptList('" + dataItem.getValue("DEPT_CD") + "');");
var trs = empty ? notFound : deptDS.inStrings(found, replacer);
var noMore = (total == deptDS.length);
var initScroll = ($P.deptControl.query.pageNum < 2) && ($P.deptControl.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
if($P.deptControl.untilPageNum != 0){
$P.deptControl.query.fetchSize = $P.deptControl.defaultFetchSize;
$P.deptControl.query.pageNum = $P.deptControl.untilPageNum;
$P.deptControl.untilPageNum = 0;
}
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
data.fetchSize = $P.deptControl.defaultFetchSize;
return data;
}
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$('#btnSearch--${pageName}').on('click', () => $P.searchDeptList()); $('#btnSearch--${pageName}').on('click', () => $P.searchDeptList());
$('#btnAdd--${pageName}').on('click', () => {});
$('#btnDel--${pageName}').on('click', () => {});
/************************************************************************** /**************************************************************************
* 초기화 * 초기화

@ -27,7 +27,7 @@ function fnGoToEditSgg(selected){
ajax.get({ ajax.get({
url: menuUrl, url: menuUrl,
data : { sggCd : selected }, data : { sggCd : selected },
success:resp => { success:(resp) => {
$("div[id='innerPage-"+sggMainMenuNum+"']").html(resp); $("div[id='innerPage-"+sggMainMenuNum+"']").html(resp);
} }
}); });

@ -96,33 +96,33 @@ $(document).ready(function() {
* DatasetControl 이벤트 * DatasetControl 이벤트
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.integrationSearchControl.updataset.onDatasetChange = (obj) => { $P.integrationSearchControl.upDataset.onDatasetChange = (obj) => {
var upActiveTab = $("#upGridTabs--${pageName}").find("button.active").text().trim(); var upActiveTab = $("#upGridTabs--${pageName}").find("button.active").text().trim();
$P.renderList("up", upActiveTab); $P.renderList("up", upActiveTab);
}; };
$P.integrationSearchControl.downdataset.onDatasetChange = (obj) => { $P.integrationSearchControl.downDataset.onDatasetChange = (obj) => {
var downActiveTab = $("#downGridTabs--${pageName}").find("button.active").text().trim(); var downActiveTab = $("#downGridTabs--${pageName}").find("button.active").text().trim();
$P.renderList("down", downActiveTab); $P.renderList("down", downActiveTab);
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.integrationSearchControl.updataset.onCurrentChange = (DI) => { $P.integrationSearchControl.upDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$("#upTbody--${pageName}").setCurrentRow(key); $("#upTbody--${pageName}").setCurrentRow(key);
}; };
$P.integrationSearchControl.downdataset.onCurrentChange = (DI) => { $P.integrationSearchControl.downDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$("#downTbody--${pageName}").setCurrentRow(key); $("#downTbody--${pageName}").setCurrentRow(key);
}; };
// 선택(체크) 변경 이벤트 // 선택(체크) 변경 이벤트
$P.integrationSearchControl.updataset.onSelectionChange = (selectedArr) => { $P.integrationSearchControl.upDataset.onSelectionChange = (selectedArr) => {
var DS = $P.integrationSearchControl.updataset; var DS = $P.integrationSearchControl.upDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$("#upTbody--${pageName}").find("input[type='checkbox']").each(function() { $("#upTbody--${pageName}").find("input[type='checkbox']").each(function() {
@ -132,9 +132,9 @@ $(document).ready(function() {
}; };
$P.integrationSearchControl.downdataset.onSelectionChange = (selectedArr) => { $P.integrationSearchControl.downDataset.onSelectionChange = (selectedArr) => {
var DS = $P.integrationSearchControl.downdataset; var DS = $P.integrationSearchControl.downDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$("#downTbody--${pageName}").find("input[type='checkbox']").each(function() { $("#downTbody--${pageName}").find("input[type='checkbox']").each(function() {
@ -154,14 +154,6 @@ $(document).ready(function() {
}); });
// 검색 조건 파라미터 가져오기
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var formData = formFields.get();
return formData;
}
// 초기화 // 초기화
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
@ -197,9 +189,17 @@ $(document).ready(function() {
$P.fnReset = () => { $P.fnReset = () => {
$P.integrationSearchControl.updataset.clear(); $P.integrationSearchControl.upDataset.clear();
$P.integrationSearchControl.downdataset.clear(); $P.integrationSearchControl.downDataset.clear();
}
// 검색 조건 파라미터 가져오기
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var formData = formFields.get();
return formData;
} }
// 검색 // 검색
@ -236,12 +236,45 @@ $(document).ready(function() {
$("#upGridTabs--${pageName}").find("button").eq(0).addClass("active"); $("#upGridTabs--${pageName}").find("button").eq(0).addClass("active");
$("#downGridTabs--${pageName}").find("button").not(":eq(0)").removeClass("active"); $("#downGridTabs--${pageName}").find("button").not(":eq(0)").removeClass("active");
$("#downGridTabs--${pageName}").find("button").eq(0).addClass("active"); $("#downGridTabs--${pageName}").find("button").eq(0).addClass("active");
$P.integrationSearchControl.updataset.clear(); $P.integrationSearchControl.upDataset.clear();
$P.integrationSearchControl.downdataset.clear(); $P.integrationSearchControl.downDataset.clear();
$P.integrationSearchControl.load(); $P.integrationSearchControl.load();
} }
// 엑셀
$P.fnExcel = (updown) => {
var cellDefs;
if(updown == "up"){
if($P.integrationSearchControl.upDataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
cellDefs = getCellDefs($("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
$P.integrationSearchControl.query.gridType = "up";
} else {
if($P.integrationSearchControl.downDataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
cellDefs = getCellDefs($("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
$P.integrationSearchControl.query.gridType = "down";
}
$P.integrationSearchControl.query.cellDefs = cellDefs;
$P.integrationSearchControl.download();
}
$P.renderList = (updown, tabGroup) => { $P.renderList = (updown, tabGroup) => {
var tbody = updown == "up" ? "upTbody--${pageName}" : "downTbody--${pageName}"; var tbody = updown == "up" ? "upTbody--${pageName}" : "downTbody--${pageName}";
@ -250,18 +283,18 @@ $(document).ready(function() {
var found = document.getElementById("row--${pageName}").innerHTML; var found = document.getElementById("row--${pageName}").innerHTML;
var DS; var DS;
if(updown == "up"){ if(updown == "up"){
DS = $P.integrationSearchControl.updataset; DS = $P.integrationSearchControl.upDataset;
} else { } else {
DS = $P.integrationSearchControl.downdataset; DS = $P.integrationSearchControl.downDataset;
} }
var replacer; var replacer;
if(updown == "up"){ if(updown == "up"){
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.updataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.upDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} else { } else {
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.downdataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.downDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} }
@ -340,46 +373,13 @@ $(document).ready(function() {
}; };
// 엑셀
$P.fnExcel = (updown) => {
var cellDefs;
if(updown == "up"){
if($P.integrationSearchControl.updataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
cellDefs = getCellDefs($("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
$P.integrationSearchControl.query.gridType = "up";
} else {
if($P.integrationSearchControl.downdataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
cellDefs = getCellDefs($("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
$P.integrationSearchControl.query.gridType = "down";
}
$P.integrationSearchControl.query.cellDefs = cellDefs;
$P.integrationSearchControl.download();
}
//납부자번호 복사 //납부자번호 복사
$P.fnCopyPyrNo = (updown) => { $P.fnCopyPyrNo = (updown) => {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.updataset.getCurrent(); cur = $P.integrationSearchControl.upDataset.getCurrent();
} else { } else {
cur = $P.integrationSearchControl.downdataset.getCurrent(); cur = $P.integrationSearchControl.downDataset.getCurrent();
} }
if(cur != null){ if(cur != null){
@ -393,9 +393,9 @@ $(document).ready(function() {
$P.fnManageEtcCn = (updown) => { $P.fnManageEtcCn = (updown) => {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.updataset.getCurrent(); cur = $P.integrationSearchControl.upDataset.getCurrent();
} else { } else {
cur = $P.integrationSearchControl.downdataset.getCurrent(); cur = $P.integrationSearchControl.downDataset.getCurrent();
} }
if(cur.length <= 0){ if(cur.length <= 0){
@ -408,10 +408,10 @@ $(document).ready(function() {
$P.fnInputEtcCn = (updown) => { $P.fnInputEtcCn = (updown) => {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.updataset; cur = $P.integrationSearchControl.upDataset;
} else { } else {
cur = $P.integrationSearchControl.downdataset; cur = $P.integrationSearchControl.downDataset;
} }
@ -430,7 +430,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : { crdnIds : crdnIds.join(",") } , data : { crdnIds : crdnIds.join(",") }
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : dialogId id : dialogId
, title : "특기사항입력-일괄" , title : "특기사항입력-일괄"
@ -454,8 +454,8 @@ $(document).ready(function() {
//단속내역서,단속확인서 //단속내역서,단속확인서
$P.fnPrintCrdn = () => { $P.fnPrintCrdn = () => {
var upDataset = $P.integrationSearchControl.updataset; var upDataset = $P.integrationSearchControl.upDataset;
var downDataset = $P.integrationSearchControl.downdataset; var downDataset = $P.integrationSearchControl.downDataset;
if((upDataset.length <= 0) && (downDataset.length <= 0)){ if((upDataset.length <= 0) && (downDataset.length <= 0)){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -475,7 +475,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : { crdnIds : crdnIds.join(",") } , data : { crdnIds : crdnIds.join(",") }
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : dialogId id : dialogId
, title : "종합조회-단속내역" , title : "종합조회-단속내역"
@ -500,7 +500,7 @@ $(document).ready(function() {
//교부청구서,채권신고서 //교부청구서,채권신고서
$P.fnPrintBill = () => { $P.fnPrintBill = () => {
var upDataset = $P.integrationSearchControl.updataset; var upDataset = $P.integrationSearchControl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -518,7 +518,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : { crdnIds : crdnIds.join(",") } , data : { crdnIds : crdnIds.join(",") }
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : dialogId id : dialogId
, title : "종합조회-교부청구서,채권신고서" , title : "종합조회-교부청구서,채권신고서"
@ -555,7 +555,7 @@ $(document).ready(function() {
//납부확인서 //납부확인서
$P.fnPrintRcvmtConfirm = () => { $P.fnPrintRcvmtConfirm = () => {
var downDataset = $P.integrationSearchControl.downdataset; var downDataset = $P.integrationSearchControl.downDataset;
if(downDataset.length <= 0){ if(downDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -574,7 +574,7 @@ $(document).ready(function() {
crdnIds : crdnIds.join(","), crdnIds : crdnIds.join(","),
globalVariable : {} globalVariable : {}
}, },
success : resp => { success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){ if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a"); var a = document.createElement("a");
a.href = resp.filePath; a.href = resp.filePath;
@ -591,7 +591,7 @@ $(document).ready(function() {
//사전통지서 //사전통지서
$P.fnPrintAdvntce = () => { $P.fnPrintAdvntce = () => {
var upDataset = $P.integrationSearchControl.updataset; var upDataset = $P.integrationSearchControl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -609,7 +609,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : { crdnIds : crdnIds.join(",") } , data : { crdnIds : crdnIds.join(",") }
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : dialogId id : dialogId
, title : "종합조회-사전통지서" , title : "종합조회-사전통지서"
@ -646,7 +646,7 @@ $(document).ready(function() {
//고지서 //고지서
$P.fnPrintNht = () => { $P.fnPrintNht = () => {
var upDataset = $P.integrationSearchControl.updataset; var upDataset = $P.integrationSearchControl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -664,7 +664,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : { crdnIds : crdnIds.join(",") } , data : { crdnIds : crdnIds.join(",") }
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : dialogId id : dialogId
, title : "종합조회-고지서" , title : "종합조회-고지서"
@ -714,7 +714,7 @@ $(document).ready(function() {
ajax.get({ ajax.get({
url : url url : url
, data : params , data : params
, success : resp => { , success : (resp) => {
dialog.open({ dialog.open({
id : "totalInfoMainDialog" id : "totalInfoMainDialog"
, title : "개별총정보" , title : "개별총정보"
@ -730,8 +730,8 @@ $(document).ready(function() {
$P.provide = { $P.provide = {
"getInfo" : function(crdnId){ "getInfo" : function(crdnId){
var upDataset = $P.integrationSearchControl.updataset; var upDataset = $P.integrationSearchControl.upDataset;
var downDataset = $P.integrationSearchControl.downdataset; var downDataset = $P.integrationSearchControl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); var info = upDataset.getData(crdnId);
@ -751,8 +751,8 @@ $(document).ready(function() {
}, },
"isAllSameTask" : function(crdnIdArr){ "isAllSameTask" : function(crdnIdArr){
var upArr = $P.integrationSearchControl.updataset.getDataset(); var upArr = $P.integrationSearchControl.upDataset.getDataset();
var downArr = $P.integrationSearchControl.downdataset.getDataset(); var downArr = $P.integrationSearchControl.downDataset.getDataset();
var unionArr = [...upArr, ...downArr]; var unionArr = [...upArr, ...downArr];
var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID)); var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID));

@ -94,7 +94,7 @@ $(document).ready(function(){
crdnIds : $P.crdnIds.join(","), crdnIds : $P.crdnIds.join(","),
etcCn : etcCn etcCn : etcCn
}, },
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
alert("저장되었습니다."); alert("저장되었습니다.");
var dialogId = $("#frmEdit--${pageName}").find("input[name='dialogId']").val(); var dialogId = $("#frmEdit--${pageName}").find("input[name='dialogId']").val();

@ -126,7 +126,7 @@ $(document).ready(function(){
data : { data : {
crdnIds : $P.crdnIds.join(",") crdnIds : $P.crdnIds.join(",")
}, },
success : resp => { success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){ if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a"); var a = document.createElement("a");
a.href = resp.filePath; a.href = resp.filePath;
@ -139,10 +139,7 @@ $(document).ready(function(){
}); });
} }
//버튼 이벤트 $P.fnExcelDown = () => {
$("#btnPrintCrdnList--${pageName}").on("click", () => $P.fnMakeCrdnListFile() );
$("#btnPrintCrdnConfirm--${pageName}").on("click", () => $P.fnMakeCrdnConfirmFile() );
$("#btnExcel--${pageName}").on("click", function(){
var query = {}; var query = {};
var cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th"), var cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th"),
@ -154,7 +151,12 @@ $(document).ready(function(){
var queryStr = toQuery(query); var queryStr = toQuery(query);
document.location.href = wctx.url("/sprt/sprt01/010/list.do") + "?" + queryStr; document.location.href = wctx.url("/sprt/sprt01/010/list.do") + "?" + queryStr;
}); }
//버튼 이벤트
$("#btnPrintCrdnList--${pageName}").on("click", () => $P.fnMakeCrdnListFile() );
$("#btnPrintCrdnConfirm--${pageName}").on("click", () => $P.fnMakeCrdnConfirmFile() );
$("#btnExcel--${pageName}").on("click", () => $P.fnExcelDown());
//첫번째 줄 클릭 //첫번째 줄 클릭
$("#tbody--${pageName}").find("tr:eq(0)").click(); $("#tbody--${pageName}").find("tr:eq(0)").click();

@ -294,7 +294,7 @@ $(document).ready(function(){
data : { data : {
crdnIds : $P.crdnIds.join(",") crdnIds : $P.crdnIds.join(",")
}, },
success : resp => { success : (resp) => {
if(resp.filePath != null && resp.filePath != ""){ if(resp.filePath != null && resp.filePath != ""){
var a = document.createElement("a"); var a = document.createElement("a");
a.href = resp.filePath; a.href = resp.filePath;

@ -212,9 +212,9 @@ $(document).ready(function(){
}); });
/************************************************************************** /**************************************************************************
* DatasetControl.on * Dataset.on
**************************************************************************/ **************************************************************************/
$P.detailGridControl.onDatasetChange = () => { $P.detailGridControl.dataset.onDatasetChange = () => {
var DS = $P.detailGridControl.dataset; var DS = $P.detailGridControl.dataset;
var empty = DS.empty; var empty = DS.empty;

@ -462,3 +462,134 @@ class FimsFormFields extends FormFields {
return obj; return obj;
} }
} }
const Apply = {
fromDataset : {
gridCheckbox : function(dataset, tbody, colIndex, checkedArr){
var keys = checkedArr.map(item => dataset.getKey(item));
$(tbody).find("tr").each(function() {
var cb = $(this).find("td").eq(colIndex).find(":checkbox");
cb.prop("checked", keys.includes(cb.val()));
});
},
gridButton : function(dataset, button, checkedArr){
var keys = checkedArr.map(item => dataset.getKey(item));
$(button).prop("disabled", keys.length < 1);
},
currentRow : function(dataset, dataItem, tbody){
if(!dataItem){
return;
}
$(tbody).setCurrentRow(dataset.getKey(dataItem));
},
paging : function(dataset, resp, navId){
$("#"+navId).setPagingInfo({
list : dataset,
prefix : navId,
totalSize : resp["Total"]
});
},
getTbody : function(dataset, found, notFound, replacer){
var empty = dataset.empty;
var trs = empty ? notFound : dataset.inStrings(found, replacer);
return trs.join();
}
},
toDataset : {
current : function(dataset, dataKey){
dataset.setCurrent(dataKey, false);
},
selection : function(dataset, checkbox, bool){
var parentEl = $(checkbox).parent()[0];
var isTH = parentEl.tagName == "TH" ? true : false;
if(isTH) {
var dataItems = dataset.getDataset("item");
for(var i=0; i < dataItems.legnth; i++){
dataItems[i].select(bool);
}
} else {
var dataItem = dataset.getData(checkbox.value, "item");
dataItem.select(bool);
}
},
set : function(dataset, resp){
dataset._byKeys = {};
dataset._current = null;
var data = dataset._getDataItems(resp = resp || {});
dataset._items = data.items;
dataset._byKeys = data.byKeys;
},
add : function(dataset, resp){
if (dataset.empty){
this.set(dataset, resp);
return;
}
var state = dataset.state;
var data = dataset._getDataItems(resp = resp || {});
dataset._items = this._items.concat(data.items);
dataset._byKeys = {
...this._byKeys,
...data.byKeys
};
}
},
fromDatasetControl : {
load : async function(control, pageNum){
control.query.pageNum = pageNum;
if (!control.query.pageNum){
control.query.pageNum = 1;
}
ajax.get({
url:control.urls.load,
data:control.query,
success:(resp) => {
resolve(resp);
}
});
},
save : async function(control, info){
if (!info) {
return;
}
var item = control.getCurrent("item");
var create = "added" == item.state;
ajax.post({
url:!create ? control.urls.update : control.urls.create,
data:info,
success:(resp) => {
resolve(resp);
}
});
},
remove : async function(control, params){
var selected = control.dataset.getKeys("selected");
if(selected.length < 1) {
return;
}
if(!params) {
params = {};
params[control.prefixed("IDs")] = selected.join(",");
}
ajax.post({
url:control.urls.remove,
data:params,
success:(resp) => {
resolve(resp);
}
});
}
}
};

@ -1,11 +1,3 @@
class InspectionControl {
constructor(mainConf, subConf) {
this.main = new DatasetControl(mainConf);
this.sub = new DatasetControl(subConf);
}
}
function fnMakeImgTagForInspection(url, title, crdnPhotoId, mosaic) { function fnMakeImgTagForInspection(url, title, crdnPhotoId, mosaic) {
return `<div style="display:flex;min-width:300px;"> return `<div style="display:flex;min-width:300px;">

@ -166,3 +166,65 @@ function fnJsonToFormData(originalJson, arrayName){
return {...originalJson, ...newObj}; return {...originalJson, ...newObj};
} }
} }
const GRID = {
checkbox : {
sync : function(checkboxElement, bool){
var parentEl = $(checkboxElement).parent()[0];
var isTH = parentEl.tagName == "TH" ? true : false;
var tr = $(checkboxElement).parents("tr");
var siblingTag = isTH ? "TH" : "TD";
var siblings = tr.find(siblingTag);
var checkboxColIndex = siblings.index(parentEl);
var table = $(checkboxElement).parents("table");
var thead = table.find("thead");
var tbody = table.find("tbody");
var trs = tbody.find("tr");
if(isTH) {
trs.each(function(){
$(this).find("td").eq(checkboxColIndex).find(":checkbox").prop("checked", bool);
});
} else {
var countCheck = 0;
var countUncheck = 0;
trs.each(function(){
var cb = $(this).find("td").eq(checkboxColIndex).find(":checkbox");
if(cb.length > 0){
cb.is(":checked") ? countCheck++ : countUncheck++;
}
});
if((countCheck == 0 && countUncheck != 0) || (countCheck != 0 && countUncheck == 0)){
thead.find(":checkbox").prop("checked", bool);
}
}
},
countChecked : function(checkboxElement){
var parentEl = $(checkboxElement).parent()[0];
var tr = $(checkboxElement).parents("tr");
var siblings = tr.find("TD");
var checkboxColIndex = siblings.index(parentEl);
var table = $(checkboxElement).parents("table");
var tbody = table.find("tbody");
var trs = tbody.find("tr");
var count = 0;
trs.each(function(){
var cb = $(this).find("td").eq(checkboxColIndex).find(":checkbox");
if(cb.length > 0){
if(cb.is(":checked")) {
count++;
}
}
});
return count;
}
}
};

@ -248,7 +248,7 @@ function settingPhotoMain(pageName, crdnIdElementId, carInfoFunc, carLinkFunc){
ajax.post({ ajax.post({
url : fileProcessingURL, url : fileProcessingURL,
data : formData, contentType : false, processData : false, data : formData, contentType : false, processData : false,
success : resp => { success : (resp) => {
if(resp.saved){ if(resp.saved){
var crdnId = $("#"+crdnIdElementId).val(); var crdnId = $("#"+crdnIdElementId).val();

@ -2,8 +2,8 @@ class IntegrationSearchControl extends DatasetControl {
constructor(conf) { constructor(conf) {
super(conf); super(conf);
this.updataset = new Dataset(conf); this.upDataset = new Dataset(conf);
this.downdataset = new Dataset(conf); this.downDataset = new Dataset(conf);
} }
@ -18,15 +18,15 @@ class IntegrationSearchControl extends DatasetControl {
ajax.get({ ajax.get({
url:this.urls.load, url:this.urls.load,
data:this.query, data:this.query,
success:resp => { success:(resp) => {
this.setData(resp); this.setData(resp);
} }
}); });
} }
setData(obj) { setData(obj) {
this.updataset.setData(obj.upList); this.upDataset.setData(obj.upList);
this.downdataset.setData(obj.downList); this.downDataset.setData(obj.downList);
} }
} }
Loading…
Cancel
Save