소스 정리

main
이범준 3 months ago
parent 81804c1787
commit 6bdb41447a

@ -132,9 +132,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.FILE_LAYOUT_ID : "",
urls : {
@ -146,29 +146,27 @@ $(document).ready(function(){
MDFCN_DT : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderLayoutList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderLayoutList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("layoutPaging"), $P.findn("layoutPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("layoutPaging"), $P.findn("layoutPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("layoutTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("layoutTbody"));
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do");
ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do");
$P.fnReset();
}
@ -180,32 +178,32 @@ $(document).ready(function(){
searchForm.find("input[type='hidden']").val("");
searchForm.find("input[type='text']").val("");
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchLayoutList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollLayoutList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshLayoutList = () => {
if($P.ctrl.query.pageNum == null){
if(ctrl.query.pageNum == null){
return;
}
$P.ctrl.reload({all : true});
ctrl.reload({all : true});
}
$P.getGridTemplate = () => {
@ -225,7 +223,7 @@ $(document).ready(function(){
$P.renderLayoutList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -242,7 +240,7 @@ $(document).ready(function(){
$P.$findn("layoutTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickLayoutList = (dataKey) => {
@ -260,7 +258,7 @@ $(document).ready(function(){
}
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
@ -305,16 +303,16 @@ $(document).ready(function(){
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchLayoutList());
$P.$findn("btnAdd").on('click', () => $P.createLayout());
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
Componentization.fnMakeResizableTable($P.findn("table-responsive"));
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollLayoutList);

@ -264,11 +264,11 @@ $(document).ready(function(){
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.FILE_LAYOUT_ID : "",
urls : {
@ -281,29 +281,26 @@ $(document).ready(function(){
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){
return;
}
$P.formFields.set($P.ctrl, dataItem);
$P.formFields.set(ctrl, dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnSave = () => {
if(!AppSupport.customValidate($P.$findn("frmEdit").find("input,select,textarea"))) return;
var info = $P.formFields.get();
var create = $P.ctrl.dataset.empty;
var create = ctrl.dataset.empty;
ajax.post({
url : create ? $P.ctrl.urls.create : $P.ctrl.urls.update,
url : create ? ctrl.urls.create : ctrl.urls.update,
data : info,
success : (resp) => {
if(resp.saved){
@ -326,7 +323,7 @@ $(document).ready(function(){
var info = $P.formFields.get();
ajax.post({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : {
fileLayoutId : info.fileLayoutId
},
@ -348,19 +345,19 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnSave").on('click', () => $P.fnSave());
$P.$findn("btnDelete").on('click', () => $P.fnRemove());
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var layoutInfo = ${layoutInfo};
if(layoutInfo != null){
$P.ctrl.dataset.setData([layoutInfo]);
ctrl.dataset.setData([layoutInfo]);
} else {
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
$P.$findn("sggCd").val(MY_INFO.info.sggCd);
$P.$findn("instCd").val(MY_INFO.info.instCd);

@ -393,16 +393,16 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
//단속사진검사 datasetControl 인스턴스
$P.ctrl = newCrdn02010Control();
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
$P.ctrl.getNext = (key) => {
var ctrl = $P.ctrl = newCrdn02010Control();
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.getNext = (key) => {
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == key);
if(ds.length > index+1){
@ -411,40 +411,28 @@ $(document).ready(function(){
return null;
}
}
//동일차량검사 datasetControl 인스턴스
$P.alt = newCrdn02010Alt();
$P.alt.defaultFetchSize = FETCH_XS;
$P.alt.query = { pageNum : 1, fetchSize : $P.alt.defaultFetchSize };
$P.alt.beforeCurrent = null;
$P.shift = new newCrdn02010Shift();
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("photoInspection");
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.ctrl.dataset.length, trs, "photoInspection", option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], ctrl.dataset.length, trs, "photoInspection", option);
Apply.fromDataset.paging($P.ctrl.dataset, obj,
Apply.fromDataset.paging(ctrl.dataset, obj,
$P.findn("photoInspectionPaging"), $P.findn("photoInspectionPagingInfo")
);
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("photoInspectionTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("photoInspectionTbody"));
var dataKey = "";
var curDataVhrno = "";
var nextDataKey = "";
var nextDataVhrno = "";
if(!$P.ctrl.dataset.empty){
dataKey = $P.ctrl.dataset.getKey(dataItem);
curDataVhrno = $P.ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.ctrl.getNext(dataKey);
if(!ctrl.dataset.empty){
dataKey = ctrl.dataset.getKey(dataItem);
curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = ctrl.getNext(dataKey);
nextDataKey = nextData != null ? nextData.CRDN_ID : "";
nextDataVhrno = nextData != null ? nextData.VHRNO : "";
}
@ -452,19 +440,25 @@ $(document).ready(function(){
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
}
$P.alt.dataset.onDatasetChange = (obj, option) => {
//동일차량검사 datasetControl 인스턴스
var alt = $P.alt = newCrdn02010Alt();
alt.defaultFetchSize = FETCH_XS;
alt.query = { pageNum : 1, fetchSize : alt.defaultFetchSize };
alt.beforeCurrent = null;
alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionMain");
var trs = Apply.fromDataset.getTbody($P.alt.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.alt.dataset.length, trs, "sameVehicleInspectionMain", option);
var trs = Apply.fromDataset.getTbody(alt.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], alt.dataset.length, trs, "sameVehicleInspectionMain", option);
Apply.fromDataset.paging($P.alt.dataset, obj,
Apply.fromDataset.paging(alt.dataset, obj,
$P.findn("sameVehicleInspectionMainPaging"), $P.findn("sameVehicleInspectionMainPagingInfo")
);
};
$P.alt.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.alt.dataset, dataItem, $P.findn("sameVehicleInspectionMainTbody"));
alt.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(alt.dataset, dataItem, $P.findn("sameVehicleInspectionMainTbody"));
if(dataItem){
$P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]);
} else {
@ -472,19 +466,22 @@ $(document).ready(function(){
}
}
$P.shift.dataset.onDatasetChange = (obj, option) => {
var shift = $P.shift = new newCrdn02010Shift();
shift.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionSub");
var trs = Apply.fromDataset.getTbody($P.shift.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.shift.dataset.length, trs, "sameVehicleInspectionSub", option);
var trs = Apply.fromDataset.getTbody(shift.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], shift.dataset.length, trs, "sameVehicleInspectionSub", option);
};
$P.shift.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.shift.dataset, dataItem, $P.findn("sameVehicleInspectionSubTbody"));
shift.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(shift.dataset, dataItem, $P.findn("sameVehicleInspectionSubTbody"));
};
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
@ -497,15 +494,15 @@ $(document).ready(function(){
$P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-7));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
$P.alt.dataset.setData([]);
ctrl.dataset.setData([]);
alt.dataset.setData([]);
};
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.alt.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.shift.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
alt.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
shift.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
var clsForTask = taskSeCd.toLowerCase();
//업무별 조회조건
@ -524,9 +521,9 @@ $(document).ready(function(){
var data = formFields.get();
if($P.currentDisplay == "photoInspection"){
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
} else if($P.currentDisplay == "sameVehicleInspection"){
data.fetchSize = $P.alt.defaultFetchSize;
data.fetchSize = alt.defaultFetchSize;
}
return data;
@ -535,34 +532,34 @@ $(document).ready(function(){
$P.searchInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.ctrl.query = $P.getParams();
$P.ctrl.query.inspectionDataType = "photo";
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.query.inspectionDataType = "photo";
ctrl.load(1);
break;
case "sameVehicleInspection":
$P.alt.query = $P.getParams();
$P.alt.query.inspectionDataType = "sameVehicleMain";
$P.alt.load(1);
alt.query = $P.getParams();
alt.query.inspectionDataType = "sameVehicleMain";
alt.load(1);
break;
default: break;
}
}
$P.searchDetailInspectionDataList = (dataKey) => {
$P.shift.query = {};
$P.shift.query.inspectionDataType = "sameVehicleSub";
$P.shift.query.crdnIds = dataKey;
$P.shift.query.taskSeCd = $P.alt.query.taskSeCd;
$P.shift.load(0);
shift.query = {};
shift.query.inspectionDataType = "sameVehicleSub";
shift.query.crdnIds = dataKey;
shift.query.taskSeCd = alt.query.taskSeCd;
shift.load(0);
}
$P.scrollInspectionDataList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
break;
case "sameVehicleInspection":
$P.alt.load($P.alt.query.pageNum + 1);
alt.load(alt.query.pageNum + 1);
break;
default: break;
}
@ -571,35 +568,35 @@ $(document).ready(function(){
$P.refreshInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){
let beforeCurrentKey = $P.ctrl.beforeCurrent.key;
let beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null;
if(ctrl.beforeCurrent != null){
let beforeCurrentKey = ctrl.beforeCurrent.key;
let beforeCurrentIndex = ctrl.beforeCurrent.index;
ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey, true);
ctrl.dataset.setCurrent(beforeCurrentKey, true);
} else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
$P.ctrl.dataset.setCurrent(info["CRDN_ID"], true);
ctrl.dataset.setCurrent(info["CRDN_ID"], true);
}
}
@ -607,34 +604,34 @@ $(document).ready(function(){
});
break;
case "sameVehicleInspection":
$P.alt.beforeCurrent = {
key : $P.alt.dataset.getCurrent()["CRDN_ID_LIST"],
index : $P.alt.dataset.getCurrent()["ROW_NUM"] - 1
alt.beforeCurrent = {
key : alt.dataset.getCurrent()["CRDN_ID_LIST"],
index : alt.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.alt).then((resp)=>{
Apply.toDataset.set($P.alt.dataset, resp);
$P.alt.dataset.onDatasetChange(resp, {reloaded : true});
Apply.fromDatasetControl.reload(alt).then((resp)=>{
Apply.toDataset.set(alt.dataset, resp);
alt.dataset.onDatasetChange(resp, {reloaded : true});
if($P.alt.beforeCurrent != null){
var beforeCurrentKey = $P.alt.beforeCurrent.key;
var beforeCurrentIndex = $P.alt.beforeCurrent.index;
$P.alt.beforeCurrent = null;
if(alt.beforeCurrent != null){
var beforeCurrentKey = alt.beforeCurrent.key;
var beforeCurrentIndex = alt.beforeCurrent.index;
alt.beforeCurrent = null;
if(!$P.alt.dataset.empty){
var info = $P.alt.dataset.getData(beforeCurrentKey);
if(!alt.dataset.empty){
var info = alt.dataset.getData(beforeCurrentKey);
if(info != null){
$P.alt.dataset.setCurrent(beforeCurrentKey,true);
alt.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.alt.dataset.length - 1)){
info = $P.alt.dataset.getDataset()[$P.alt.dataset.length - 1];
if(beforeCurrentIndex > (alt.dataset.length - 1)){
info = alt.dataset.getDataset()[alt.dataset.length - 1];
} else {
info = $P.alt.dataset.getDataset()[beforeCurrentIndex];
info = alt.dataset.getDataset()[beforeCurrentIndex];
}
$P.alt.dataset.setCurrent(info["CRDN_ID_LIST"],true);
alt.dataset.setCurrent(info["CRDN_ID_LIST"],true);
}
}
@ -649,7 +646,7 @@ $(document).ready(function(){
$P.fnExcelDown = async() => {
if($P.currentDisplay == "photoInspection"){
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
@ -658,13 +655,13 @@ $(document).ready(function(){
$P.$findn("photoInspection_Table_0").find("thead th").not(".dummy-th").not(":eq(0)"),
$($P.findn("photoInspectionRow").content).find("td").not(".dummy-td").not(":eq(0)")
);
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
} else {
if($P.alt.dataset.empty){
if(alt.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
@ -678,9 +675,9 @@ $(document).ready(function(){
$P.$findn("sameVehicleInspectionMain_Table_0").find("thead th").not(".dummy-th"),
$($P.findn("sameVehicleInspectionMainRow").content).find("td").not(".dummy-td")
);
$P.alt.query.cellDefs = cellDefs;
alt.query.cellDefs = cellDefs;
$P.alt.download();
alt.download();
} else if(excelTarget == "sub"){
var cellDefs = AppSupport.getCellDefs(
@ -688,9 +685,9 @@ $(document).ready(function(){
$($P.findn("sameVehicleInspectionSubRow").content).find("td").not(".dummy-td"),
FimsSupport.getCellDefsForPrivacyCell
);
$P.shift.query.cellDefs = cellDefs;
shift.query.cellDefs = cellDefs;
$P.shift.download();
shift.download();
}
}
@ -740,7 +737,7 @@ $(document).ready(function(){
switch (renderDataType) {
case "photoInspection":
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -749,7 +746,7 @@ $(document).ready(function(){
break;
case "sameVehicleInspectionMain":
var initScroll = ($P.alt.query.pageNum < 2);
var initScroll = (alt.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -775,11 +772,11 @@ $(document).ready(function(){
if(dataKey != ""){
$P.$findn("photoInspectionTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
var curDataVhrno = $P.ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.ctrl.getNext(dataKey);
var curDataVhrno = ctrl.dataset.getData(dataKey)["VHRNO"];
var nextData = ctrl.getNext(dataKey);
var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
@ -790,7 +787,7 @@ $(document).ready(function(){
}
$P.$findn("sameVehicleInspectionMainTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.alt.dataset, dataKey);
Apply.toDataset.current(alt.dataset, dataKey);
$P.searchDetailInspectionDataList(dataKey);
@ -801,7 +798,7 @@ $(document).ready(function(){
}
$P.$findn("sameVehicleInspectionSubTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.shift.dataset, dataKey);
Apply.toDataset.current(shift.dataset, dataKey);
break;
}
}
@ -885,9 +882,9 @@ $(document).ready(function(){
var info = "";
if ($P.currentDisplay == "photoInspection") {
info = $P.ctrl.dataset.getCurrent("item");
info = ctrl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") {
info = $P.shift.dataset.getCurrent("item");
info = shift.dataset.getCurrent("item");
} else {
return;
}
@ -945,7 +942,7 @@ $(document).ready(function(){
return;
}
var info = $P.ctrl.dataset.getCurrent("item");
var info = ctrl.dataset.getCurrent("item");
if (info == undefined || info == "") {
return;
@ -1036,8 +1033,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset()); //초기화버튼
$P.$findn("btnPhotoInspection").on('click', () => {
@ -1074,8 +1071,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("sameVehicleInspectionMain-responsive"), $P.scrollInspectionDataList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmSearch")); //달력 초기화
AppSupport.initDetailSearchButton($P.findn("frmSearch"));

@ -45,12 +45,13 @@ pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj.crdnInfo,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -59,19 +60,13 @@ $(document).ready(function(){
formats: {}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(ctrl,dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnSave = async() => {
var alertMessage = "";
@ -110,7 +105,7 @@ $(document).ready(function(){
}
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -138,7 +133,7 @@ $(document).ready(function(){
info.chgAmtSe = "0";
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -163,16 +158,18 @@ $(document).ready(function(){
}
}
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnSave").on("click", () => $P.fnSave() );
$P.$findn("btnRestore").on("click", () => $P.fnRestore() );
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var crdnInfo = ${crdnInfo};
$P.ctrl.dataset.setData([crdnInfo]);
ctrl.dataset.setData([crdnInfo]);
});

@ -134,9 +134,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl= $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -150,29 +150,26 @@ $(document).ready(function(){
BLNC : numberFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
};
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
@ -184,57 +181,57 @@ $(document).ready(function(){
$P.$findn("byOutput").val("동적 검색");
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.taskSeCd = "DPV";
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){
let beforeCurrentKey = $P.ctrl.beforeCurrent.key;
let beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null;
if(ctrl.beforeCurrent != null){
let beforeCurrentKey = ctrl.beforeCurrent.key;
let beforeCurrentIndex = ctrl.beforeCurrent.index;
ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
ctrl.dataset.setCurrent(info["CRDN_ID"],true);
}
}
}
@ -244,16 +241,16 @@ $(document).ready(function(){
$P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnTheadTr").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
}
$P.getGridTemplate = () => {
@ -274,7 +271,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -291,7 +288,7 @@ $(document).ready(function(){
}
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
@ -302,7 +299,7 @@ $(document).ready(function(){
}
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
@ -324,7 +321,7 @@ $(document).ready(function(){
}
$P.save = () => {
if(!$P.ctrl.dataset.getCurrent()) {
if(!ctrl.dataset.getCurrent()) {
dialog.alert({
content : "선택된 자료가 없습니다.",
init : function(){
@ -340,9 +337,9 @@ $(document).ready(function(){
AppSupport.focusOK();
},
onOK : () => {
var info = { 'crdnId' : $P.ctrl.dataset.getCurrent()["CRDN_ID"] };
var info = { 'crdnId' : ctrl.dataset.getCurrent()["CRDN_ID"] };
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -364,8 +361,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchCrdnList());
// 동적검색에서 엔터(Enter) 키를 누르면 검색한다.
@ -378,8 +375,8 @@ $(document).ready(function(){
$P.$findn("btnUpdateToConfirmData").on('click', () => $P.save());
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
//달력 초기화
AppSupport.initDatepicker($P.findn("frmSearch"));

@ -119,9 +119,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -131,42 +131,40 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
$P.ctrl.urls.newInfoByFile = "";
$P.ctrl.urls.newInfoByHand = "";
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.urls.newInfoByFile = "";
ctrl.urls.newInfoByHand = "";
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
$P.$findn("regDt").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do");
$P.ctrl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do");
$P.ctrl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn05/010/list.do");
ctrl.urls.newInfoByFile = wctx.url("/"+taskSeCd+"/crdn/crdn05/020/info.do");
ctrl.urls.newInfoByHand = wctx.url("/"+taskSeCd+"/crdn/crdn05/030/info.do");
switch(taskSeCd){
case "PVS" :
@ -186,21 +184,21 @@ $(document).ready(function(){
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.reload({all : true});
ctrl.reload({all : true});
}
@ -221,7 +219,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -240,13 +238,13 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.newInfo = (type) => {
var url = "";
if(type == "file") url = $P.ctrl.urls.newInfoByFile;
if(type == "hand") url = $P.ctrl.urls.newInfoByHand;
if(type == "file") url = ctrl.urls.newInfoByFile;
if(type == "hand") url = ctrl.urls.newInfoByHand;
let dialogName = "";
if(type == "file") dialogName = "fileDialog";
@ -277,8 +275,8 @@ $(document).ready(function(){
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on("click", () => $P.searchCrdnList());
$P.$findn("btnInsertByFile").on('click', () => { $P.newInfo("file"); });
@ -288,8 +286,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollCrdnList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmSearch")); //달력 초기화
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();

@ -173,9 +173,9 @@ $(document).ready(function(){
$P.tempGroup = {};
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"],
keymapper : info => info ? info.FILE_NAME : "",
urls : { },
@ -187,19 +187,16 @@ $(document).ready(function(){
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderParsedInfoList(obj["Total"], $P.ctrl.dataset.length, trs);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderParsedInfoList(obj["Total"], ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("parsedInfoPaging"), $P.findn("parsedInfoPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("parsedInfoPaging"), $P.findn("parsedInfoPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.$findn("imageArea").html("");
if(dataItem && dataItem.data){
@ -226,8 +223,8 @@ $(document).ready(function(){
};
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
//ftp체크
$P.checkFTP = () => {
@ -254,8 +251,8 @@ $(document).ready(function(){
}
//로컬파일업로드
$P.uploadLocalFile = () => {
//로컬파일업로드
$P.uploadLocalFile = () => {
if($P.$findn("uploadFiles").val() == ""){
dialog.alert({
@ -292,12 +289,12 @@ $(document).ready(function(){
}
});
}
}
//서버에 등록된 파일 조회
$P.searchFileList = () => {
$P.searchFileList = () => {
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
ajax.post({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/list.do"),
@ -305,16 +302,16 @@ $(document).ready(function(){
taskSeCd : $P.$findn("taskSeCd").val()
},
success : (resp) => {
$P.ctrl.dataset.setData(resp);
ctrl.dataset.setData(resp);
}
});
}
}
$P.getGridTemplate = () => {
var notFound = [$P.$findn("table-responsive").find("template.notFound")[0].innerHTML];
var found = $P.$findn("table-responsive").find("template.found")[0].innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
$P.getGridTemplate = () => {
var notFound = [$P.$findn("table-responsive").find("template.notFound")[0].innerHTML];
var found = $P.$findn("table-responsive").find("template.found")[0].innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
return {
found : found,
@ -322,10 +319,11 @@ $(document).ready(function(){
replacer : replacer
};
}
//테이블 렌더링
$P.renderParsedInfoList = (total, listLength, trs) => {
$P.$findn("table-responsive").find("tbody").html(trs);
//테이블 렌더링
$P.renderParsedInfoList = (total, listLength, trs) => {
$P.$findn("table-responsive").find("tbody").html(trs);
if(listLength != 0){
FimsSupport.fnDownsizeCheck($P.$findn("table-responsive").find("table")[0]);
@ -334,9 +332,9 @@ $(document).ready(function(){
}
//사진 표시
$P.renderImage = (src) => {
$P.renderImage = (src) => {
if(Array.isArray(src)){
if(Array.isArray(src)){
var div = document.createElement("div");
div.style["margin-top"] = "20px";
div.style["margin-bottom"] = "20px";
@ -354,22 +352,22 @@ $(document).ready(function(){
div.appendChild(span);
}
$P.$findn("imageArea").append(div);
} else {
} else {
var img = document.createElement("img");
img.style["object-fit"] = "contain";
img.src = src;
$P.$findn("imageArea").append(img);
}
}
}
}
$P.clickParsedInfoList = (dataKey) => {
if(dataKey == ""){
return;
}
$P.ctrl.dataset.setCurrent(dataKey);
ctrl.dataset.setCurrent(dataKey);
};
$P.createCrdn = () => {
@ -425,7 +423,7 @@ $(document).ready(function(){
};
$P.deleteFile = () => {
var current = $P.ctrl.dataset.getCurrent();
var current = ctrl.dataset.getCurrent();
if(current == null) return;
var fileName = current.FILE_NAME;
@ -447,7 +445,7 @@ $(document).ready(function(){
}
$P.removeCallback = (removedFileName) => {
$P.ctrl.dataset.remove(removedFileName);
ctrl.dataset.remove(removedFileName);
$P.removeTableRow(removedFileName);
}
@ -472,14 +470,14 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnSearch").on("click", function(){ $P.checkFTP(); });
$P.$findn("btnFileUpload").on("click", function(){ $P.uploadLocalFile(); });
$P.$findn("btnInsertCrdn").on("click", function(){
$P.tempGroup = Object.groupBy($P.ctrl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID);
$P.tempGroup = Object.groupBy(ctrl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID);
if($.isEmptyObject($P.tempGroup)){
alert("처리할 자료가 없습니다.");
@ -504,7 +502,7 @@ $(document).ready(function(){
}
});
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
});
</script>

@ -366,7 +366,7 @@
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
@ -376,13 +376,13 @@ $(document).ready(function(){
$P.localUploadArr = [];
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.uploadSet = uploadSupport($P.selectorn("inputUploadSet"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData : true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -393,9 +393,6 @@ $(document).ready(function(){
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.uploadSet.onDatasetChange = () => {
var files = $P.uploadSet.getDataset();
files.forEach(item => $P.localUploadArr.push(item));
@ -405,8 +402,8 @@ $(document).ready(function(){
$P.uploadSet.onRemove = () => { };
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnMakeImgForNewFile = (fileArr) => {
var tagsText = "";
@ -479,7 +476,7 @@ $(document).ready(function(){
}
ajax.post({
url : $P.ctrl.urls.create,
url : ctrl.urls.create,
data : formData, contentType : false, processData : false,
success : (resp) => {
$P.saveCallback(resp);
@ -519,15 +516,15 @@ $(document).ready(function(){
}
/**************************************************************************
* 초기화(업무별 입력항목)
**************************************************************************/
* 초기화(업무별 입력항목)
**************************************************************************/
var clsForTask = $P.$findn("taskSeCd").val().toLowerCase();
//업무별 입력 항목
FimsSupport.renderForTask($P.findn("frmEdit"), clsForTask);
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnInst").on('click', () => $P.fnSave());
@ -704,8 +701,8 @@ $(document).ready(function(){
});
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmEdit")); //달력 초기화
$P.$findn("frmEdit").find(".form-date").each(function(){
@ -736,7 +733,7 @@ $(document).ready(function(){
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
$P.ctrl.dataset.append({});
ctrl.dataset.append({});
});
</script>

@ -279,8 +279,11 @@
</div>
<div class="content-backdrop fade"></div>
<span name="ctrl"></span>
</div>
<script>
/**************************************************************************
@ -295,14 +298,15 @@ var FIM034 = new CommonCodes(${FIM034});
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -319,33 +323,33 @@ $(document).ready(function(){
LEVY_EXCL_YMD : dateFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
}
$P.ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnSendCrdn"), selectedArr);
ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox(ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnSendCrdn"), selectedArr);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
@ -358,13 +362,13 @@ $(document).ready(function(){
$P.$findn("schRgtrNm").prop("readonly", true); // 사용자 이름
$P.$findn("schCrdnYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365));
$P.$findn("schCrdnYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn06/010/list.do");
ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
var clsForTask = taskSeCd.toLowerCase();
@ -396,43 +400,43 @@ $(document).ready(function(){
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.reload({all : true});
ctrl.reload({all : true});
}
$P.fnExcelDown = (forApproval) => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
if(forApproval){
$P.ctrl.query.includePhoto = "Y";
ctrl.query.includePhoto = "Y";
} else {
$P.ctrl.query.includePhoto = "N";
ctrl.query.includePhoto = "N";
}
$P.ctrl.download();
ctrl.download();
$P.ctrl.query.includePhoto = null;
ctrl.query.includePhoto = null;
};
$P.checkCrdnList = (element, bool) => {
@ -441,7 +445,7 @@ $(document).ready(function(){
var atLeastOne = GRID.checkbox.countChecked(element) > 0;
$P.$findn("btnSendCrdn").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.ctrl.dataset, element, bool);
Apply.toDataset.selection(ctrl.dataset, element, bool);
}
$P.getGridTemplate = () => {
@ -469,7 +473,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -486,7 +490,7 @@ $(document).ready(function(){
}
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
@ -496,7 +500,7 @@ $(document).ready(function(){
};
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
let dialogName = "totalInfoMainDialog";
@ -517,10 +521,10 @@ $(document).ready(function(){
}
$P.fnSendCrdn = () => {
var datas = $P.ctrl.dataset.getDataset("selected");
var datas = ctrl.dataset.getDataset("selected");
var taskSeCd = datas[0].TASK_SE_CD;
var keys = $P.ctrl.dataset.getKeys("selected");
var keys = ctrl.dataset.getKeys("selected");
var url = "";
if(taskSeCd == "PVS"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do";
@ -589,8 +593,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchCrdnList());
$P.$findn("btnExcel").on('click', () => $P.fnExcelDown(false));
@ -604,8 +608,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollCrdnList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmSearch")); //달력 초기화
AppSupport.initDetailSearchButton($P.findn("frmSearch"));

@ -215,273 +215,272 @@
<!-- / inner page html <div class="content-pop"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}";
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
prefix: "crdn"
, prefixName: "단속"
, keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.crdnInfo
});
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
$P.control.onCurrentChange = (item) => {
if (!item) return;
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}";
// 1. 업무별 입력 항목
$P.fnRenderTask(item.data.TASK_SE_CD);
/**************************************************************************
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
// 2. Dataset 셋팅
$P.formFields.set($P.control, item);
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
// 3. 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
var ctrl = $P.ctrl = new DatasetControl({
prefix: "crdn"
, prefixName: "단속"
, keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.crdnInfo
});
// 저장 callback
$P.control.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
ctrl.onCurrentChange = (item) => {
if (!item) return;
dialog.alert({
content: showMessage
, init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
// 1. 업무별 입력 항목
$P.fnRenderTask(item.data.TASK_SE_CD);
if (resp.saved) {
dialog.close($P.selfDlgId());
}
}
// 2. Dataset 셋팅
$P.formFields.set(ctrl, item);
// 저장
$P.control.save = (info) => {
if (!info) return;
// 3. 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
ajax.post({
url: $P.control.urls.update
, data: info || {}
, success: resp => $P.control.onSave(resp)
});
}
// 저장 callback
ctrl.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무별 입력 항목
$P.fnRenderTask = (taskSeCd) => {
if (taskSeCd == undefined || taskSeCd == null || taskSeCd == "") {
taskSeCd = $P.$findn("taskSeCd").val();
dialog.alert({
content: showMessage
, init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
FimsSupport.renderForTask($P.findn("frmEdit"), taskSeCd.toLowerCase());
if (resp.saved) {
dialog.close($P.selfDlgId());
}
}
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/update.do"); // 수정
}
// 저장
ctrl.save = (info) => {
if (!info) return;
// 차적 조회
$P.fnGetVehicle = (params) => {
if (!params) return;
json.post({
url: wctx.url("/payer/vehicle.do")
, data: params || {}
, success: resp => {
// 항목 초기화
$P.$findn("vin").val("");
$P.$findn("vhclNm").val("");
$P.$findn("vhclColr").val("");
$P.$findn("useFuelCd").val("");
$P.$findn("ffnlgCarmdlCd").val("");
ajax.post({
url: ctrl.urls.update
, data: info || {}
, success: resp => ctrl.onSave(resp)
});
}
if (!resp.found) {
dialog.alert({
content: "차량 정보가 없습니다.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
return;
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무별 입력 항목
$P.fnRenderTask = (taskSeCd) => {
if (taskSeCd == undefined || taskSeCd == null || taskSeCd == "") {
taskSeCd = $P.$findn("taskSeCd").val();
}
let vehicle = resp.vehicle;
// 단속(TB_CRDN) - 공통 항목
$P.$findn("vin").val(vehicle.vin); // 차대번호
$P.$findn("vhclNm").val(vehicle.cnm); // 차량명
$P.$findn("vhclColr").val(vehicle.color_nm); // 차량색상
// 단속 부가 정보(TB_CRDN_ADI) - 사용 연료 코드
$P.$findn("useFuelCd").val(vehicle.use_fuel_code);
// 단속 부가 정보(TB_CRDN_ADI) - 과태료 차종 코드
if (vehicle.vhcty_asort_code == "1") { // 승용
$P.$findn("ffnlgCarmdlCd").val("11");
} else if (vehicle.vhcty_asort_code == "2") { // 승합
$P.$findn("ffnlgCarmdlCd").val("12");
} else if (vehicle.vhcty_asort_code == "3") { // 화물
if(vehicle.mxmm_ldg <= 4000){
$P.$findn("ffnlgCarmdlCd").val("13");
} else {
$P.$findn("ffnlgCarmdlCd").val("14");
FimsSupport.renderForTask($P.findn("frmEdit"), taskSeCd.toLowerCase());
}
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
ctrl.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/update.do"); // 수정
}
// 차적 조회
$P.fnGetVehicle = (params) => {
if (!params) return;
json.post({
url: wctx.url("/payer/vehicle.do")
, data: params || {}
, success: resp => {
// 항목 초기화
$P.$findn("vin").val("");
$P.$findn("vhclNm").val("");
$P.$findn("vhclColr").val("");
$P.$findn("useFuelCd").val("");
$P.$findn("ffnlgCarmdlCd").val("");
if (!resp.found) {
dialog.alert({
content: "차량 정보가 없습니다.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
} else if (vehicle.vhcty_asort_code == "4") { // 특수
$P.$findn("ffnlgCarmdlCd").val("15");
} else {
$P.$findn("ffnlgCarmdlCd").val("");
}
});
return;
}
});
}
// 차적 조회
$P.fnVehicle = (title) => {
let crdnYmd = $P.$findn("crdnYmd").val().replaceAll("-", "");
let vhrno = $P.$findn("vhrno").val();
// 단속일자
if (crdnYmd == "") {
dialog.alert({
content: "단속일자를 입력하세요.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
},
onClose : function() { $P.$findn("crdnYmd").focus(); }
});
return;
}
// 차량번호
if (vhrno == "") {
dialog.alert({
content: "차량번호를 입력하세요.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
},
onClose : function() { $P.$findn("vhrno").focus(); }
});
return;
}
let vehicle = resp.vehicle;
let params = {
inqire_se_code : "3"
, sggCd: $P.$findn("sggCd").val()
, levy_stdde: crdnYmd
, vhrno: vhrno
}
// 단속(TB_CRDN) - 공통 항목
$P.$findn("vin").val(vehicle.vin); // 차대번호
$P.$findn("vhclNm").val(vehicle.cnm); // 차량명
$P.$findn("vhclColr").val(vehicle.color_nm); // 차량색상
$P.fnGetVehicle(params);
}
// 단속 부가 정보(TB_CRDN_ADI) - 사용 연료 코드
$P.$findn("useFuelCd").val(vehicle.use_fuel_code);
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장
$P.fnSave = () => {
// validate 확인
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
// 단속 부가 정보(TB_CRDN_ADI) - 과태료 차종 코드
if (vehicle.vhcty_asort_code == "1") { // 승용
$P.$findn("ffnlgCarmdlCd").val("11");
} else if (vehicle.vhcty_asort_code == "2") { // 승합
$P.$findn("ffnlgCarmdlCd").val("12");
} else if (vehicle.vhcty_asort_code == "3") { // 화물
if(vehicle.mxmm_ldg <= 4000){
$P.$findn("ffnlgCarmdlCd").val("13");
} else {
$P.$findn("ffnlgCarmdlCd").val("14");
}
} else if (vehicle.vhcty_asort_code == "4") { // 특수
$P.$findn("ffnlgCarmdlCd").val("15");
} else {
$P.$findn("ffnlgCarmdlCd").val("");
}
}
});
}
// 단속 ID
let crdnId = $P.control.dataset.getValue("CRDN_ID");
// 단속 ID 가 없다면.. return
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
// 차적 조회
$P.fnVehicle = (title) => {
let crdnYmd = $P.$findn("crdnYmd").val().replaceAll("-", "");
let vhrno = $P.$findn("vhrno").val();
// 단속일자
if (crdnYmd == "") {
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: function() {
content: "단속일자를 입력하세요.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusOK();
}, onOK: () => {
$P.control.save($P.formFields.get()); // formFields
}
AppSupport.focusClose();
},
onClose : function() { $P.$findn("crdnYmd").focus(); }
});
return;
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$P.$findn("frmEdit").find(".form-date").each(function() {
$(this).on("input",function() {
let value = this.value.replaceAll("-", "");
if (value.length > 7) {
this.value = value.substring(0,4) + "-" + value.substring(4,6) + "-" + value.substring(6);
} else if(value.length > 5) {
this.value = value.substring(0,4) + "-" + value.substring(4);
}
});
// 차량번호
if (vhrno == "") {
dialog.alert({
content: "차량번호를 입력하세요.",
init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
},
onClose : function() { $P.$findn("vhrno").focus(); }
});
$P.$findn("frmEdit").find(".form-time").each(function() {
$(this).on("input",function() {
let value = this.value.replaceAll(":", "");
if (value.length > 5) {
this.value = value.substring(0,2) + ":" + value.substring(2,4) + ":" + value.substring(4);
} else if (value.length > 3) {
this.value = value.substring(0,2) + ":" + value.substring(2);
}
return;
}
let params = {
inqire_se_code : "3"
, sggCd: $P.$findn("sggCd").val()
, levy_stdde: crdnYmd
, vhrno: vhrno
}
$P.fnGetVehicle(params);
}
});
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장
$P.fnSave = () => {
// validate 확인
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
// 단속 ID
let crdnId = ctrl.dataset.getValue("CRDN_ID");
// 단속 ID 가 없다면.. return
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
dialog.alert({
content: "현재 " + ctrl.prefixName + " 정보를 저장하시겠습니까?"
, init: function() {
AppSupport.setDialogZindex();
AppSupport.focusOK();
}, onOK: () => {
ctrl.save($P.formFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$P.$findn("frmEdit").find(".form-date").each(function() {
$(this).on("input",function() {
let value = this.value.replaceAll("-", "");
if (value.length > 7) {
this.value = value.substring(0,4) + "-" + value.substring(4,6) + "-" + value.substring(6);
} else if(value.length > 5) {
this.value = value.substring(0,4) + "-" + value.substring(4);
}
});
});
$P.$findn("frmEdit").find(".form-time").each(function() {
$(this).on("input",function() {
let value = this.value.replaceAll(":", "");
if (value.length > 5) {
this.value = value.substring(0,2) + ":" + value.substring(2,4) + ":" + value.substring(4);
} else if (value.length > 3) {
this.value = value.substring(0,2) + ":" + value.substring(2);
}
// 차량번호 엔터 이벤트
$P.$findn("vhrno").onEnterPress(function() {
$P.fnVehicle("차적 조회");
});
});
// 버튼 이벤트
$P.$findn("btnVehicle").on("click", () => $P.fnVehicle()); // 차량번호 조회
$P.$findn("btnSave").on("click", () => $P.fnSave()); // 저장
}
// 차량번호 엔터 이벤트
$P.$findn("vhrno").onEnterPress(function() {
$P.fnVehicle("차적 조회");
});
// 초기 화면 설정
$P.initForm = () => {
// 달력 초기화
AppSupport.initDatepicker($P.findn("frmEdit"));
$P.$findn("crdnYmd").datepicker("setDate", TODAY());
}
// 버튼 이벤트
$P.$findn("btnVehicle").on("click", () => $P.fnVehicle()); // 차량번호 조회
$P.$findn("btnSave").on("click", () => $P.fnSave()); // 저장
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 초기 화면 설정
$P.initForm = () => {
// 달력 초기화
AppSupport.initDatepicker($P.findn("frmEdit"));
$P.$findn("crdnYmd").datepicker("setDate", TODAY());
}
// 2. 초기 화면 설정
$P.initForm();
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 3. Dataset 설정
$P.control.setData([${crdnInfo}]);
});
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
ctrl.setData([${crdnInfo}]);
});
</script>

@ -57,128 +57,126 @@
<!-- / inner page html <div class="content-pop"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
var $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}";
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}";
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
prefix: "crdnSttsCd"
, prefixName: "단속처리상태"
, keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.${infoPrefix}Info
});
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
var ctrl = $P.ctrl = new DatasetControl({
prefix: "crdnSttsCd"
, prefixName: "단속처리상태"
, keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj.${infoPrefix}Info
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) return;
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
if (!item) return;
// Dataset 셋팅
$P.formFields.set($P.control, item);
// Dataset 셋팅
$P.formFields.set(ctrl, item);
// 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
// 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
// 저장 callback
$P.control.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
dialog.alert({
content: showMessage
, init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
if (resp.saved) {
dialog.close($P.selfDlgId());
}
}
// 저장 callback
ctrl.onSave = (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 저장
$P.control.save = (info) => {
if (!info) return;
dialog.alert({
content: showMessage
, init: function() {
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
ajax.post({
url: $P.control.urls.update
, data: info || {}
, success: resp => $P.control.onSave(resp)
});
if (resp.saved) {
dialog.close($P.selfDlgId());
}
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/030/update.do"); // 수정
}
// 저장
ctrl.save = (info) => {
if (!info) return;
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장 버튼 클릭 이벤트
$P.fnSave = (title) => {
// validate 확인
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: function() {
AppSupport.focusOK();
}
, onOK: () => {
$P.control.save($P.formFields.get()); // formFields
}
});
}
ajax.post({
url: ctrl.urls.update
, data: info || {}
, success: resp => ctrl.onSave(resp)
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 버튼 이벤트
$P.$findn("btnSave").on("click", () => $P.fnSave()); // 저장
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
ctrl.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/030/update.do"); // 수정
}
// 초기 화면 설정
$P.initForm = () => {
//
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장 버튼 클릭 이벤트
$P.fnSave = (title) => {
// validate 확인
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + ctrl.prefixName + " 정보를 저장하시겠습니까?"
, init: function() {
AppSupport.focusOK();
}
, onOK: () => {
ctrl.save($P.formFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 버튼 이벤트
$P.$findn("btnSave").on("click", () => $P.fnSave()); // 저장
}
// 초기 화면 설정
$P.initForm = () => {
//
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
$P.control.setData([${crdnSttsCdInfo}]);
});
// 3. Dataset 설정
ctrl.setData([${crdnSttsCdInfo}]);
});
</script>

@ -241,10 +241,10 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
var FIM071 = new CommonCodes(${FIM071});
var FIM002 = new CommonCodes(${FIM002});
@ -253,10 +253,10 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
//사용중인 팀
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:false,
keymapper : info => info ? info.TEAM_ID : "",
urls : {
@ -270,39 +270,17 @@ $(document).ready(function(){
DEL_DT : datetimeFormat
}
});
//삭제된 팀
$P.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "",
urls : { },
formats: {
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("useTeam");
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderUseTeamList(obj["Total"], $P.ctrl.dataset.length, trs);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("useTeamPaging"), $P.findn("useTeamPagingInfo"));
};
$P.alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody($P.alt.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], $P.alt.dataset.length, trs);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderUseTeamList(obj["Total"], ctrl.dataset.length, trs);
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("useTeamPaging"), $P.findn("useTeamPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
ctrl.dataset.onCurrentChange = (dataItem) => {
if(!dataItem){
$P.$findn("teamNm").val("");
$P.$findn("crdnSeCd").val("");
@ -314,7 +292,7 @@ $(document).ready(function(){
return;
}
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("useTeamTbody"));
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("useTeamTbody"));
$P.$findn("teamNm").val(dataItem.data.TEAM_NM);
$P.$findn("crdnSeCd").val(dataItem.data.CRDN_SE_CD);
@ -328,30 +306,48 @@ $(document).ready(function(){
}
/**************************************************************************
* pageObject.function
**************************************************************************/
//삭제된 팀
var alt = $P.alt = new DatasetControl({
dataGetter : obj => obj["List"], appendData: false,
keymapper : info => info ? info.TEAM_ID : "",
urls : { },
formats: {
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat
}
});
alt.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("delTeam");
var trs = Apply.fromDataset.getTbody(alt.dataset, t.found, t.notFound, t.replacer);
$P.renderDelTeamList(obj["Total"], alt.dataset.length, trs);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
var editForm = $P.$findn("frmEdit");
editForm.find("input[type='text']").val("");
editForm.find("input[type='hidden']").val("");
$P.alt.dataset.setData([]);
alt.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do");
$P.ctrl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/list.do");
ctrl.urls.remove = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/remove.do");
ctrl.urls.save = wctx.url("/"+taskSeCd+"/crdn/crdn07/010/save.do");
}
$P.getParams = () => {
@ -363,16 +359,16 @@ $(document).ready(function(){
$P.searchUseTeamList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.refreshUseTeamList = () => {
if($P.ctrl.query.pageNum == null){
$P.ctrl.query.pageNum = 1;
if(ctrl.query.pageNum == null){
ctrl.query.pageNum = 1;
}
$P.ctrl.load(1);
ctrl.load(1);
}
$P.getGridTemplate = (gridType) => {
@ -410,7 +406,7 @@ $(document).ready(function(){
}
$P.clickUseTeamList = (dataKey) => {
$P.ctrl.dataset.setCurrent(dataKey);
ctrl.dataset.setCurrent(dataKey);
}
$P.fnSave = () => {
@ -420,7 +416,7 @@ $(document).ready(function(){
data.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.save,
url : ctrl.urls.save,
data : data,
success : (resp) => {
if(resp.saved){
@ -431,9 +427,9 @@ $(document).ready(function(){
}
$P.fnRemove = () => {
var dataKey = $P.ctrl.dataset.getCurrent()["TEAM_ID"];
var dataKey = ctrl.dataset.getCurrent()["TEAM_ID"];
ajax.get({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : {
"teamId" : dataKey
},
@ -459,7 +455,7 @@ $(document).ready(function(){
},
success:(resp) => {
$P.alt.dataset.setData(resp);
alt.dataset.setData(resp);
}
});
@ -467,8 +463,8 @@ $(document).ready(function(){
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on("click", () => $P.searchUseTeamList());

@ -124,19 +124,19 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
* Global Variable
**************************************************************************/
*
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
urls : {
@ -153,71 +153,69 @@ $(document).ready(function(){
DEL_DT : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("exmptnVhclPaging"), $P.findn("exmptnVhclPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("exmptnVhclPaging"), $P.findn("exmptnVhclPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("exmptnVhclTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("exmptnVhclTbody"));
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.taskSeCd = "BPV";
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchExmptnVhclList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollExmptnVhclList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshExmptnVhclList = () => {
if($P.ctrl.query.pageNum == null){
$P.ctrl.query.pageNum = 1;
if(ctrl.query.pageNum == null){
ctrl.query.pageNum = 1;
}
$P.ctrl.reload({all : true});
ctrl.reload({all : true});
}
$P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("exmptnVhclTheadTr").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("exmptnVhclRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
}
$P.getGridTemplate = () => {
@ -237,7 +235,7 @@ $(document).ready(function(){
$P.renderExmptnVhclList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -255,7 +253,7 @@ $(document).ready(function(){
return;
}
if($P.ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){
if(ctrl.dataset.getData(dataKey)["DEL_YN"] == "N"){
$P.$findn("btnOpenDelRsn").prop("disabled", false);
} else {
$P.$findn("btnOpenDelRsn").prop("disabled", true);
@ -264,14 +262,14 @@ $(document).ready(function(){
$P.$findn("exmptnVhclTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickExmptnVhclList = (dataKey) => {
if(dataKey == ""){
return;
}
var data = $P.ctrl.dataset.getData(dataKey);
var data = ctrl.dataset.getData(dataKey);
if(data.DEL_YN == "Y"){
dialog.alert({
content : "삭제된 자료입니다.",
@ -286,7 +284,7 @@ $(document).ready(function(){
$P.getInfo = (param) => {
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data: param,
success:(resp) => {
let dialogName = "exmptnvhclDialog";
@ -321,7 +319,7 @@ $(document).ready(function(){
$P.newInfo = () => {
ajax.get({
url : $P.ctrl.urls.newInfo,
url : ctrl.urls.newInfo,
data: {},
success:(resp) => {
let dialogName = "exmptnvhclDialog";
@ -382,9 +380,9 @@ $(document).ready(function(){
}
$P.fnRemove = (reason) => {
var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
var dataKey = ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : {
"exmptnVhclId" : dataKey,
"delRsn" : reason
@ -398,7 +396,7 @@ $(document).ready(function(){
};
$P.fnOpenHistory = () => {
var dataKey = $P.ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
var dataKey = ctrl.dataset.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({
url : wctx.url("/BPV/crdn/crdn08/030/list.do"),
@ -428,8 +426,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on("click", () => $P.searchExmptnVhclList());
$P.$findn("btnExcel").on('click', () => $P.fnExcelDown());
@ -442,8 +440,8 @@ $(document).ready(function(){
Componentization.fnMakeResizableTable($P.findn("table-responsive"));
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmSearch")); //달력 초기화
$P.fnReset();

@ -68,10 +68,10 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"].provided = {};
pageObject.childReq = [];
@ -90,11 +90,11 @@ $(document).ready(function(){
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj.exmptnVhclInfo,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
urls : {
@ -107,10 +107,10 @@ $(document).ready(function(){
});
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.setInfo = (item) => {
$P.formFields.set($P.ctrl, item);
$P.formFields.set(ctrl, item);
var create = isEmpty(item.EXMPTN_VHCL_ID);
$P.$findn("vhrno").prop("readonly", !create);
@ -130,7 +130,7 @@ $(document).ready(function(){
var create = isEmpty(info.exmptnVhclId);
ajax.post({
url : !create ? $P.ctrl.urls.update : $P.ctrl.urls.create,
url : !create ? ctrl.urls.update : ctrl.urls.create,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -155,13 +155,13 @@ $(document).ready(function(){
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnSave").on('click', () => $P.fnSave());
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmEdit")); //달력 초기화
$P.$findn("frmEdit").find(".form-date").each(function(){

@ -73,9 +73,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj, appendData:false,
keymapper : info => info ? info.HSTRY_SN : "",
urls : { },
@ -89,19 +89,15 @@ $(document).ready(function(){
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], $P.ctrl.dataset.length, trs);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderExmptnVhclList(obj["Total"], ctrl.dataset.length, trs);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.getGridTemplate = () => {
var notFound = [$P.findn("exmptnVhclNotFound").innerHTML];
@ -124,6 +120,6 @@ $(document).ready(function(){
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
$P.ctrl.dataset.setData(list);
ctrl.dataset.setData(list);
});
</script>

@ -223,8 +223,8 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
* Global Variable
**************************************************************************/
var FIM026 = new CommonCodes(${FIM026});
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
@ -241,9 +241,9 @@ $(document).ready(function(){
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -257,24 +257,21 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
if(!dataItem){
$P.$findn("bottomCrdnPlc").val("");
@ -298,8 +295,8 @@ $(document).ready(function(){
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
$P.holdList = [];
$P.$findn("btnOpenCvlcptOrgnl").show();
@ -317,20 +314,20 @@ $(document).ready(function(){
searchForm.find("[name='schCvlcptRcptYmdFrom']").datepicker('setDate', DateSupport.getAddDay(-5475));
searchForm.find("[name='schCvlcptRcptYmdTo']").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do");
$P.ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/list.do");
ctrl.urls.getInfo = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/020/info.do");
ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
@ -341,45 +338,45 @@ $(document).ready(function(){
$P.$findn("btnDelete").show();
$P.$findn("btnDeleteSameRcptYmd").show();
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null;
if(ctrl.beforeCurrent != null){
var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = ctrl.beforeCurrent.index;
ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
ctrl.dataset.setCurrent(info["CRDN_ID"],true);
}
}
}
@ -395,16 +392,16 @@ $(document).ready(function(){
}
$P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
}
$P.getGridTemplate = () => {
@ -424,7 +421,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -448,7 +445,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey);
$P.$findn("bottomCrdnPlc").val($P.ctrl.dataset.getData(dataKey)["CRDN_PLC"]);
$P.$findn("bottomCrdnPlc").val(ctrl.dataset.getData(dataKey)["CRDN_PLC"]);
if($P.holdList.includes(dataKey)){
$P.$findn("btnOpenCvlcptOrgnl").hide();
@ -460,7 +457,7 @@ $(document).ready(function(){
$P.$findn("btnDeleteSameRcptYmd").show();
}
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
@ -470,7 +467,7 @@ $(document).ready(function(){
}
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : {
"crdnId" : dataKey
},
@ -514,7 +511,7 @@ $(document).ready(function(){
$P.fnHold = () => {
var curKey = $P.ctrl.dataset.getCurrent()["CRDN_ID"];
var curKey = ctrl.dataset.getCurrent()["CRDN_ID"];
if($P.holdList.includes(curKey)){
return;
}
@ -529,7 +526,7 @@ $(document).ready(function(){
$P.fnRemove = (rcptYmd) => {
if(rcptYmd != null){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var crdnIds = [];
@ -544,18 +541,18 @@ $(document).ready(function(){
crdnIds.push(filtered[i].CRDN_ID);
}
$P.ctrl.dataset.select(crdnIds,true);
ctrl.dataset.select(crdnIds,true);
} else {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
var curKey = cur["CRDN_ID"];
$P.ctrl.dataset.select(curKey,true);
ctrl.dataset.select(curKey,true);
}
var selected = $P.ctrl.dataset.getKeys("selected");
var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
}
@ -565,7 +562,7 @@ $(document).ready(function(){
};
ajax.post({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : params,
success : (resp) => {
$P.removeCallback(resp);
@ -581,7 +578,7 @@ $(document).ready(function(){
};
$P.fnRemoveSameRcptYmd = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
@ -599,7 +596,7 @@ $(document).ready(function(){
}
$P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
@ -643,12 +640,12 @@ $(document).ready(function(){
$P.provide = {
"getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length;
},
"getNextKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
if($P.holdList.includes(ds[index+1]["CRDN_ID"])){
@ -661,7 +658,7 @@ $(document).ready(function(){
}
},
"getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
if($P.holdList.includes(ds[index-1]["CRDN_ID"])){
@ -683,7 +680,7 @@ $(document).ready(function(){
$P.refreshCrdnList();
},
"hasData" : function(key){
if($P.ctrl.dataset.getData(key) == null){
if(ctrl.dataset.getData(key) == null){
return false;
} else {
return true;
@ -692,8 +689,8 @@ $(document).ready(function(){
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchCrdnList());
$P.$findn("btnExcel").on('click', () => $P.fnExcelDown());
@ -711,8 +708,8 @@ $(document).ready(function(){
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
//달력 초기화
AppSupport.initDatepicker($P.findn("frmSearch"));
AppSupport.initDetailSearchButton($P.findn("frmSearch"));

@ -387,11 +387,10 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
pageObject["${pageName}"].provided = {};
pageObject.childReq = [];
@ -418,11 +417,11 @@ $(document).ready(function(){
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter:obj => obj.crdnInfo,
keymapper:info => info ? info.CRDN_ID : "",
urls : {
@ -436,18 +435,14 @@ $(document).ready(function(){
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(ctrl,dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.openLevyExclPop = (levyExclSeCd) => {
@ -515,7 +510,7 @@ $(document).ready(function(){
}
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -586,7 +581,7 @@ $(document).ready(function(){
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.ctrl.urls.getInfo,
url: ctrl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
@ -594,7 +589,7 @@ $(document).ready(function(){
success : (resp) => {
var crdnInfo = resp.crdnInfo;
crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([crdnInfo]);
ctrl.dataset.setData([crdnInfo]);
$P.$findn("btnViewCrdnList").attr("hidden","hidden");
$P.$findn("btnViewCvlcptDscsnList").attr("hidden","hidden");
@ -623,7 +618,7 @@ $(document).ready(function(){
if(await confirm2("현 자료의 복사본을 생성하시겠습니까?")){
ajax.get({
url : $P.ctrl.urls.create,
url : ctrl.urls.create,
data : { crdnId : crdnId },
success : (resp) => {
if (resp.saved) {
@ -837,7 +832,7 @@ $(document).ready(function(){
var crdnId = $P.$findn("crdnId").val();
ajax.post({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : { crdnId : crdnId },
success : (resp) => {
if(resp.saved){
@ -1189,8 +1184,8 @@ $(document).ready(function(){
});
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
AppSupport.initDatepicker($P.findn("frmEdit")); //달력 초기화
$P.$findn("frmEdit").find(".form-time").each(function(){
@ -1211,7 +1206,7 @@ $(document).ready(function(){
var crdnInfo = ${crdnInfo};
crdnInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(crdnInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([crdnInfo]);
ctrl.dataset.setData([crdnInfo]);
if($P.$findn("taskSeCd").val() == "DPV" && $P.$findn("vltnCd").val() == "01"){
$P.$findn("dstrbncYn").show();

@ -114,11 +114,11 @@ $(document).ready(function() {
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter:obj => obj.cvlcptInfo,
keymapper:info => info ? info.CRDN_ID : "",
urls : {
@ -131,15 +131,15 @@ $(document).ready(function() {
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
* Dataset.on
**************************************************************************/
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(ctrl,dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnPrev = () => {
var prevKey = $P.provided.getPrevKey($P.$findn("crdnId").val());
@ -157,7 +157,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.ctrl.urls.getInfo,
url: ctrl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
@ -165,7 +165,7 @@ $(document).ready(function() {
success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]);
ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs);
@ -182,18 +182,18 @@ $(document).ready(function() {
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnPrev").on("click", () => $P.fnPrev() );
$P.$findn("btnNext").on("click", () => $P.fnNext() );
$P.$findn("btnMakeHwp").on("click", () => $P.fnMakeHwp() );
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]);
ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.provided.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs);
});

@ -247,9 +247,9 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -263,36 +263,33 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
}
$P.ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnExecuteAnswer"), selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnAnswerComplete"), selectedArr);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnExecuteDisabledTagInfoInquire"), selectedArr);
ctrl.dataset.onSelectionChange = (selectedArr) => {
Apply.fromDataset.gridCheckbox(ctrl.dataset, $P.findn("crdnTbody"), 1, selectedArr);
Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnExecuteAnswer"), selectedArr);
Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnAnswerComplete"), selectedArr);
Apply.fromDataset.gridButton(ctrl.dataset, $P.findn("btnExecuteDisabledTagInfoInquire"), selectedArr);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
@ -305,7 +302,7 @@ $(document).ready(function(){
$P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-31));
$P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = taskSeCd => {
@ -317,53 +314,53 @@ $(document).ready(function(){
$P.$findn("btnExecuteDisabledTagInfoInquire").on("click", () => $P.fnExecuteDisabledTagInfoInquire());
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/list.do");
ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc02/030/update.do");
ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.reload({all : true});
ctrl.reload({all : true});
}
$P.fnExcelDown = (forApproval) => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
if(forApproval){
$P.ctrl.query.includePhoto = "Y";
ctrl.query.includePhoto = "Y";
} else {
$P.ctrl.query.includePhoto = "N";
ctrl.query.includePhoto = "N";
}
$P.ctrl.download();
ctrl.download();
$P.ctrl.query.includePhoto = null;
ctrl.query.includePhoto = null;
};
@ -384,7 +381,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -398,7 +395,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").find("tr[data-key]").each(function(item){
var crdnId = this.dataset.key;
var data = $P.ctrl.dataset.getData(crdnId);
var data = ctrl.dataset.getData(crdnId);
if(data.COPY_EXIST_YN == "Y"){
$(this).addClass("text-red");
@ -418,7 +415,7 @@ $(document).ready(function(){
$P.$findn("btnAnswerComplete").prop("disabled", !atLeastOne);
$P.$findn("btnExecuteDisabledTagInfoInquire").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.ctrl.dataset, element, bool);
Apply.toDataset.selection(ctrl.dataset, element, bool);
}
$P.clickCrdnList = (dataKey) => {
@ -427,7 +424,7 @@ $(document).ready(function(){
}
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
@ -437,7 +434,7 @@ $(document).ready(function(){
}
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
let dialogName = "totalInfoMainDialog";
@ -458,7 +455,7 @@ $(document).ready(function(){
}
$P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
@ -501,7 +498,7 @@ $(document).ready(function(){
}
$P.fnOpenAnswerPreview = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
@ -545,7 +542,7 @@ $(document).ready(function(){
$P.fnExecuteAnswer = () => {
var count = $P.ctrl.dataset.getKeys("selected").length;
var count = ctrl.dataset.getKeys("selected").length;
dialog.alert({
content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?",
@ -560,7 +557,7 @@ $(document).ready(function(){
$P.fnAnswerComplete = () => {
var count = $P.ctrl.dataset.getKeys("selected").length;
var count = ctrl.dataset.getKeys("selected").length;
dialog.alert({
content : "선택된 "+count+"건의 자료를 답변완료 상태로 변경하시겠습니까?",
@ -577,10 +574,10 @@ $(document).ready(function(){
$P.save = (processType) => {
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : {
"processType" : processType,
"crdnIds" : $P.ctrl.dataset.getKeys("selected").join(",")
"crdnIds" : ctrl.dataset.getKeys("selected").join(",")
},
success : (resp) => {
if(resp.saved){
@ -601,7 +598,7 @@ $(document).ready(function(){
var keys = [];
var selected = $P.ctrl.dataset.getDataset("selected");
var selected = ctrl.dataset.getDataset("selected");
for(var i=0; i < selected.length; i++){
if(selected[i].CVLCPT_PRCS_CD == "02"){
@ -655,12 +652,12 @@ $(document).ready(function(){
$P.provide = {
"getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length;
},
"getNextKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
return ds[index+1]["CRDN_ID"];
@ -669,7 +666,7 @@ $(document).ready(function(){
}
},
"getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"];
@ -686,8 +683,8 @@ $(document).ready(function(){
};
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchCrdnList());
$P.$findn("btnExcel").on('click', () => $P.fnExcelDown(false));
@ -706,8 +703,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollCrdnList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
//달력 초기화
AppSupport.initDatepicker($P.findn("frmSearch"));
AppSupport.initDetailSearchButton($P.findn("frmSearch"));

@ -82,11 +82,11 @@ $(document).ready(function() {
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
$P.ctrl = new DatasetControl({
var ctrl = $P.ctrl = new DatasetControl({
dataGetter:obj => obj.cvlcptInfo,
keymapper:info => info ? info.CRDN_ID : "",
urls : {
@ -99,18 +99,13 @@ $(document).ready(function() {
}
});
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set($P.ctrl,dataItem);
ctrl.dataset.onCurrentChange = (dataItem) => {
$P.formFields.set(ctrl,dataItem);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnPrev = () => {
var prevKey = $P.parentRes.getPrevKey($P.$findn("crdnId").val());
if(prevKey != ""){
@ -127,7 +122,7 @@ $(document).ready(function() {
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.ctrl.urls.getInfo,
url: ctrl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
@ -135,7 +130,7 @@ $(document).ready(function() {
success : (resp) => {
var cvlcptInfo = resp.cvlcptInfo;
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]);
ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs);
@ -156,7 +151,7 @@ $(document).ready(function() {
}
ajax.post({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
$P.saveCallback(resp);
@ -179,19 +174,19 @@ $(document).ready(function() {
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnPrev").on("click", () => $P.fnPrev() );
$P.$findn("btnNext").on("click", () => $P.fnNext() );
$P.$findn("btnSave").on("click", () => $P.fnSave() );
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var cvlcptInfo = ${cvlcptInfo};
cvlcptInfo.CVLCPT_APLY_CN = StringSupport.escapeHTMLEntity(cvlcptInfo.CVLCPT_APLY_CN);
$P.ctrl.dataset.setData([cvlcptInfo]);
ctrl.dataset.setData([cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($P.$findn("crdnId").val());
$P.$findn("countStauts").val(cs);

@ -219,8 +219,8 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
* Global Variable
**************************************************************************/
var FIM022 = new CommonCodes(${FIM022});
var FIM026 = new CommonCodes(${FIM026});
@ -237,9 +237,9 @@ $(document).ready(function(){
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
@ -253,31 +253,27 @@ $(document).ready(function(){
CRDN_YMD_TM : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderCrdnList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("crdnPaging"), $P.findn("crdnPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("crdnTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("crdnTbody"));
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
@ -290,64 +286,64 @@ $(document).ready(function(){
$P.$findn("schCvlcptRcptYmdFrom").datepicker('setDate', DateSupport.getAddDay(-365));
$P.$findn("schCvlcptRcptYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
$P.ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc03/010/list.do");
ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc01/010/remove.do");
ctrl.urls.getInfo = wctx.url("/sprt/sprt02/010/main.do");
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchCrdnList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollCrdnList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshCrdnList = () => {
$P.ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["CRDN_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["CRDN_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null;
if(ctrl.beforeCurrent != null){
var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = ctrl.beforeCurrent.index;
ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
$P.ctrl.dataset.setCurrent(info["CRDN_ID"],true);
ctrl.dataset.setCurrent(info["CRDN_ID"],true);
}
}
}
@ -356,16 +352,16 @@ $(document).ready(function(){
}
$P.fnExcelDown = () => {
if($P.ctrl.dataset.empty){
if(ctrl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = AppSupport.getCellDefs($P.$findn("crdnThead").find("th").not(".dummy-th").not(":eq(0)"),
$($P.findn("crdnRow").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
}
$P.getGridTemplate = () => {
@ -386,7 +382,7 @@ $(document).ready(function(){
$P.renderCrdnList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -405,7 +401,7 @@ $(document).ready(function(){
$P.$findn("crdnTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.dblclickCrdnList = (dataKey) => {
@ -415,7 +411,7 @@ $(document).ready(function(){
}
ajax.get({
url : $P.ctrl.urls.getInfo,
url : ctrl.urls.getInfo,
data : params,
success : (resp) => {
@ -437,15 +433,15 @@ $(document).ready(function(){
$P.fnRemove = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
var curKey = cur["CRDN_ID"];
$P.ctrl.dataset.select(curKey,true);
ctrl.dataset.select(curKey,true);
var selected = $P.ctrl.dataset.getKeys("selected");
var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
}
@ -455,7 +451,7 @@ $(document).ready(function(){
};
ajax.post({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : params,
success : (resp) => {
$P.saveCallback(selected, resp);
@ -471,7 +467,7 @@ $(document).ready(function(){
}
$P.fnOpenCvlcptOrgnl = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
@ -515,12 +511,12 @@ $(document).ready(function(){
$P.provide = {
"getCountStatus" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length;
},
"getNextKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
return ds[index+1]["CRDN_ID"];
@ -529,7 +525,7 @@ $(document).ready(function(){
}
},
"getPrevKey" : function(currentKey){
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"];
@ -544,7 +540,7 @@ $(document).ready(function(){
$P.refreshCrdnList();
},
"hasData" : function(key){
if($P.ctrl.dataset.getData(key) == null){
if(ctrl.dataset.getData(key) == null){
return false;
} else {
return true;
@ -554,8 +550,8 @@ $(document).ready(function(){
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchCrdnList());
$P.$findn("btnExcel").on('click', () => $P.fnExcelDown());
@ -570,8 +566,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollCrdnList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
//달력 초기화
AppSupport.initDatepicker($P.findn("frmSearch"));
AppSupport.initDetailSearchButton($P.findn("frmSearch"));

@ -159,10 +159,10 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
var FIM063 = new CommonCodes(${FIM063});
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
* Global Variable
**************************************************************************/
var FIM063 = new CommonCodes(${FIM063});
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
@ -175,9 +175,9 @@ $(document).ready(function(){
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.INDIV_ID : "",
urls : {
@ -191,91 +191,88 @@ $(document).ready(function(){
RSPNS_DT : datetimeFormat
}
});
$P.ctrl.defaultFetchSize = FETCH_XS;
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
$P.ctrl.beforeCurrent = null;
ctrl.defaultFetchSize = FETCH_XS;
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
ctrl.beforeCurrent = null;
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
ctrl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate();
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderDmndList(obj["Total"], $P.ctrl.dataset.length, trs, option);
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
$P.renderDmndList(obj["Total"], ctrl.dataset.length, trs, option);
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("dmndPaging"), $P.findn("dmndPagingInfo"));
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("dmndPaging"), $P.findn("dmndPagingInfo"));
};
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("dmndTbody"));
ctrl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("dmndTbody"));
}
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
$P.$findn("schDmndYmdFrom").datepicker('setDate', DateSupport.getAddDay(-5475));
$P.$findn("schDmndYmdTo").datepicker('setDate', TODAY());
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
}
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
$P.ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
}
$P.getParams = () => {
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
var data = formFields.get();
data.fetchSize = $P.ctrl.defaultFetchSize;
data.fetchSize = ctrl.defaultFetchSize;
return data;
}
$P.searchDmndList = () => {
$P.ctrl.query = $P.getParams();
$P.ctrl.load(1);
ctrl.query = $P.getParams();
ctrl.load(1);
}
$P.scrollDmndList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
ctrl.load(ctrl.query.pageNum + 1);
}
$P.refreshDmndList = () => {
if(!$P.ctrl.dataset.empty){
$P.ctrl.beforeCurrent = {
key : $P.ctrl.dataset.getCurrent()["INDIV_ID"],
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
if(!ctrl.dataset.empty){
ctrl.beforeCurrent = {
key : ctrl.dataset.getCurrent()["INDIV_ID"],
index : ctrl.dataset.getCurrent()["ROW_NUM"] - 1
};
}
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
Apply.toDataset.set($P.ctrl.dataset, resp);
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
Apply.fromDatasetControl.reload(ctrl).then((resp)=>{
Apply.toDataset.set(ctrl.dataset, resp);
ctrl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.ctrl.beforeCurrent != null){
var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
$P.ctrl.beforeCurrent = null;
if(ctrl.beforeCurrent != null){
var beforeCurrentKey = ctrl.beforeCurrent.key;
var beforeCurrentIndex = ctrl.beforeCurrent.index;
ctrl.beforeCurrent = null;
if(!$P.ctrl.dataset.empty){
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
if(!ctrl.dataset.empty){
var info = ctrl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
ctrl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
if(beforeCurrentIndex > (ctrl.dataset.length - 1)){
info = ctrl.dataset.getDataset()[ctrl.dataset.length - 1];
} else {
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
info = ctrl.dataset.getDataset()[beforeCurrentIndex];
}
$P.ctrl.dataset.setCurrent(info["INDIV_ID"],true);
ctrl.dataset.setCurrent(info["INDIV_ID"],true);
}
}
}
@ -299,7 +296,7 @@ $(document).ready(function(){
$P.renderDmndList = (total, listLength, trs, option) => {
let noMore = (listLength >= total);
var initScroll = ($P.ctrl.query.pageNum < 2);
var initScroll = (ctrl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
@ -313,24 +310,24 @@ $(document).ready(function(){
}
$P.$findn("dmndTbody").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
Apply.toDataset.current(ctrl.dataset, dataKey);
}
$P.fnRemove = (allCompleteDataIds) => {
if(allCompleteDataIds != null){
$P.ctrl.dataset.select(allCompleteDataIds,true);
ctrl.dataset.select(allCompleteDataIds,true);
} else {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
var curKey = cur["INDIV_ID"];
$P.ctrl.dataset.select(curKey,true);
ctrl.dataset.select(curKey,true);
}
var selected = $P.ctrl.dataset.getKeys("selected");
var selected = ctrl.dataset.getKeys("selected");
if (selected.length < 1) {
return;
}
@ -340,7 +337,7 @@ $(document).ready(function(){
};
ajax.post({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : params,
success : (resp) => {
$P.removeCallback(selected, resp);
@ -358,12 +355,12 @@ $(document).ready(function(){
}
$P.fnRemoveAllCompleteData = () => {
var cur = $P.ctrl.dataset.getCurrent();
var cur = ctrl.dataset.getCurrent();
if(cur == null){
return;
}
var ds = $P.ctrl.dataset.getDataset();
var ds = ctrl.dataset.getDataset();
var indivIds = ds.filter(function(item){
if(item['STTS_CD'] == '9' || item['STTS_CD'] == 'B'){
@ -427,7 +424,7 @@ $(document).ready(function(){
info.taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.create,
url : ctrl.urls.create,
data : info,
success : (resp) => {
if(resp.saved){
@ -436,7 +433,7 @@ $(document).ready(function(){
$P.$findn("toastText").html("등록 되었습니다.");
$P.toast.show();
if(!$P.ctrl.dataset.empty){
if(!ctrl.dataset.empty){
AppSupport.sleep(1000).then(() => $P.refreshDmndList());
}
}
@ -445,8 +442,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
$P.$findn("btnSearch").on('click', () => $P.searchDmndList());
@ -458,8 +455,8 @@ $(document).ready(function(){
Componentization.fnMakeScrollableTable($P.findn("table-responsive"), $P.scrollDmndList);
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
//달력 초기화
AppSupport.initDatepicker($P.findn("frmSearch"));

@ -299,9 +299,9 @@
<script>
LoadScript("cvlc05010Script","/resources/js/fims/cvlc/cvlc05010.js?ver=${ver}");
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
@ -314,27 +314,27 @@ $(document).ready(function(){
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = newCvlc05010Control();
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = newCvlc05010Control();
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls = {};
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do");
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do");
ctrl.urls = {};
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do");
ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do");
ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do");
$P.fnReset();
}
$P.fnReset = () => {
$P.$findn("btnAnsBasicTab").trigger("click");
$P.ctrl.levy.setData([]);
$P.ctrl.warning.setData([]);
$P.ctrl.nonlevy.setData([]);
ctrl.levy.setData([]);
ctrl.warning.setData([]);
ctrl.nonlevy.setData([]);
$P.renderAnsBodyList(0,'levy');
$P.renderAnsBodyList(0,'warning');
@ -356,31 +356,31 @@ $(document).ready(function(){
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.load,
url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : (resp) => {
$P.$findn("headerCn").val(resp.headerCn);
$P.$findn("footerCn").val(resp.footerCn);
$P.ctrl.levy.setData(resp.levyCaseList);
$P.ctrl.warning.setData(resp.warningCaseList);
$P.ctrl.nonlevy.setData(resp.nonlevyCaseList);
ctrl.levy.setData(resp.levyCaseList);
ctrl.warning.setData(resp.warningCaseList);
ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){
var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy');
}
if(resp.warningCaseList.length > 0){
var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning');
}
if(resp.nonlevyCaseList.length > 0){
var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy');
}
}
@ -408,7 +408,7 @@ $(document).ready(function(){
return;
}
var ansBodyDS = $P.ctrl[renderDataType].dataset;
var ansBodyDS = ctrl[renderDataType].dataset;
var empty = ansBodyDS.empty;
var notFound = [$P.findn(notFoundName).innerHTML];
var found = $P.findn(foundName).innerHTML;
@ -434,7 +434,7 @@ $(document).ready(function(){
$P.radioClickAnsBodyList = (dataKey, gridType) => {
$P.ctrl[gridType].setCurrent(dataKey);
ctrl[gridType].setCurrent(dataKey);
var tbodyName = "";
if(gridType == "levy"){
@ -488,11 +488,11 @@ $(document).ready(function(){
var dstrbncYn = "";
if($P.currentDisplay == "levyAnsBody"){
curData = $P.ctrl.levy.getCurrent();
curData = ctrl.levy.getCurrent();
} else if($P.currentDisplay == "warningAnsBody"){
curData = $P.ctrl.warning.getCurrent();
curData = ctrl.warning.getCurrent();
} else if($P.currentDisplay == "nonlevyAnsBody"){
curData = $P.ctrl.nonlevy.getCurrent();
curData = ctrl.nonlevy.getCurrent();
}
if(curData == null){
@ -530,41 +530,41 @@ $(document).ready(function(){
}
$P.refreshAnsWordsInfo = () => {
var cursor1 = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var cursor2 = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor3 = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor1 = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var cursor2 = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor3 = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.load,
url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : (resp) => {
$P.$findn("headerCn").val(resp.headerCn);
$P.$findn("footerCn").val(resp.footerCn);
$P.ctrl.levy.setData(resp.levyCaseList);
$P.ctrl.warning.setData(resp.warningCaseList);
$P.ctrl.nonlevy.setData(resp.nonlevyCaseList);
ctrl.levy.setData(resp.levyCaseList);
ctrl.warning.setData(resp.warningCaseList);
ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){
$P.ctrl.levy.setCurrent(cursor1);
var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
ctrl.levy.setCurrent(cursor1);
var current = ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy');
}
if(resp.warningCaseList.length > 0){
$P.ctrl.warning.setCurrent(cursor2);
var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
ctrl.warning.setCurrent(cursor2);
var current = ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning');
}
if(resp.nonlevyCaseList.length > 0){
$P.ctrl.nonlevy.setCurrent(cursor3);
var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
ctrl.nonlevy.setCurrent(cursor3);
var current = ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy');
}
}
@ -603,7 +603,7 @@ $(document).ready(function(){
onOK: () => {
ajax.get({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
if(resp.saved){
@ -629,7 +629,7 @@ $(document).ready(function(){
},
onOK: () => {
ajax.get({
url : $P.ctrl.urls.remove,
url : ctrl.urls.remove,
data : info,
success : (resp) => {
if(resp.saved){
@ -675,8 +675,8 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
//탭 버튼
@ -773,9 +773,10 @@ $(document).ready(function(){
if(macroTarget == ""){ return; }
fnMacroStringInsert(macroTarget, MACRO_STRING.MACRO_PIC_NM);
});
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$P.$findn("frmSearch").find("input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);

@ -119,8 +119,8 @@
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
$(document).ready(function(){
@ -134,9 +134,9 @@ $(document).ready(function(){
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = new DatasetControl({
dataGetter : obj => obj["List"],
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : "",
urls : {},
@ -144,19 +144,19 @@ $(document).ready(function(){
});
/**************************************************************************
* pageObject.function
**************************************************************************/
* pageObject.function
**************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ctrl.urls = {};
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do");
$P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do");
ctrl.urls = {};
ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do");
ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do");
$P.fnReset();
}
$P.fnReset = () => {
$P.ctrl.dataset.setData([]);
ctrl.dataset.setData([]);
$P.renderWarningWordsList(0);
$P.$findn("frmEditWarningWords").find("input, textarea").val("");
@ -173,16 +173,16 @@ $(document).ready(function(){
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.load,
url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : (resp) => {
$P.ctrl.dataset.setData(resp.List);
ctrl.dataset.setData(resp.List);
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
var current = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current);
}
}
@ -191,7 +191,7 @@ $(document).ready(function(){
$P.renderWarningWordsList = (total) => {
var warningWordsDS = $P.ctrl.dataset;
var warningWordsDS = ctrl.dataset;
var empty = warningWordsDS.empty;
var notFound = [$P.findn("warningWordsNotFound").innerHTML];
var found = $P.findn("warningWordsRow").innerHTML;
@ -206,7 +206,7 @@ $(document).ready(function(){
$P.radioClickWarningWordsList = (dataKey, gridType) => {
$P.ctrl.dataset.setCurrent(dataKey);
ctrl.dataset.setCurrent(dataKey);
$P.$findn("warningWordsTbody").setCurrentRow(dataKey);
@ -224,7 +224,7 @@ $(document).ready(function(){
$P.changeTextarea = () => {
var curData = $P.ctrl.dataset.getCurrent();
var curData = ctrl.dataset.getCurrent();
if(curData == null){
$P.$findn("ansRsnCd").val("");
@ -242,20 +242,20 @@ $(document).ready(function(){
$P.refreshWarningWordsInfo = () => {
var cursor = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $P.$findn("frmSearch").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.ctrl.urls.load,
url : ctrl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : (resp) => {
$P.ctrl.dataset.setData(resp.List);
ctrl.dataset.setData(resp.List);
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
$P.ctrl.dataset.setCurrent(cursor);
var current = $P.ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
ctrl.dataset.setCurrent(cursor);
var current = ctrl.dataset.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current,'warning');
}
@ -280,7 +280,7 @@ $(document).ready(function(){
onOK: () => {
ajax.get({
url : $P.ctrl.urls.update,
url : ctrl.urls.update,
data : info,
success : (resp) => {
if(resp.saved){
@ -294,16 +294,16 @@ $(document).ready(function(){
}
/**************************************************************************
* element.on
**************************************************************************/
* element.on
**************************************************************************/
$P.$findn("btnReset").on('click', () => $P.fnReset());
//업무처리 버튼
$P.$findn("btnSave").on("click", () => $P.fnSave());
/**************************************************************************
* 초기화
**************************************************************************/
* 초기화
**************************************************************************/
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$P.$findn("frmSearch").find("input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);

@ -47,41 +47,37 @@ $(document).ready(function() {
$P.integrationSearch = {};
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = newSprt01010Control();
* DatasetControl, DatasetSupport, FormFields
**************************************************************************/
var ctrl = $P.ctrl = newSprt01010Control();
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.ctrl.upDataset.onDatasetChange = (obj, option) => {
ctrl.upDataset.onDatasetChange = (obj, option) => {
var upActiveTab = $P.$findn("upGridTabs").find("button.active").text().trim();
$P.renderList("up", upActiveTab);
};
$P.ctrl.downDataset.onDatasetChange = (obj, option) => {
ctrl.downDataset.onDatasetChange = (obj, option) => {
var downActiveTab = $P.$findn("downGridTabs").find("button.active").text().trim();
$P.renderList("down", downActiveTab);
};
// 현재 선택 자료 변경 이벤트
$P.ctrl.upDataset.onCurrentChange = (DI) => {
ctrl.upDataset.onCurrentChange = (DI) => {
if (!DI) return;
var key = DI.data.CRDN_ID;
$P.$findn("upTbody").setCurrentRow(key);
};
$P.ctrl.downDataset.onCurrentChange = (DI) => {
ctrl.downDataset.onCurrentChange = (DI) => {
if (!DI) return;
var key = DI.data.CRDN_ID;
$P.$findn("downTbody").setCurrentRow(key);
};
// 선택(체크) 변경 이벤트
$P.ctrl.upDataset.onSelectionChange = (selectedArr) => {
var DS = $P.ctrl.upDataset;
ctrl.upDataset.onSelectionChange = (selectedArr) => {
var DS = ctrl.upDataset;
var keys = selectedArr.map(item => DS.getKey(item));
$P.$findn("upTbody").find("input[type='checkbox']").each(function() {
@ -100,8 +96,8 @@ $(document).ready(function() {
};
$P.ctrl.downDataset.onSelectionChange = (selectedArr) => {
var DS = $P.ctrl.downDataset;
ctrl.downDataset.onSelectionChange = (selectedArr) => {
var DS = ctrl.downDataset;
var keys = selectedArr.map(item => DS.getKey(item));
$P.$findn("downTbody").find("input[type='checkbox']").each(function() {
@ -119,22 +115,25 @@ $(document).ready(function() {
}
};
//그리드 체크박스
$P.selectCheckbox = (obj, arg1, arg2) => {
let table = $(obj).parent().parent().parent().parent();
let id = table[0].id;
let id = table.attr("name");
if(id.startsWith("up")){
if(arg2 != null){
pageObject['${pageName}'].ctrl.upDataset.select(arg1, arg2);
ctrl.upDataset.select(arg1, arg2);
} else {
pageObject['${pageName}'].ctrl.upDataset.select(arg1);
ctrl.upDataset.select(arg1);
}
} else if(id.startsWith("down")){
if(arg2 != null){
pageObject['${pageName}'].ctrl.downDataset.select(arg1, arg2);
ctrl.downDataset.select(arg1, arg2);
} else {
pageObject['${pageName}'].ctrl.downDataset.select(arg1);
ctrl.downDataset.select(arg1);
}
}
}
@ -176,8 +175,8 @@ $(document).ready(function() {
}
$P.fnReset = () => {
$P.ctrl.upDataset.clear();
$P.ctrl.downDataset.clear();
ctrl.upDataset.clear();
ctrl.downDataset.clear();
}
// 검색 조건 파라미터 가져오기
@ -192,9 +191,9 @@ $(document).ready(function() {
$P.fnSearchList = () => {
// 검색조건
$P.ctrl.query = $P.getParams();
ctrl.query = $P.getParams();
var query = $P.ctrl.query;
var query = ctrl.query;
var minKeyword = false;
var keys = Object.keys(query);
for(var i=0; i < keys.length; i++){
@ -228,10 +227,10 @@ $(document).ready(function() {
$P.$findn("upGridTabs").find("button").eq(0).addClass("active");
$P.$findn("downGridTabs").find("button").not(":eq(0)").removeClass("active");
$P.$findn("downGridTabs").find("button").eq(0).addClass("active");
$P.ctrl.upDataset.clear();
$P.ctrl.downDataset.clear();
ctrl.upDataset.clear();
ctrl.downDataset.clear();
$P.ctrl.load();
ctrl.load();
}
@ -241,7 +240,7 @@ $(document).ready(function() {
var cellDefs;
if(updown == "up"){
if($P.ctrl.upDataset.empty){
if(ctrl.upDataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
@ -252,9 +251,9 @@ $(document).ready(function() {
FimsSupport.getCellDefsForPrivacyCell
);
$P.ctrl.query.gridType = "up";
ctrl.query.gridType = "up";
} else {
if($P.ctrl.downDataset.empty){
if(ctrl.downDataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
@ -265,12 +264,12 @@ $(document).ready(function() {
FimsSupport.getCellDefsForPrivacyCell
);
$P.ctrl.query.gridType = "down";
ctrl.query.gridType = "down";
}
$P.ctrl.query.cellDefs = cellDefs;
ctrl.query.cellDefs = cellDefs;
$P.ctrl.download();
ctrl.download();
}
@ -283,9 +282,9 @@ $(document).ready(function() {
var DS;
if(updown == "up"){
DS = $P.ctrl.upDataset;
DS = ctrl.upDataset;
} else {
DS = $P.ctrl.downDataset;
DS = ctrl.downDataset;
}
var replacer;
@ -371,9 +370,9 @@ $(document).ready(function() {
var cur;
if(updown == "up"){
cur = $P.ctrl.upDataset.getCurrent();
cur = ctrl.upDataset.getCurrent();
} else {
cur = $P.ctrl.downDataset.getCurrent();
cur = ctrl.downDataset.getCurrent();
}
if(cur != null){
@ -390,9 +389,9 @@ $(document).ready(function() {
var cur;
if(updown == "up"){
cur = $P.ctrl.upDataset.getCurrent();
cur = ctrl.upDataset.getCurrent();
} else {
cur = $P.ctrl.downDataset.getCurrent();
cur = ctrl.downDataset.getCurrent();
}
if(cur.length <= 0){
@ -407,10 +406,10 @@ $(document).ready(function() {
var cur;
if(updown == "up"){
cur = $P.ctrl.upDataset;
cur = ctrl.upDataset;
} else {
cur = $P.ctrl.downDataset;
cur = ctrl.downDataset;
}
@ -456,8 +455,8 @@ $(document).ready(function() {
//단속내역서,단속확인서
$P.fnPrintCrdn = () => {
var upDataset = $P.ctrl.upDataset;
var downDataset = $P.ctrl.downDataset;
var upDataset = ctrl.upDataset;
var downDataset = ctrl.downDataset;
if((upDataset.length <= 0) && (downDataset.length <= 0)){
dialog.alert("출력할 자료가 없습니다.");
@ -504,7 +503,7 @@ $(document).ready(function() {
//교부청구서,채권신고서
$P.fnPrintBill = () => {
var upDataset = $P.ctrl.upDataset;
var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다.");
@ -562,7 +561,7 @@ $(document).ready(function() {
//납부확인서
$P.fnPrintRcvmtConfirm = () => {
var downDataset = $P.ctrl.downDataset;
var downDataset = ctrl.downDataset;
if(downDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다.");
@ -584,7 +583,7 @@ $(document).ready(function() {
//사전통지서
$P.fnPrintAdvntce = () => {
var upDataset = $P.ctrl.upDataset;
var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다.");
@ -642,7 +641,7 @@ $(document).ready(function() {
//고지서
$P.fnPrintNht = () => {
var upDataset = $P.ctrl.upDataset;
var upDataset = ctrl.upDataset;
if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다.");
@ -703,20 +702,20 @@ $(document).ready(function() {
return;
}
var upDataset = $P.ctrl.upDataset;
var downDataset = $P.ctrl.downDataset;
var upDataset = ctrl.upDataset;
var downDataset = ctrl.downDataset;
if(upDataset.length > 0){
var info = upDataset.getData(crdnId);
if(info != null){
$P.ctrl.flag = "up";
ctrl.flag = "up";
}
}
if(downDataset.length > 0){
var info = downDataset.getData(crdnId);
if(info != null){
$P.ctrl.flag = "down";
ctrl.flag = "down";
}
}
@ -755,8 +754,8 @@ $(document).ready(function() {
$P.provide = {
"getInfo" : function(crdnId){
var upDataset = $P.ctrl.upDataset;
var downDataset = $P.ctrl.downDataset;
var upDataset = ctrl.upDataset;
var downDataset = ctrl.downDataset;
if(upDataset.length > 0){
var info = upDataset.getData(crdnId);
@ -776,8 +775,8 @@ $(document).ready(function() {
},
"isAllSameTask" : function(crdnIdArr){
var upArr = $P.ctrl.upDataset.getDataset();
var downArr = $P.ctrl.downDataset.getDataset();
var upArr = ctrl.upDataset.getDataset();
var downArr = ctrl.downDataset.getDataset();
var unionArr = [...upArr, ...downArr];
var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID));
@ -843,8 +842,8 @@ $(document).ready(function() {
}
/**************************************************************************
* script 진입
**************************************************************************/
* script 진입
**************************************************************************/
$P.$findn("upTheadTr").html($P.findn("cols").innerHTML);
$P.$findn("downTheadTr").html($P.findn("cols").innerHTML);

Loading…
Cancel
Save