부과 제외 등록 수정

main
이범준 1 year ago
parent e918ce3306
commit 1d115d476b

@ -621,8 +621,7 @@ $(document).ready(function(){
var params = { var params = {
"crdnId" : info.data.CRDN_ID, "crdnId" : info.data.CRDN_ID,
"levyExclSeCd" : levyExclSeCd, "levyExclSeCd" : levyExclSeCd,
"openerPageName" : "crdn06020-main", "savedCallbackFuncName" : "pageObject['crdn06020-main']['exclSavedCallback']",
"callbackFuncName" : "pageObject['crdn06020-main']['exclCallback']",
}; };
ajax.get({ ajax.get({
@ -648,7 +647,7 @@ $(document).ready(function(){
}); });
}; };
$P.exclCallback = (saved) => { $P.exclSavedCallback = (saved) => {
if(saved){ if(saved){
$P.refreshInspectionList(); $P.refreshInspectionList();
} }

@ -357,7 +357,8 @@ $(document).ready(function(){
urls : { urls : {
load : "", load : "",
getInfo : wctx.url("/${taskSeCd}/cvlc/cvlc01/020/info.do"), getInfo : wctx.url("/${taskSeCd}/cvlc/cvlc01/020/info.do"),
update : wctx.url("/${taskSeCd}/cvlc/cvlc01/020/save.do") update : wctx.url("/${taskSeCd}/cvlc/cvlc01/020/save.do"),
create : ""
}, },
keymapper:info => info ? info.CRDN_ID : "", keymapper:info => info ? info.CRDN_ID : "",
dataGetter:obj => obj.crdnInfo, dataGetter:obj => obj.crdnInfo,
@ -367,10 +368,8 @@ $(document).ready(function(){
}); });
$P.crdnControl.save = (info) => { $P.crdnControl.save = (info, accept) => {
if (!info) return; if (!info) return;
var item = $P.crdnControl.getCurrent("item"),
create = "added" == item.state;
var formData = new FormData(document.getElementById("frmFile--${pageName}")); var formData = new FormData(document.getElementById("frmFile--${pageName}"));
for(var key in info) { for(var key in info) {
@ -391,8 +390,6 @@ $(document).ready(function(){
$P.captureFileArr.forEach(item => formData.append("newFileList",item)); $P.captureFileArr.forEach(item => formData.append("newFileList",item));
} }
if($P.existFileArr.length > 0){ if($P.existFileArr.length > 0){
for(var i=0; i < $P.existFileArr.length; i++){ for(var i=0; i < $P.existFileArr.length; i++){
if($P.existFileArr[i].status == "delete"){ if($P.existFileArr[i].status == "delete"){
@ -404,12 +401,16 @@ $(document).ready(function(){
} }
} }
formData.append("acceptYn", "Y"); if(accept){
formData.append("acceptYn", "Y");
} else {
formData.append("acceptYn", "N");
}
ajax.post({ ajax.post({
url:!create ? $P.crdnControl.urls.update : $P.crdnControl.urls.create, url : $P.crdnControl.urls.update,
data: formData, contentType : false, processData : false, data : formData, contentType : false, processData : false,
success:resp => $P.crdnControl.onSave(resp) success : resp => { $P.crdnControl.onSave(resp); }
}); });
}; };
@ -430,8 +431,35 @@ $(document).ready(function(){
$P.crdnControl.onSave = (resp) => { $P.crdnControl.onSave = (resp) => {
if (resp.saved) { if (resp.saved) {
dialog.alert("저장됐습니다."); dialog.alert("저장됐습니다.");
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}");
if($("#levyExcldialog--${pageName}").length > 0){
dialog.close("levyExcldialog--${pageName}");
}
var crdnId = $("#crdnId--${pageName}").val();
var cursorKey = "";
var nextKey = $P.provided.getNextKey(crdnId);
if(nextKey != ""){
cursorKey = nextKey;
} else {
var prevKey = $P.provided.getPrevKey(crdnId);
if(prevKey != ""){
cursorKey = prevKey;
}
}
$P.provided.refreshList();
if(cursorKey != ""){
$P.fnGo(cursorKey);
} else {
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}");
}
} }
}; };
/************************************************************************** /**************************************************************************
@ -540,7 +568,7 @@ $(document).ready(function(){
dialog.alert({ dialog.alert({
content:"현재 단속 정보를 저장하시겠습니까?", content:"현재 단속 정보를 저장하시겠습니까?",
onOK:() => { onOK:() => {
$P.crdnControl.save($P.formFields.get()); $P.crdnControl.save($P.formFields.get(), true);
} }
}); });
@ -604,8 +632,7 @@ $(document).ready(function(){
var params = { var params = {
"crdnId" : crdnId, "crdnId" : crdnId,
"levyExclSeCd" : levyExclSeCd, "levyExclSeCd" : levyExclSeCd,
"openerPageName" : "cvlc01020-info", "saveCallbackFuncName" : "pageObject['cvlc01020-info']['exclSaveCallback']"
"callbackFuncName" : "pageObject['cvlc01020-info']['exclCallback']",
}; };
ajax.get({ ajax.get({
@ -614,7 +641,7 @@ $(document).ready(function(){
success : resp => { success : resp => {
dialog.open({ dialog.open({
id : "levyExcldialog", id : "levyExcldialog--${pageName}",
title : "부과제외 정보", title : "부과제외 정보",
content : resp, content : resp,
size : "lg", size : "lg",
@ -625,32 +652,13 @@ $(document).ready(function(){
}); });
}; };
$P.exclCallback = function(saved){
if(saved){
var crdnId = $("#crdnId--${pageName}").val();
var cursorKey = "";
var nextKey = $P.provided.getNextKey(crdnId); $P.exclSaveCallback = function(exclInfo){
if(nextKey != ""){
cursorKey = nextKey;
} else {
var prevKey = $P.provided.getPrevKey(crdnId);
if(prevKey != ""){
cursorKey = prevKey;
}
}
$P.provided.refreshList(); var mergeInfo = {...$P.formFields.get(), ...exclInfo}
if(cursorKey != ""){ $P.crdnControl.save(mergeInfo, false);
$P.fnGo(cursorKey); }
} else {
dialog.close("cvlcptInitialDataEditDialog--${openerPageName}");
}
}
};
$P.fnPrev = () => { $P.fnPrev = () => {
var prevKey = $P.provided.getPrevKey($("#crdnId--${pageName}").val()); var prevKey = $P.provided.getPrevKey($("#crdnId--${pageName}").val());
@ -715,7 +723,7 @@ $(document).ready(function(){
dialog.alert({ dialog.alert({
content : "현 자료의 복사본을 생성하겠습니까?", content : "현 자료의 복사본을 생성하겠습니까?",
onOK : () => { onOK : () => {
//$P.crdnControl.copy($P.formFields.get());
} }
}); });
} }

Loading…
Cancel
Save