{
- const regionName = (this.archiveForm.registeredRegionName || '').trim();
- const detailAddress = String(value || '').trim();
- if (!regionName) {
- callback(new Error('请选择省市区'));
- } else if (!detailAddress) {
- callback(new Error('请输入详细地址'));
- } else if (detailAddress.length > 255) {
- callback(new Error('详细地址最多255个字符'));
- } else {
- callback();
- }
- };
return {
form: {},
query: {},
@@ -1749,6 +1753,8 @@ export default {
approved: { label: '审核通过', type: 'success' },
rejected: { label: '审核不通过', type: 'danger' },
},
+ /** 业务字典 mk_template「开启MK」=1 */
+ mkEnabled: false,
formRules: {
customerCode: [{ max: 20, message: '客商编号最多20个字符', trigger: 'blur' }],
fullName: [{ required: true, message: '请输入客商名称', trigger: 'blur' }],
@@ -1771,8 +1777,10 @@ export default {
registeredCapital: [{ validator: validateNonNegative, trigger: 'blur' }],
maxCreditLimit: [{ validator: validateNonNegative, trigger: 'blur' }],
applyCreditLimit: [{ validator: validateNonNegative, trigger: 'blur' }],
+ registeredRegionName: [{ required: true, message: '请选择省市区', trigger: 'change' }],
registeredDetailAddress: [
- { validator: validateRegisteredAddress, trigger: ['change', 'blur'] },
+ { required: true, message: '请输入详细地址', trigger: 'blur' },
+ { max: 255, message: '详细地址最多255个字符', trigger: 'blur' },
],
businessScope: [
{
@@ -2028,6 +2036,7 @@ export default {
this.initDeptTree();
this.initRegionOptions();
this.initBusinessDictionaries();
+ this.initMkEnabled();
this.initScoreQuantificationOptions();
if (this.isArchivePage) {
this.reviewMode = this.$route.query.review === '1';
@@ -2863,12 +2872,12 @@ export default {
handleRegisteredRegionChange(value) {
if (!value || !value.length) {
this.archiveForm.registeredRegionName = '';
- this.$refs.archiveForm?.validateField('registeredDetailAddress');
+ this.$refs.archiveForm?.validateField('registeredRegionName');
return;
}
this.$nextTick(() => {
this.archiveForm.registeredRegionName = this.getRegisteredRegionLabels(value).join('');
- this.$refs.archiveForm?.validateField('registeredDetailAddress');
+ this.$refs.archiveForm?.validateField('registeredRegionName');
});
},
handleInvoiceRegisteredRegionChange(value) {
@@ -2899,6 +2908,15 @@ export default {
this.sortQualificationFiles();
});
},
+ initMkEnabled() {
+ loadMkEnabled()
+ .then(enabled => {
+ this.mkEnabled = !!enabled;
+ })
+ .catch(() => {
+ this.mkEnabled = false;
+ });
+ },
initScoreQuantificationOptions() {
this.scoreQuantificationLoading = true;
return getCreditScoreQuantificationList(1, 9999, { status: 1 })
@@ -4206,30 +4224,37 @@ export default {
// 仅提交时落变更记录;保存不记录
archive.recordChange = true;
if (!this.validateScoreForApproval(archive)) return;
- submit(archive).then(res => {
- const data = res.data.data;
- const id = (data && typeof data === 'object' ? data.id : data) || this.archiveForm.id;
- if (!id) {
- this.closeArchive();
- this.onLoad(this.page);
- this.$message({ type: 'success', message: '保存成功,请在列表提交审批' });
- return;
- }
- const fullName =
- (data && typeof data === 'object' ? data.fullName : '') ||
- archive.fullName ||
- this.archiveForm.fullName ||
- '';
- this.submitCustomerApproval(
- id,
- fullName,
- archive.approvalStatus || this.archiveForm.approvalStatus
- ).then(() => {
- this.closeArchive();
- this.onLoad(this.page);
- this.$message({ type: 'success', message: '提交成功!' });
- });
+ const loading = ElLoading.service({
+ lock: true,
+ text: '提交中',
+ background: 'rgba(255, 255, 255, 0.7)',
});
+ submit(archive)
+ .then(res => {
+ const data = res.data.data;
+ const id = (data && typeof data === 'object' ? data.id : data) || this.archiveForm.id;
+ if (!id) {
+ this.closeArchive();
+ this.onLoad(this.page);
+ this.$message({ type: 'success', message: '保存成功,请在列表提交审批' });
+ return;
+ }
+ const fullName =
+ (data && typeof data === 'object' ? data.fullName : '') ||
+ archive.fullName ||
+ this.archiveForm.fullName ||
+ '';
+ return this.submitCustomerApproval(
+ id,
+ fullName,
+ archive.approvalStatus || this.archiveForm.approvalStatus
+ ).then(() => {
+ this.closeArchive();
+ this.onLoad(this.page);
+ this.$message({ type: 'success', message: '提交成功!' });
+ });
+ })
+ .finally(() => loading.close());
});
},
/**
@@ -4928,6 +4953,24 @@ export default {
this.$message({ type: 'success', message: '已撤回至草稿状态!' });
});
},
+ handleMkAudit(row) {
+ if (!row?.id) {
+ this.$message.warning('客商ID为空,无法打开审核页');
+ return;
+ }
+ getMKApprovalUrl({ bizId: String(row.id) })
+ .then(res => {
+ const url = res?.data?.data;
+ if (!url) {
+ this.$message.error('获取审核跳转地址失败');
+ return;
+ }
+ window.open(url, '_blank');
+ })
+ .catch(() => {
+ this.$message.error('获取审核跳转地址失败');
+ });
+ },
handleApprove(row) {
this.$confirm('是否确认审核通过?', '提示', {
confirmButtonText: '确定',