|
|
|
@ -163,7 +163,7 @@
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody name="crdnTbody"></tbody>
|
|
|
|
|
<template is="curly-brackets" name="crdnRow">
|
|
|
|
|
<tr data-key="CRDN_ID">
|
|
|
|
|
<tr data-index="DATA-INDEX">
|
|
|
|
|
<td onclick ondblclick class="text-end">ROW_NUM</td>
|
|
|
|
|
<td onclick ondblclick class="text-center">CVLCPT_RCPT_NO</td>
|
|
|
|
|
<td onclick ondblclick class="text-center">CVLCPT_LIST_NO</td>
|
|
|
|
@ -398,8 +398,8 @@ $(document).ready(function(){
|
|
|
|
|
var notFound = [$P.findn("crdnNotFound").innerHTML];
|
|
|
|
|
var found = $P.findn("crdnRow").innerHTML;
|
|
|
|
|
var replacer = (str, dataItem) => str
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("CRDN_ID") + "');")
|
|
|
|
|
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('" + dataItem.getValue("CRDN_ID") + "');");
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('{DATA-INDEX}');")
|
|
|
|
|
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickCrdnList('{CRDN_ID}');");
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
found : found,
|
|
|
|
@ -421,23 +421,30 @@ $(document).ready(function(){
|
|
|
|
|
//보안모드
|
|
|
|
|
fn_securityModeToggle($("#securityMode--top").is(":checked"));
|
|
|
|
|
|
|
|
|
|
$P.holdList.forEach(function(item){
|
|
|
|
|
$P.$findn("crdnTbody").find("tr[data-key='"+item+"']").addClass("bg-dark");
|
|
|
|
|
$P.holdList.forEach(function(h_item){
|
|
|
|
|
|
|
|
|
|
let filtered = ctrl.dataset.getDataset("item").filter(item => item.data.CRDN_ID == h_item);
|
|
|
|
|
if(filtered.length > 0){
|
|
|
|
|
$P.$findn("crdnTbody").find("tr[data-index='"+filtered[0].index+"']").addClass("bg-dark");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.clickCrdnList = (dataKey) => {
|
|
|
|
|
if(dataKey == ""){
|
|
|
|
|
$P.clickCrdnList = (dataIndex) => {
|
|
|
|
|
if(dataIndex == ""){
|
|
|
|
|
$P.$findn("bottomCrdnPlc").val("");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.$findn("crdnTbody").setCurrentRow(dataKey);
|
|
|
|
|
$P.$findn("crdnTbody").setCurrentRow(dataIndex);
|
|
|
|
|
|
|
|
|
|
$P.$findn("bottomCrdnPlc").val(ctrl.dataset.getData(dataKey)["CRDN_PLC"]);
|
|
|
|
|
$P.$findn("bottomCrdnPlc").val(ctrl.dataset.getData(dataIndex)["CRDN_PLC"]);
|
|
|
|
|
|
|
|
|
|
if($P.holdList.includes(dataKey)){
|
|
|
|
|
|
|
|
|
|
let crdnId = ctrl.dataset.getData(dataIndex)["CRDN_ID"];
|
|
|
|
|
|
|
|
|
|
if($P.holdList.includes(crdnId)){
|
|
|
|
|
$P.$findn("btnOpenCvlcptOrgnl").hide();
|
|
|
|
|
$P.$findn("btnDelete").hide();
|
|
|
|
|
$P.$findn("btnDeleteSameRcptYmd").hide();
|
|
|
|
@ -447,7 +454,7 @@ $(document).ready(function(){
|
|
|
|
|
$P.$findn("btnDeleteSameRcptYmd").show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Apply.toDataset.current(ctrl.dataset, dataKey);
|
|
|
|
|
Apply.toDataset.current(ctrl.dataset, dataIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.dblclickCrdnList = (dataKey) => {
|
|
|
|
@ -499,18 +506,30 @@ $(document).ready(function(){
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnHold = () => {
|
|
|
|
|
var curKey = ctrl.dataset.getCurrent()["CRDN_ID"];
|
|
|
|
|
$P.fnHold = (argCrdnId) => {
|
|
|
|
|
var curKey;
|
|
|
|
|
if(argCrdnId != null){
|
|
|
|
|
curKey = argCrdnId;
|
|
|
|
|
} else {
|
|
|
|
|
curKey = ctrl.dataset.getCurrent()["CRDN_ID"];
|
|
|
|
|
}
|
|
|
|
|
if($P.holdList.includes(curKey)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$P.holdList.push(curKey);
|
|
|
|
|
$P.$findn("crdnTbody").find("tr[data-key='"+curKey+"']").addClass("bg-dark");
|
|
|
|
|
let dataIndex;
|
|
|
|
|
if(argCrdnId != null){
|
|
|
|
|
dataIndex = ctrl.dataset.getDataset("item").filter(item => item.data.CRDN_ID == argCrdnId).index;
|
|
|
|
|
} else {
|
|
|
|
|
dataIndex = ctrl.dataset.getCurrent("item").index;
|
|
|
|
|
}
|
|
|
|
|
$P.$findn("crdnTbody").find("tr[data-index='"+dataIndex+"']").addClass("bg-dark");
|
|
|
|
|
|
|
|
|
|
$P.$findn("btnOpenCvlcptOrgnl").hide();
|
|
|
|
|
$P.$findn("btnDelete").hide();
|
|
|
|
|
$P.$findn("btnDeleteSameRcptYmd").hide();
|
|
|
|
|
if(dataIndex == ctrl.dataset.getCurrent("item").index){
|
|
|
|
|
$P.$findn("btnOpenCvlcptOrgnl").hide();
|
|
|
|
|
$P.$findn("btnDelete").hide();
|
|
|
|
|
$P.$findn("btnDeleteSameRcptYmd").hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.fnRemove = (rcptYmd) => {
|
|
|
|
@ -542,13 +561,13 @@ $(document).ready(function(){
|
|
|
|
|
ctrl.dataset.select(curKey,true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var selected = ctrl.dataset.getKeys("selected");
|
|
|
|
|
var selected = ctrl.dataset.getDataset("selected");
|
|
|
|
|
if (selected.length < 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var params = {
|
|
|
|
|
"crdnIds" : selected.join(",")
|
|
|
|
|
"crdnIds" : selected.map(item => item.CRDN_ID).join(",")
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ajax.post({
|
|
|
|
@ -629,52 +648,56 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.provide = {
|
|
|
|
|
"getCountStatus" : function(currentKey){
|
|
|
|
|
var ds = ctrl.dataset.getDataset();
|
|
|
|
|
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
|
|
|
|
|
return (index+1) + " of " + ds.length;
|
|
|
|
|
"getCountStatus" : function(currentCrdnId){
|
|
|
|
|
var dsArray = ctrl.dataset.getDataset();
|
|
|
|
|
var arrayIndex = dsArray.findIndex(item => item.CRDN_ID == currentCrdnId);
|
|
|
|
|
return (arrayIndex+1) + " of " + dsArray.length;
|
|
|
|
|
},
|
|
|
|
|
"getNextKey" : function(currentKey){
|
|
|
|
|
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"])){
|
|
|
|
|
return $P.provide.getNextKey(ds[index+1]["CRDN_ID"]);
|
|
|
|
|
"getNextKey" : function(currentCrdnId){
|
|
|
|
|
var dsArray = ctrl.dataset.getDataset();
|
|
|
|
|
var arrayIndex = dsArray.findIndex(item => item.CRDN_ID == currentCrdnId);
|
|
|
|
|
if(dsArray.length > arrayIndex+1){
|
|
|
|
|
if($P.holdList.includes(dsArray[arrayIndex+1]["CRDN_ID"])){
|
|
|
|
|
return $P.provide.getNextKey(dsArray[arrayIndex+1]["CRDN_ID"]);
|
|
|
|
|
} else {
|
|
|
|
|
return ds[index+1]["CRDN_ID"];
|
|
|
|
|
return dsArray[arrayIndex+1]["CRDN_ID"];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"getPrevKey" : function(currentKey){
|
|
|
|
|
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"])){
|
|
|
|
|
return $P.provide.getPrevKey(ds[index-1]["CRDN_ID"]);
|
|
|
|
|
"getPrevKey" : function(currentCrdnId){
|
|
|
|
|
var dsArray = ctrl.dataset.getDataset();
|
|
|
|
|
var arrayIndex = dsArray.findIndex(item => item.CRDN_ID == currentCrdnId);
|
|
|
|
|
if(arrayIndex != 0 && dsArray.length > 1){
|
|
|
|
|
if($P.holdList.includes(dsArray[arrayIndex-1]["CRDN_ID"])){
|
|
|
|
|
return $P.provide.getPrevKey(dsArray[arrayIndex-1]["CRDN_ID"]);
|
|
|
|
|
} else {
|
|
|
|
|
return ds[index-1]["CRDN_ID"];
|
|
|
|
|
return dsArray[arrayIndex-1]["CRDN_ID"];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"selectRow" : function(currentKey){
|
|
|
|
|
$P.clickCrdnList(currentKey);
|
|
|
|
|
"selectRow" : function(currentCrdnId){
|
|
|
|
|
let filtered = ctrl.dataset.getDataset("item").filter(item => item.data.CRDN_ID == currentCrdnId);
|
|
|
|
|
if(filtered.length > 0){
|
|
|
|
|
$P.clickCrdnList(filtered[0].index);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"holdRow" : function(currentKey){
|
|
|
|
|
$P.fnHold(currentKey);
|
|
|
|
|
"holdRow" : function(currentCrdnId){
|
|
|
|
|
$P.fnHold(currentCrdnId);
|
|
|
|
|
},
|
|
|
|
|
"refreshList" : function(){
|
|
|
|
|
$P.refreshCrdnList();
|
|
|
|
|
},
|
|
|
|
|
"hasData" : function(key){
|
|
|
|
|
if(ctrl.dataset.getData(key) == null){
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
"hasData" : function(crdnId){
|
|
|
|
|
let filtered = ctrl.dataset.getDataset("item").filter(item => item.data.CRDN_ID == crdnId);
|
|
|
|
|
if(filtered.length > 0){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|