|
|
@@ -91,6 +91,9 @@
|
|
|
<!-- 등록/수정 -->
|
|
|
<div class="panelStyle">
|
|
|
<form id="detailForm" name="detailForm" action="#" th:action="@{'/business/supply/company/save'}">
|
|
|
+ <input type="hidden" name="orgBankCd" value=""/>
|
|
|
+ <input type="hidden" name="orgAccountNo" value=""/>
|
|
|
+ <input type="hidden" name="orgDepositorNm" value=""/>
|
|
|
<h4>기본정보</h4>
|
|
|
<table class="frmStyle" aria-describedby="등록/수정 폼">
|
|
|
<colgroup>
|
|
|
@@ -246,6 +249,7 @@
|
|
|
<th>예금주명</th>
|
|
|
<td>
|
|
|
<input type="text" class="w100" name="depositorNm" maxlength="50"/>
|
|
|
+<!-- <button type="button" id="btnAccountCheck" class="btn btn-info btn-sm">계좌인증</button>-->
|
|
|
</td>
|
|
|
<th>사용여부<i class="required" title="필수"></i></th>
|
|
|
<td>
|
|
|
@@ -327,6 +331,7 @@
|
|
|
let supplyStatList = gagajf.convertToArray([[${supplyStatList}]]);
|
|
|
let distributionGbList = gagajf.convertToArray([[${distributionGbList}]]);
|
|
|
let bankList = gagajf.convertToArray([[${bankList}]]);
|
|
|
+ let accountCheck = false;
|
|
|
|
|
|
let columnDefs = [
|
|
|
{ headerName: "업체코드", field: "supplyCompCd", width: 100, cellClass: 'text-center' },
|
|
|
@@ -469,6 +474,9 @@
|
|
|
$('#detailForm select[name=bankCd]').val(event.data.bankCd);
|
|
|
$('#detailForm input[name=accountNo]').val(event.data.accountNo);
|
|
|
$('#detailForm input[name=depositorNm]').val(event.data.depositorNm);
|
|
|
+ $('#detailForm input[name=orgBankCd]').val(event.data.bankCd);
|
|
|
+ $('#detailForm input[name=orgAccountNo]').val(event.data.accountNo);
|
|
|
+ $('#detailForm input[name=orgDepositorNm]').val(event.data.depositorNm);
|
|
|
$('#detailForm textarea[name=remarks]').val(event.data.remarks);
|
|
|
$('#detailForm textarea[name=note]').val(event.data.note);
|
|
|
|
|
|
@@ -516,6 +524,11 @@
|
|
|
if (!gagajf.validation('#detailForm'))
|
|
|
return false;
|
|
|
|
|
|
+ // if (!fnValidationAccount()) {
|
|
|
+ // mcxDialog.alert('계좌 인증을 해주시길 바랍니다.');
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+
|
|
|
mcxDialog.confirm("기본정보를 저장하시겠습니까?", {
|
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
|
@@ -691,6 +704,83 @@
|
|
|
|
|
|
cfnOpenDaumAddr(daumZip);
|
|
|
}
|
|
|
+
|
|
|
+ // 계좌인증
|
|
|
+ $('#btnAccountCheck').on('click', function () {
|
|
|
+ let $bankCd = $('#detailForm select[name=bankCd]');
|
|
|
+ let $accountNo = $('#detailForm input[name=accountNo]');
|
|
|
+ let $depositorNm = $('#detailForm input[name=depositorNm]');
|
|
|
+
|
|
|
+ if (gagajf.isNull($bankCd.val())) {
|
|
|
+ mcxDialog.alertC('은행을 선택해 주세요', {
|
|
|
+ sureBtnText: '확인',
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $bankCd.select();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (gagajf.isNull($accountNo.val())) {
|
|
|
+ mcxDialog.alertC('계좌번호 입력해 주세요', {
|
|
|
+ sureBtnText: '확인',
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $accountNo.focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gagajf.isNull($depositorNm.val())) {
|
|
|
+ mcxDialog.alertC('예금주명 입력해 주세요', {
|
|
|
+ sureBtnText: '확인',
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $depositorNm.focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let custInfo = {};
|
|
|
+ custInfo.bankCd = $bankCd.val();
|
|
|
+ custInfo.accountNm = $accountNo.val();
|
|
|
+ custInfo.accountNo = $depositorNm.val();
|
|
|
+ let jsonData = JSON.stringify(custInfo)
|
|
|
+ gagajf.ajaxJsonSubmit('/business/account/check', jsonData, fnAccountCheckCallback);
|
|
|
+ });
|
|
|
+
|
|
|
+ var fnAccountCheckCallback = function (result) {
|
|
|
+ let msg = '계좌인증에 성공했습니다.'
|
|
|
+ if (result.isValid) { // 유효하면 true
|
|
|
+ accountCheck = true;
|
|
|
+ } else {
|
|
|
+ accountCheck = false;
|
|
|
+ msg = '계좌정보를 다시 확인해주세요.'
|
|
|
+ }
|
|
|
+ mcxDialog.alertC(msg ,{
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnValidationAccount = function () {
|
|
|
+ let bankCd = $('#detailForm select[name=bankCd]').val();
|
|
|
+ let accountNo = $('#detailForm input[name=accountNo]').val();
|
|
|
+ let depositorNm = $('#detailForm input[name=depositorNm]').val();
|
|
|
+
|
|
|
+ let orgBankCd = $('#detailForm select[name=orgBankCd]').val();
|
|
|
+ let orgAccountNo = $('#detailForm input[name=orgAccountNo]').val();
|
|
|
+ let orgDepositorNm = $('#detailForm input[name=orgDepositorNm]').val();
|
|
|
+ // 1. 수정사항이 있는지 확인
|
|
|
+ if (bankCd != orgBankCd && accountNo != orgAccountNo && depositorNm != orgDepositorNm) {
|
|
|
+ if (!accountCheck) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ accountCheck = true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
// Create a agGrid
|