납부자 조회 콜백 수정

main
이범준 1 year ago
parent d2e04d91b9
commit 259366567c

@ -125,7 +125,7 @@
<i class="fa-solid fa-pen"></i>
</button>
</div>
<div class="col-md-6">
<div class="col-md-12">
<label for="zip--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">우편번호</label>
<input type="text" id="zip--${pageName}" name="zip" data-map="ZIP" class="form-control w-px-100"
readonly maxlength="7" pattern="(\d{3}-\d{3}|\d{6}|\d{5})" />
@ -140,9 +140,6 @@
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR"
class="form-control w-px-700" readonly data-maxlengthb="200" />
</div>
<div class="col-md-6">
</div>
</div>
<div class="row g-1">
<div class="col-md-4">
@ -464,12 +461,51 @@ $(document).ready(function(){
title : dialogTitle,
content : resp,
size : "lg",
onClose : () => { } // callback
onClose : () => { $P.refreshPayer(); } // callback
});
}
});
}
$P.refreshPayer = () => {
var params = {
callPurpose : "refresh",
crdnId : "",
sggCd : $("#sggCd--${pageName}").val(),
taskSeCd : $("#taskSeCd--${pageName}").val(),
delYn : "N"
};
ajax.get({
url : wctx.url("/"+params.taskSeCd + "/sprt/sprt02/020/info.do"),
headers: { Accept: "application/json; charset=utf-8" },
data : params || {},
success : resp => {
if (resp.crdnPayer) {
var payer = resp.crdnPayer;
$("#rtpyrId--${pageName}").val(payer.RTPYR_ID).change();
$("#rtpyrNm--${pageName}").val(payer.RTPYR_NM).change();
$("#rtpyrSeCd--${pageName}").val(payer.RTPYR_SE_CD).change();
$("#rtpyrNo--${pageName}").val(payer.RTPYR_NO).change();
$("#zip--${pageName}").val(payer.ZIP).change();
$("#addr--${pageName}").val(payer.ADDR).change();
$("#dtlAddr--${pageName}").val(payer.DTL_ADDR).change();
} else {
$("#rtpyrId--${pageName}").val("").change();
$("#rtpyrNm--${pageName}").val("").change();
$("#rtpyrSeCd--${pageName}").val("").change();
$("#rtpyrNo--${pageName}").val("").change();
$("#zip--${pageName}").val("").change();
$("#addr--${pageName}").val("").change();
$("#dtlAddr--${pageName}").val("").change();
}
}
});
}
/**************************************************************************
* 초기화(업무별 입력항목)
**************************************************************************/

@ -161,6 +161,11 @@
<i class="fa-solid fa-pen"></i>
</button>
</div>
<div class="col-md-12">
<label for="zip--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">우편번호</label>
<input type="text" id="zip--${pageName}" name="zip" data-map="ZIP" class="form-control w-px-100"
readonly maxlength="7" pattern="(\d{3}-\d{3}|\d{6}|\d{5})" />
</div>
<div class="col-md-12">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">주소</label>
<input type="text" id="addr--${pageName}" name="addr" data-map="ADDR"
@ -171,14 +176,6 @@
<input type="text" id="dtlAddr--${pageName}" name="dtlAddr" data-map="DTL_ADDR"
class="form-control w-px-700" readonly data-maxlengthb="200" />
</div>
<div class="col-md-6">
<label for="zip--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">우편번호</label>
<input type="text" id="zip--${pageName}" name="zip" data-map="ZIP" class="form-control w-px-100"
readonly maxlength="7" pattern="(\d{3}-\d{3}|\d{6}|\d{5})" />
</div>
<div class="col-md-6">
</div>
</div>
<div class="row g-1">
<div class="col-md-4">
@ -807,7 +804,7 @@ $(document).ready(function(){
$P.fnPopPayer = () => {
var callPurpose = "";
var dialogTitle = "";
if($("#rtpyrId--${pageName}").val() == "" || $("#rtpyrId--${pageName}").val() == null){
if($("#rtpyrId--${pageName}").val() == null || $("#rtpyrId--${pageName}").val() == ""){
callPurpose = "create";
dialogTitle = "납부자 등록";
} else {
@ -835,13 +832,52 @@ $(document).ready(function(){
title : dialogTitle,
content : resp,
size : "lg",
onClose : () => { } // callback
onClose : () => { $P.refreshPayer(); } // callback
});
}
});
}
$P.refreshPayer = () => {
var params = {
callPurpose : "refresh",
crdnId : $("#crdnId--${pageName}").val(),
sggCd : $("#sggCd--${pageName}").val(),
taskSeCd : $("#taskSeCd--${pageName}").val(),
delYn : "N"
};
ajax.get({
url : wctx.url("/"+params.taskSeCd + "/sprt/sprt02/020/info.do"),
headers: { Accept: "application/json; charset=utf-8" },
data : params || {},
success : resp => {
if (resp.crdnPayer) {
var payer = resp.crdnPayer;
$("#rtpyrId--${pageName}").val(payer.RTPYR_ID).change();
$("#rtpyrNm--${pageName}").val(payer.RTPYR_NM).change();
$("#rtpyrSeCd--${pageName}").val(payer.RTPYR_SE_CD).change();
$("#rtpyrNo--${pageName}").val(payer.RTPYR_NO).change();
$("#zip--${pageName}").val(payer.ZIP).change();
$("#addr--${pageName}").val(payer.ADDR).change();
$("#dtlAddr--${pageName}").val(payer.DTL_ADDR).change();
} else {
$("#rtpyrId--${pageName}").val("").change();
$("#rtpyrNm--${pageName}").val("").change();
$("#rtpyrSeCd--${pageName}").val("").change();
$("#rtpyrNo--${pageName}").val("").change();
$("#zip--${pageName}").val("").change();
$("#addr--${pageName}").val("").change();
$("#dtlAddr--${pageName}").val("").change();
}
}
});
}
/**************************************************************************
* 초기화(업무별 입력항목)
**************************************************************************/

Loading…
Cancel
Save