feat: 新增客商填写信用代码后即时回显金蝶供应商编码
This commit is contained in:
@@ -163,6 +163,18 @@ export const queryKingdeeCustomer = creditCode => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 金蝶供应商编码查询(A901-1):新增客商填写信用代码后即时回显
|
||||||
|
export const querySupplierCode = creditCode => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-transport/customer-archive/query-supplier-code',
|
||||||
|
method: 'get',
|
||||||
|
timeout: 30000,
|
||||||
|
params: {
|
||||||
|
creditCode,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const syncKingdee = id => {
|
export const syncKingdee = id => {
|
||||||
return request({
|
return request({
|
||||||
url: '/blade-transport/customer-archive/sync-kingdee',
|
url: '/blade-transport/customer-archive/sync-kingdee',
|
||||||
|
|||||||
@@ -1606,6 +1606,7 @@ import {
|
|||||||
getScoreTemplate,
|
getScoreTemplate,
|
||||||
recognizeBusinessLicenseOcr,
|
recognizeBusinessLicenseOcr,
|
||||||
queryKingdeeCustomer,
|
queryKingdeeCustomer,
|
||||||
|
querySupplierCode,
|
||||||
syncKingdee,
|
syncKingdee,
|
||||||
} from '@/api/vehicle/customer-archive';
|
} from '@/api/vehicle/customer-archive';
|
||||||
import { getRisk, getRiskByName } from '@/api/business/hcs';
|
import { getRisk, getRiskByName } from '@/api/business/hcs';
|
||||||
@@ -2492,6 +2493,7 @@ export default {
|
|||||||
const form = this.archiveForm;
|
const form = this.archiveForm;
|
||||||
form.kingdeeStatus = 'none';
|
form.kingdeeStatus = 'none';
|
||||||
form.customerCode = '';
|
form.customerCode = '';
|
||||||
|
form.supplierCode = '';
|
||||||
form.fullName = '';
|
form.fullName = '';
|
||||||
form.legalPerson = '';
|
form.legalPerson = '';
|
||||||
form.registeredCapital = '';
|
form.registeredCapital = '';
|
||||||
@@ -2515,7 +2517,21 @@ export default {
|
|||||||
.toUpperCase();
|
.toUpperCase();
|
||||||
if (code.length !== 18 || this.unifiedCreditCodeError(code)) return;
|
if (code.length !== 18 || this.unifiedCreditCodeError(code)) return;
|
||||||
clearTimeout(this.kingdeeQueryTimer);
|
clearTimeout(this.kingdeeQueryTimer);
|
||||||
this.kingdeeQueryTimer = setTimeout(() => this.fetchKingdeeCustomer(code), 500);
|
this.kingdeeQueryTimer = setTimeout(() => {
|
||||||
|
this.fetchKingdeeCustomer(code);
|
||||||
|
this.fetchSupplierCode(code);
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
// 新增态下信用代码录入后即时查询金蝶供应商编码(A901-1)回显,查询失败静默留空,保存/同步时后端兜底落库
|
||||||
|
async fetchSupplierCode(code) {
|
||||||
|
try {
|
||||||
|
const res = await querySupplierCode(code);
|
||||||
|
// 防止响应返回时用户已修改代码
|
||||||
|
if (String(this.archiveForm.unifiedCreditCode || '').trim().toUpperCase() !== code) return;
|
||||||
|
this.archiveForm.supplierCode = res?.data?.data || '';
|
||||||
|
} catch (error) {
|
||||||
|
// 忽略查询异常,编码留空
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async fetchKingdeeCustomer(code) {
|
async fetchKingdeeCustomer(code) {
|
||||||
let customer = null;
|
let customer = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user