feat: 客商收款信息开户行失焦匹配金蝶带出联行号并保存前校验
- 开户行 label 加问号提示,失焦调 A905-3 按行名精确匹配自动回填联行号,未命中提示检查 - 保存前按联行号校验金蝶档案,查不到拦截保存,接口异常提示稍后重试 - 回填后清除联行号字段残留校验提示
This commit is contained in:
@@ -175,6 +175,30 @@ export const querySupplierCode = creditCode => {
|
||||
});
|
||||
};
|
||||
|
||||
// 金蝶开户行查询(A905-3):收款信息填写开户行失焦后精确匹配带出联行号
|
||||
export const queryKingdeeBank = bankName => {
|
||||
return request({
|
||||
url: '/blade-transport/customer-archive/query-bank',
|
||||
method: 'get',
|
||||
timeout: 30000,
|
||||
params: {
|
||||
bankName,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 金蝶联行号校验(A905-3):收款信息保存前按联行号精确匹配,查不到不允许保存
|
||||
export const queryKingdeeBankByNumber = cnapsCode => {
|
||||
return request({
|
||||
url: '/blade-transport/customer-archive/query-bank-by-number',
|
||||
method: 'get',
|
||||
timeout: 30000,
|
||||
params: {
|
||||
cnapsCode,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const syncKingdee = id => {
|
||||
return request({
|
||||
url: '/blade-transport/customer-archive/sync-kingdee',
|
||||
|
||||
@@ -1100,8 +1100,18 @@
|
||||
<el-form-item label="开户人姓名" prop="accountHolderName">
|
||||
<el-input v-model="receiptForm.accountHolderName" maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input v-model="receiptForm.bankName" maxlength="100" />
|
||||
<el-form-item prop="bankName">
|
||||
<template #label>
|
||||
<span class="receipt-bank-label">
|
||||
开户行
|
||||
<el-tooltip placement="top" effect="dark" content="请填写银行全称,系统将自动匹配金蝶档案带出联行号">
|
||||
<el-icon class="receipt-bank-help">
|
||||
<el-icon-question-filled />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<el-input v-model="receiptForm.bankName" maxlength="100" @blur="fetchReceiptCnapsCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联行号" prop="cnapsCode">
|
||||
<el-input v-model="receiptForm.cnapsCode" maxlength="32" />
|
||||
@@ -1608,6 +1618,8 @@ import {
|
||||
remove,
|
||||
getScoreTemplate,
|
||||
recognizeBusinessLicenseOcr,
|
||||
queryKingdeeBank,
|
||||
queryKingdeeBankByNumber,
|
||||
queryKingdeeCustomer,
|
||||
querySupplierCode,
|
||||
syncKingdee,
|
||||
@@ -3657,18 +3669,50 @@ export default {
|
||||
this.receiptForm = this.emptyReceiptAccount();
|
||||
this.$refs.receiptForm?.clearValidate();
|
||||
},
|
||||
saveReceipt() {
|
||||
this.$refs.receiptForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
const receipt = this.normalizeReceipt(this.receiptForm);
|
||||
if (this.receiptIndex > -1) {
|
||||
this.archiveForm.receiptAccounts.splice(this.receiptIndex, 1, receipt);
|
||||
// 开户行失焦后按行名精确匹配金蝶行名行号档案(A905-3),命中自动带出联行号,未命中提示检查
|
||||
async fetchReceiptCnapsCode() {
|
||||
const bankName = String(this.receiptForm.bankName || '').trim();
|
||||
if (!bankName) return;
|
||||
try {
|
||||
const res = await queryKingdeeBank(bankName);
|
||||
// 防止响应返回时用户已修改开户行
|
||||
if (String(this.receiptForm.bankName || '').trim() !== bankName) return;
|
||||
const bank = res?.data?.data || null;
|
||||
if (bank && bank.unionNumber) {
|
||||
this.receiptForm.cnapsCode = bank.unionNumber;
|
||||
this.$refs.receiptForm?.clearValidate('cnapsCode');
|
||||
} else {
|
||||
this.archiveForm.receiptAccounts.push(receipt);
|
||||
this.handleDetailCurrentChange('receipt', this.getDetailPageCount('receipt'));
|
||||
this.$message.warning('未查询到金蝶开户行信息,请检查开户行名称');
|
||||
}
|
||||
this.receiptBox = false;
|
||||
});
|
||||
} catch (error) {
|
||||
// 忽略查询异常,联行号留空由用户手填
|
||||
}
|
||||
},
|
||||
async saveReceipt() {
|
||||
const valid = await this.$refs.receiptForm.validate().catch(() => false);
|
||||
if (!valid) return;
|
||||
// 保存前按联行号精确校验金蝶行名行号档案(A905-3),查不到不允许保存
|
||||
const cnapsCode = String(this.receiptForm.cnapsCode || '').trim();
|
||||
let bank = null;
|
||||
try {
|
||||
const res = await queryKingdeeBankByNumber(cnapsCode);
|
||||
bank = res?.data?.data || null;
|
||||
} catch (error) {
|
||||
this.$message.warning('金蝶联行号校验失败,请稍后重试');
|
||||
return;
|
||||
}
|
||||
if (!bank || !bank.unionNumber) {
|
||||
this.$message.warning('未查询到金蝶联行号信息,不能保存,请检查联行号');
|
||||
return;
|
||||
}
|
||||
const receipt = this.normalizeReceipt(this.receiptForm);
|
||||
if (this.receiptIndex > -1) {
|
||||
this.archiveForm.receiptAccounts.splice(this.receiptIndex, 1, receipt);
|
||||
} else {
|
||||
this.archiveForm.receiptAccounts.push(receipt);
|
||||
this.handleDetailCurrentChange('receipt', this.getDetailPageCount('receipt'));
|
||||
}
|
||||
this.receiptBox = false;
|
||||
},
|
||||
deleteReceipt(index) {
|
||||
this.$confirm('确定删除该收款信息?', '提示', {
|
||||
@@ -6127,6 +6171,19 @@ export default {
|
||||
:deep(.el-select) {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.receipt-bank-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.receipt-bank-help {
|
||||
color: #a8abb2;
|
||||
cursor: help;
|
||||
font-size: 14px;
|
||||
flex: none;
|
||||
}
|
||||
}
|
||||
|
||||
.receipt-dialog__footer-actions {
|
||||
|
||||
Reference in New Issue
Block a user