金蝶单据状态着色并悬浮展示失败原因+认领流水认领记录的改造 #9
@@ -1,4 +1,5 @@
|
||||
import { createCrudApi } from './common';
|
||||
import { APPROVE_TIMEOUT } from '@/api/common';
|
||||
import request from '@/axios';
|
||||
|
||||
const baseUrl = '/blade-transport/contract-change';
|
||||
@@ -35,8 +36,7 @@ export const approve = id =>
|
||||
url: `${baseUrl}/approve`,
|
||||
method: 'post',
|
||||
params: { id },
|
||||
// 审批通过后同步推送合规(附件转传可达 20s+),覆盖全局 10s 超时
|
||||
timeout: 120000,
|
||||
timeout: APPROVE_TIMEOUT,
|
||||
});
|
||||
|
||||
export const reject = id =>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createCrudApi } from './common';
|
||||
import { APPROVE_TIMEOUT } from '@/api/common';
|
||||
import request from '@/axios';
|
||||
|
||||
const baseUrl = '/blade-transport/contract-manage';
|
||||
@@ -36,8 +37,7 @@ export const approve = id =>
|
||||
url: `${baseUrl}/approve`,
|
||||
method: 'post',
|
||||
params: { id },
|
||||
// 审批通过后同步推送合规(附件转传可达 20s+),覆盖全局 10s 超时
|
||||
timeout: 120000,
|
||||
timeout: APPROVE_TIMEOUT,
|
||||
});
|
||||
|
||||
export const reject = id =>
|
||||
|
||||
@@ -69,11 +69,11 @@ export const refreshMasterData = () =>
|
||||
timeout: 60000,
|
||||
});
|
||||
|
||||
export const getRisk = customerCode =>
|
||||
export const getRisk = (customerCode, creditCode, customerName) =>
|
||||
request({
|
||||
url: `${baseUrl}/risk`,
|
||||
method: 'get',
|
||||
params: { customerCode },
|
||||
params: { customerCode, creditCode, customerName },
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createCrudApi } from './common';
|
||||
import { APPROVE_TIMEOUT } from '@/api/common';
|
||||
import request from '@/axios';
|
||||
|
||||
const baseUrl = '/blade-transport/project-change';
|
||||
@@ -35,6 +36,7 @@ export const approve = id =>
|
||||
url: `${baseUrl}/approve`,
|
||||
method: 'post',
|
||||
params: { id },
|
||||
timeout: APPROVE_TIMEOUT,
|
||||
});
|
||||
|
||||
export const reject = id =>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import request from '@/axios';
|
||||
import { ElLoading, ElMessage } from 'element-plus';
|
||||
|
||||
/** 审核按钮统一超时:审批通过后可能同步推送金蝶等耗时操作,覆盖全局 10s */
|
||||
export const APPROVE_TIMEOUT = 30000;
|
||||
export const APPROVE_TIMEOUT = 60 * 1000;
|
||||
|
||||
/**
|
||||
* 文件流返回
|
||||
|
||||
@@ -163,6 +163,42 @@ 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,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 金蝶开户行查询(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',
|
||||
|
||||
@@ -621,6 +621,15 @@ export const option = createCrudOption([
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '客商风险',
|
||||
prop: 'customerRisk',
|
||||
slot: true,
|
||||
order: 189,
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '金蝶合同ID',
|
||||
prop: 'kingdeeId',
|
||||
|
||||
@@ -169,7 +169,7 @@ export const paymentApplicationOption = ({
|
||||
{ label: '当前节点', prop: 'currentNode', minWidth: 120, formatter: textFormatter },
|
||||
{ label: '当前处理人', prop: 'currentProcessor', minWidth: 120, formatter: textFormatter },
|
||||
{ label: '金蝶单据号', prop: 'kingdeeBillNo', minWidth: 130, formatter: textFormatter },
|
||||
{ label: '金蝶单据状态', prop: 'kingdeeStatusName', minWidth: 130, formatter: textFormatter },
|
||||
{ label: '金蝶单据状态', prop: 'kingdeeStatusName', slot: true, minWidth: 130 },
|
||||
{ label: '金蝶锁状态', prop: 'kingdeeLockStatus', slot: true, minWidth: 150 },
|
||||
{ label: '附件同步', prop: 'attachmentSyncStatusName', minWidth: 100, formatter: textFormatter },
|
||||
],
|
||||
|
||||
@@ -99,7 +99,8 @@ const buildTableColumns = () =>
|
||||
}
|
||||
// link / status 标记的列统一走单元格插槽
|
||||
if (column.link || column.status) extra.slot = true;
|
||||
if (!extra.formatter) extra.formatter = textFormatter;
|
||||
// 插槽列不挂兜底 formatter:avue 中 formatter 会覆盖单元格插槽渲染
|
||||
if (!extra.slot && !extra.formatter) extra.formatter = textFormatter;
|
||||
return { ...column, ...extra };
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 金蝶单据状态公共映射
|
||||
*/
|
||||
|
||||
/** 金蝶单据状态 → el-tag 颜色类型(failed 状态列表页悬浮展示失败原因) */
|
||||
export const KINGDEE_STATUS_TAG_TYPES = {
|
||||
synced: 'success',
|
||||
paid: 'success',
|
||||
invoiced: 'success',
|
||||
paying: 'warning',
|
||||
failed: 'danger',
|
||||
};
|
||||
|
||||
/** 金蝶单据状态 → el-tag 颜色类型,未映射状态返回 info */
|
||||
export const kingdeeStatusType = status => KINGDEE_STATUS_TAG_TYPES[status] || 'info';
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 客商/合同风险标签公共展示逻辑(黑名单=金蝶黑名单 A801-5 命中,与后端 HcsCreditCheckSupport 口径一致):
|
||||
* 等级与黑名单组合展示、等级在前;内部组织客商默认无风险
|
||||
*/
|
||||
|
||||
/** 金蝶黑名单命中判定(客商档案行:失信类别/列入事由任一非空) */
|
||||
export function isKingdeeBlack(category, reason) {
|
||||
return !!(category || reason);
|
||||
}
|
||||
|
||||
/** 合同行黑名单判定(推送链路按金蝶命中口径落库 kingdeeBlackStatus=yes) */
|
||||
export function isContractBlack(blackStatus) {
|
||||
return String(blackStatus || '').toLowerCase() === 'yes';
|
||||
}
|
||||
|
||||
/** 风险标签文案:riskLevel=C101-1 等级(0/1/2);isBlack=金蝶黑名单命中;customerKind=internal 显示"无风险" */
|
||||
export function resolveRiskTagName(riskLevel, isBlack, customerKind) {
|
||||
const levelName = { 2: '高风险', 1: '中风险', 0: '低风险' }[riskLevel] || '';
|
||||
if (isBlack) return levelName ? `${levelName}、黑名单` : '黑名单';
|
||||
if (levelName) return levelName;
|
||||
if (customerKind === 'internal') return '无风险';
|
||||
return '';
|
||||
}
|
||||
|
||||
/** 是否红色风险标签(黑名单命中或高风险) */
|
||||
export function isRiskyTag(riskLevel, isBlack) {
|
||||
return isBlack || riskLevel === '2';
|
||||
}
|
||||
@@ -38,7 +38,7 @@
|
||||
contract.hcsFdId || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="客商风险">
|
||||
<template v-if="contract.hcsRiskLevel || contract.hcsBlackStatus">
|
||||
<template v-if="contract.hcsRiskLevel || contract.kingdeeBlackStatus">
|
||||
<el-tag
|
||||
v-if="isBlacklist"
|
||||
type="danger"
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
name: 'HcsContractPanel',
|
||||
components: { UploadFilled },
|
||||
props: {
|
||||
// 合同详情行(须含 id/hcsSyncStatus/hcsFdId/hcsRiskLevel/hcsBlackStatus/hcsSpecStatus 等)
|
||||
// 合同详情行(须含 id/hcsSyncStatus/hcsFdId/hcsRiskLevel/kingdeeBlackStatus/hcsSpecStatus 等)
|
||||
contract: { type: Object, required: true },
|
||||
},
|
||||
emits: ['refresh'],
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
return this.contract.hcsSyncMsg || '';
|
||||
},
|
||||
isBlacklist() {
|
||||
return String(this.contract.hcsBlackStatus || '').toLowerCase() === 'yes';
|
||||
return String(this.contract.kingdeeBlackStatus || '').toLowerCase() === 'yes';
|
||||
},
|
||||
specLabel() {
|
||||
return SPEC_STATUS_OPTIONS.find(item => item.value === this.contract.hcsSpecStatus)?.label || '';
|
||||
|
||||
@@ -745,7 +745,7 @@ export default {
|
||||
// 高风险/黑名单客商提示:按合同推送合规留痕 hcs_risk_level/hcs_black_status 判定(与合同详情口径一致)
|
||||
riskTipText() {
|
||||
const riskLevel = String(this.form.hcsRiskLevel || '').trim();
|
||||
const blacklist = String(this.form.hcsBlackStatus || '').toLowerCase() === 'yes';
|
||||
const blacklist = String(this.form.kingdeeBlackStatus || '').toLowerCase() === 'yes';
|
||||
if (riskLevel !== '2' && !blacklist) return '';
|
||||
const parties = [this.form.partyA, this.form.partyB]
|
||||
.map(name => String(name || '').trim())
|
||||
|
||||
@@ -93,6 +93,27 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<!-- 客商风险:等级与金蝶黑名单组合展示(推送链路按金蝶命中口径落库),复用公共展示方法;非无风险标签悬浮见明细 -->
|
||||
<template #customerRisk="{ row }">
|
||||
<el-tooltip
|
||||
v-if="contractRiskTagName(row)"
|
||||
placement="top"
|
||||
effect="dark"
|
||||
popper-class="customer-risk-popper"
|
||||
>
|
||||
<template #content>
|
||||
<div>{{ row.hcsRiskDetail || contractRiskTagName(row) }}</div>
|
||||
</template>
|
||||
<el-tag
|
||||
:type="isContractRisky(row) ? 'danger' : row.hcsRiskLevel === '1' ? 'warning' : 'success'"
|
||||
class="status-text"
|
||||
>
|
||||
{{ contractRiskTagName(row) }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<template #menu="{ row }">
|
||||
<el-link
|
||||
v-if="hasPermission(`${config.permission}_view`)"
|
||||
@@ -1101,6 +1122,7 @@ import {
|
||||
repush as hcsRepush,
|
||||
repushBatch as hcsRepushBatch,
|
||||
} from '@/api/business/hcs';
|
||||
import { isContractBlack, isRiskyTag, resolveRiskTagName } from '@/utils/risk-display';
|
||||
import { Position } from '@element-plus/icons-vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||
@@ -1634,7 +1656,7 @@ export default {
|
||||
// 详情风险客商提示(基本信息备注后展示):按推送留痕 hcs_risk_level/hcs_black_status 判定(甲乙取高/任一),文案与后端 riskTip 一致
|
||||
detailRiskTipText() {
|
||||
const riskLevel = String(this.detailRow.hcsRiskLevel || '').trim();
|
||||
const blacklist = String(this.detailRow.hcsBlackStatus || '').toLowerCase() === 'yes';
|
||||
const blacklist = String(this.detailRow.kingdeeBlackStatus || '').toLowerCase() === 'yes';
|
||||
if (riskLevel !== '2' && !blacklist) return '';
|
||||
const parties = [this.detailRow.partyA, this.detailRow.partyB]
|
||||
.map(name => String(name || '').trim())
|
||||
@@ -1774,6 +1796,13 @@ export default {
|
||||
hcsSyncLabel(value) {
|
||||
return { unsynced: '待推送', synced: '已推送', failed: '推送失败' }[value] || value;
|
||||
},
|
||||
// ==================== 客商风险(推送链路按金蝶黑名单命中口径落库,展示复用公共方法) ====================
|
||||
contractRiskTagName(row) {
|
||||
return resolveRiskTagName(row.hcsRiskLevel, isContractBlack(row.kingdeeBlackStatus));
|
||||
},
|
||||
isContractRisky(row) {
|
||||
return isRiskyTag(row.hcsRiskLevel, isContractBlack(row.kingdeeBlackStatus));
|
||||
},
|
||||
hcsSyncTagType(value) {
|
||||
return { unsynced: 'info', synced: 'success', failed: 'danger' }[value] || 'info';
|
||||
},
|
||||
@@ -3819,4 +3848,10 @@ export default {
|
||||
white-space: normal;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* 风险客商悬浮提示(同客商列表页):popper 挂在 body 下,约束宽度 */
|
||||
.customer-risk-popper {
|
||||
max-width: 360px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -293,6 +293,12 @@
|
||||
<el-input v-model="row.remark" :disabled="readonly" maxlength="200" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="readonly" label="开票状态" min-width="90" align="center">
|
||||
<template #default="{ row }">{{ sheet.invoiceStatusName || '未开票' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="readonly" label="金蝶开票结果备注" min-width="200">
|
||||
<template #default="{ row }">{{ sheet.kingdeeResultRemark }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!readonly" label="操作" width="110" fixed="right" align="center">
|
||||
<template #default="{ $index }">
|
||||
<div class="invoice-form-page__links">
|
||||
|
||||
@@ -125,6 +125,17 @@
|
||||
{{ displayValue(row[column.prop]) }}
|
||||
</el-tag>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<template v-else-if="column.prop === 'kingdeeStatusName'">
|
||||
<el-tooltip
|
||||
:disabled="row.kingdeeStatus !== 'failed'"
|
||||
:content="row.kingdeeFailReason || '推送金蝶失败,可点击「同步金蝶」重试'"
|
||||
placement="top"
|
||||
>
|
||||
<el-tag :type="kingdeeStatusType(row.kingdeeStatus)">{{
|
||||
row.kingdeeStatusName || '-'
|
||||
}}</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'kingdeeLockStatus'">
|
||||
<el-tooltip v-if="lockTag(row).show" :content="lockTag(row).tip" placement="top">
|
||||
<el-tag :type="lockTag(row).type" class="status-text">{{ lockTag(row).label }}</el-tag>
|
||||
@@ -238,6 +249,7 @@ import TableHeaderTools from '@/components/table-header-tools/main.vue';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import { kingdeeStatusType } from '@/utils/kingdee';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
applicationNo: '',
|
||||
@@ -500,6 +512,7 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
kingdeeStatusType,
|
||||
lockTag(row) {
|
||||
if (row.kingdeeLockStatus === 'locked') {
|
||||
return { show: true, type: 'danger', label: '金蝶锁定中', tip: '该单据已被金蝶锁定,不可编辑/作废' };
|
||||
|
||||
@@ -883,8 +883,6 @@ export default {
|
||||
// 收款方 C101-1 风险查询留档:risky=高风险/黑名单,tip=后端拼装提示文案
|
||||
payeeRisky: false,
|
||||
payeeRiskTip: '',
|
||||
payeeRiskLevel: '',
|
||||
payeeBlackStatus: '',
|
||||
attachmentRuleLoading: false,
|
||||
// 最近一次从结算单同步过来的附件 URL,切换结算单时用于整批替换
|
||||
linkedSettlementAttachmentUrls: [],
|
||||
@@ -1065,14 +1063,12 @@ export default {
|
||||
.toUpperCase();
|
||||
return ['D', 'D级', 'E', 'E级', 'F', 'F级'].includes(level) || level.includes('高风险');
|
||||
},
|
||||
// 高风险/黑名单收款方提示(C101-1,同合同新增页风险客商提示口径;强制拦截在后端提交校验与金蝶推送门禁)
|
||||
// 高风险/黑名单收款方提示(C101-1,强制拦截在后端提交校验与金蝶推送门禁):
|
||||
// 等级/黑名单明细以后端 riskTip 为准(黑名单=金蝶命中、等级=C101-1,统一口径),前端不再重复拼接
|
||||
payeeRiskText() {
|
||||
if (!this.payeeRisky) return '';
|
||||
const levelMap = { 0: '低风险', 1: '中风险', 2: '高风险' };
|
||||
const level = levelMap[this.payeeRiskLevel] || '未知';
|
||||
const blacklist = String(this.payeeBlackStatus || '').trim().toLowerCase() === 'yes' ? '是' : '否';
|
||||
const tip = this.payeeRiskTip || `收款方[${this.form.payeeName || ''}]为高风险/黑名单客商`;
|
||||
return `风险等级:${level}|黑名单:${blacklist}。${tip},按集团规定不可直接付款,提交前须上传「特批附件」类型附件,审批通过后将自动发起付款特批`;
|
||||
return `${tip},按集团规定不可直接付款,提交前须上传「特批附件」类型附件,审批通过后将自动发起付款特批`;
|
||||
},
|
||||
requiredAttachmentMaterials() {
|
||||
if (this.form.paymentType === 'project_advance') {
|
||||
@@ -2341,8 +2337,6 @@ export default {
|
||||
this.payeeCustomerLevel = '';
|
||||
this.payeeRisky = false;
|
||||
this.payeeRiskTip = '';
|
||||
this.payeeRiskLevel = '';
|
||||
this.payeeBlackStatus = '';
|
||||
if (!partyBName) {
|
||||
if (!preserveCurrentValue) this.clearReceiptAccount();
|
||||
return;
|
||||
@@ -2381,8 +2375,6 @@ export default {
|
||||
const risk = this.unwrapData(await getCustomerRisk(detail.customerCode)) || {};
|
||||
this.payeeRisky = Boolean(risk.risky);
|
||||
this.payeeRiskTip = risk.riskTip || '';
|
||||
this.payeeRiskLevel = risk.fdRiskLevel || '';
|
||||
this.payeeBlackStatus = risk.fdBlackStatus || '';
|
||||
} catch (error) {
|
||||
// 忽略风险查询异常,提交时后端 C101-1 强校验兜底
|
||||
}
|
||||
@@ -2702,7 +2694,8 @@ export default {
|
||||
this.referenceParams('formal')
|
||||
);
|
||||
const data = this.unwrapData(response) || {};
|
||||
const records = data.records || [];
|
||||
// 已调整的结算单为调整重推后的归档原单,金额已作废,不可再发起付款
|
||||
const records = (data.records || []).filter(row => row.adjustStatus !== 'adjusted');
|
||||
this.formalRows = await this.fillReferencePayableAmounts(records, 'settlement_payment');
|
||||
this.formalPage.total = Number(data.total || 0);
|
||||
} finally {
|
||||
@@ -3124,18 +3117,21 @@ export default {
|
||||
if (!target) return;
|
||||
target.paymentRatio = value;
|
||||
this.syncRowPayment(target, 'ratio');
|
||||
this.syncHeaderSettlementTotalsFromRows();
|
||||
this.syncHeaderSettlementTotalsFromRows(true);
|
||||
},
|
||||
handleRowAppliedAmountChange(row, value) {
|
||||
const target = this.findReferenceRow(row);
|
||||
if (!target) return;
|
||||
target.appliedAmount = value;
|
||||
this.syncRowPayment(target, 'amount');
|
||||
this.syncHeaderSettlementTotalsFromRows();
|
||||
this.syncHeaderSettlementTotalsFromRows(true);
|
||||
},
|
||||
/** 多结算单时仅同步结算金额/可付款金额合计,申请付款金额与比例由上方独立维护 */
|
||||
syncHeaderSettlementTotalsFromRows() {
|
||||
if (this.referenceRows.length <= 1) return;
|
||||
/**
|
||||
* 结算信息行合计回填付款基本信息。
|
||||
* @param {boolean} syncApplied 行内编辑时同步申请付款金额与比例;回显加载时保持原值,避免改写历史单据
|
||||
*/
|
||||
syncHeaderSettlementTotalsFromRows(syncApplied = false) {
|
||||
if (!this.referenceRows.length) return;
|
||||
const settlementAmount = this.referenceRows.reduce(
|
||||
(total, item) => total + Number(item.settlementAmount || 0),
|
||||
0
|
||||
@@ -3144,9 +3140,21 @@ export default {
|
||||
(total, item) => total + Number(item.payableAmount || 0),
|
||||
0
|
||||
);
|
||||
const appliedAmount = this.referenceRows.reduce(
|
||||
(total, item) => total + Number(item.appliedAmount || 0),
|
||||
0
|
||||
);
|
||||
this.amountSyncing = true;
|
||||
this.form.settlementAmount = Number(settlementAmount.toFixed(2));
|
||||
this.form.payableAmount = Number(payableAmount.toFixed(2));
|
||||
if (syncApplied) {
|
||||
this.form.appliedAmount = Number(appliedAmount.toFixed(2));
|
||||
if (this.paymentAmountBase) {
|
||||
this.form.paymentRatio = Number(
|
||||
((appliedAmount / this.paymentAmountBase) * 100).toFixed(2)
|
||||
);
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.amountSyncing = false;
|
||||
this.$refs.formRef?.validateField?.(['settlementAmount', 'appliedAmount']);
|
||||
@@ -3320,6 +3328,18 @@ export default {
|
||||
ElMessage.warning(`${exceededRow.settlementNo || '结算单'}付款金额不能超过可付款金额`);
|
||||
return false;
|
||||
}
|
||||
const rowAppliedTotal = this.referenceRows.reduce(
|
||||
(total, item) => total + Number(item.appliedAmount || 0),
|
||||
0
|
||||
);
|
||||
// 金蝶按付款基本信息申请金额推单,行合计不等时预付建档分摊会与金蝶金额不一致
|
||||
if (Math.abs(rowAppliedTotal - appliedAmount) > 0.005) {
|
||||
this.clearMessages();
|
||||
ElMessage.warning(
|
||||
`结算行付款金额合计${rowAppliedTotal.toFixed(2)}与申请付款金额${appliedAmount.toFixed(2)}不一致,请调整`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.form.paymentType === 'project_advance' && !this.form.projectId) {
|
||||
this.clearMessages();
|
||||
|
||||
@@ -68,6 +68,18 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<template #kingdeeStatusName="{ row }">
|
||||
<el-tooltip
|
||||
:disabled="row.kingdeeStatus !== 'failed'"
|
||||
:content="row.kingdeeFailReason || '推送金蝶失败,可点击「同步金蝶」重试'"
|
||||
placement="top"
|
||||
>
|
||||
<el-tag :type="kingdeeStatusType(row.kingdeeStatus)">{{
|
||||
row.kingdeeStatusName || '-'
|
||||
}}</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template #menu="{ row }">
|
||||
<el-link
|
||||
v-if="hasPermission('payment_application_view')"
|
||||
@@ -151,6 +163,7 @@ import { paymentApplicationOption } from '@/option/payment/paymentApplication';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import { kingdeeStatusType } from '@/utils/kingdee';
|
||||
|
||||
const paymentApplicationListRoute = '/payment/payment-application';
|
||||
const paymentApplicationListRefreshKey = 'payment-application-list-refresh';
|
||||
@@ -328,15 +341,17 @@ export default {
|
||||
this.refreshChange();
|
||||
},
|
||||
async handleApprove(row) {
|
||||
// 防止重复点击:请求进行中忽略后续点击
|
||||
// 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示
|
||||
if (this.approveLoading) return;
|
||||
this.approveLoading = true;
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '审批处理中,请稍候…',
|
||||
background: 'rgba(255, 255, 255, 0.6)',
|
||||
});
|
||||
let loading = null;
|
||||
try {
|
||||
await this.$confirm('确认审批通过该付款申请?', '提示', { type: 'warning' });
|
||||
loading = this.$loading({
|
||||
lock: true,
|
||||
text: '审批处理中,请稍候…',
|
||||
background: 'rgba(255, 255, 255, 0.6)',
|
||||
});
|
||||
const res = await api.approve({ id: row.id });
|
||||
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
||||
if (res.data.data === false) {
|
||||
@@ -346,7 +361,7 @@ export default {
|
||||
}
|
||||
this.refreshChange();
|
||||
} finally {
|
||||
loading.close();
|
||||
loading?.close();
|
||||
this.approveLoading = false;
|
||||
}
|
||||
},
|
||||
@@ -461,6 +476,7 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
kingdeeStatusType,
|
||||
lockTag(row) {
|
||||
if (row.kingdeeLockStatus === 'locked') {
|
||||
return { show: true, type: 'danger', label: '金蝶锁定中', tip: '该单据已被金蝶锁定,不可编辑/作废' };
|
||||
|
||||
@@ -708,7 +708,9 @@
|
||||
:rows="changeRecordDetailRows"
|
||||
/>
|
||||
<template v-if="!pageMode" #footer>
|
||||
<el-button v-if="editable" @click="handleSyncPlaceholder">同步</el-button>
|
||||
<el-button v-if="canSync" type="primary" plain :loading="syncLoading" @click="handleSync"
|
||||
>同步</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button
|
||||
v-if="editable"
|
||||
@@ -724,7 +726,9 @@
|
||||
>
|
||||
</template>
|
||||
<div v-if="pageMode && !publicMode" class="formal-editor__page-actions">
|
||||
<el-button v-if="editable" @click="handleSyncPlaceholder">同步</el-button>
|
||||
<el-button v-if="canSync" type="primary" plain :loading="syncLoading" @click="handleSync"
|
||||
>同步</el-button
|
||||
>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button
|
||||
v-if="editable"
|
||||
@@ -1051,6 +1055,7 @@ import {
|
||||
claimInvoices as claimInvoicesApi,
|
||||
queryInvoicePool,
|
||||
save,
|
||||
syncKingdee,
|
||||
} from '@/api/settlement/formalSettlement';
|
||||
import {
|
||||
getDetail as getPreSettlementDetail,
|
||||
@@ -1128,6 +1133,7 @@ export default {
|
||||
loading: false,
|
||||
draftSaving: false,
|
||||
saving: false,
|
||||
syncLoading: false,
|
||||
form: createFormalSettlementForm(),
|
||||
sources: [],
|
||||
details: [],
|
||||
@@ -1271,6 +1277,16 @@ export default {
|
||||
editable() {
|
||||
return !this.readonly;
|
||||
},
|
||||
// 查看页面「同步」按钮:仅已审批且未同步金蝶(含推送失败)的单据显示,口径与后端推送闸门一致
|
||||
canSync() {
|
||||
return (
|
||||
this.readonly &&
|
||||
!this.publicMode &&
|
||||
this.hasPermission('sync') &&
|
||||
this.form.approvalStatus === 'approved' &&
|
||||
this.form.kingdeeSyncStatus !== 'synced'
|
||||
);
|
||||
},
|
||||
isAdmin() {
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
@@ -2887,8 +2903,30 @@ export default {
|
||||
remark: this.form.remark,
|
||||
};
|
||||
},
|
||||
handleSyncPlaceholder() {
|
||||
this.$message.info('开发中');
|
||||
// 查看页面单张推送金蝶(A102-2/A302-2):结果与异常原因弹框展示,成败后均刷新详情与列表
|
||||
async handleSync() {
|
||||
if (this.syncLoading) return;
|
||||
this.syncLoading = true;
|
||||
try {
|
||||
const res = await syncKingdee(this.form.id, { meta: { suppressErrorMessage: true } });
|
||||
await this.loadFormalDetail(this.recordId);
|
||||
this.$emit('success');
|
||||
let message = `同步成功:${this.unwrapData(res) || '-'}`;
|
||||
if (['pending', 'partial'].includes(this.form.attachmentSyncStatus)) {
|
||||
message += '\n该单附件未全部上传,可重推补传';
|
||||
}
|
||||
await this.$alert(message, '同步结果', { type: 'success', confirmButtonText: '知道了' });
|
||||
} catch (error) {
|
||||
const reason = String(error?.message || error || '未知错误').trim() || '未知错误';
|
||||
await this.loadFormalDetail(this.recordId);
|
||||
this.$emit('success');
|
||||
await this.$alert(`同步失败,${reason}`, '同步结果', {
|
||||
type: 'error',
|
||||
confirmButtonText: '知道了',
|
||||
});
|
||||
} finally {
|
||||
this.syncLoading = false;
|
||||
}
|
||||
},
|
||||
async handleDraftSave() {
|
||||
// 保存草稿:不做表单校验,直接落草稿并返回列表刷新
|
||||
|
||||
@@ -60,7 +60,17 @@
|
||||
}}</el-tag>
|
||||
</template>
|
||||
|
||||
<template #kingdeeSyncStatus="{ row }">{{ kingdeeSyncName(row.kingdeeSyncStatus) }}</template>
|
||||
<template #kingdeeSyncStatus="{ row }">
|
||||
<el-tooltip
|
||||
:disabled="row.kingdeeSyncStatus !== 'failed'"
|
||||
:content="row.kingdeeFailReason || '推送金蝶失败,可点击「同步金蝶」重试'"
|
||||
placement="top"
|
||||
>
|
||||
<el-tag :type="kingdeeStatusType(row.kingdeeSyncStatus)">{{
|
||||
kingdeeSyncName(row.kingdeeSyncStatus)
|
||||
}}</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template #kingdeeLockStatus="{ row }">
|
||||
<el-tooltip v-if="lockTag(row).show" :content="lockTag(row).tip" placement="top">
|
||||
@@ -84,6 +94,7 @@
|
||||
<script>
|
||||
import { invoiceStatusName } from '@/option/settlement/formalSettlementSearch';
|
||||
import { kingdeeSyncName, paymentStatusName } from '@/option/settlement/formalSettlement';
|
||||
import { kingdeeStatusType } from '@/utils/kingdee';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementTablePanel',
|
||||
@@ -186,6 +197,7 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
kingdeeStatusType,
|
||||
invoiceName(value, settlementType) {
|
||||
return invoiceStatusName(value, settlementType);
|
||||
},
|
||||
|
||||
@@ -507,6 +507,8 @@ export default {
|
||||
const rows = this.selection;
|
||||
if (rows.some(row => row.approvalStatus !== 'approved' || row.settlementType !== 'payable'))
|
||||
return this.$message.warning('仅审批通过的付款结算单允许发起付款申请');
|
||||
if (rows.some(row => row.adjustStatus === 'adjusted'))
|
||||
return this.$message.warning('已调整的结算单不可再发起付款,请使用调整后的新单');
|
||||
const contractIds = new Set(rows.map(row => String(row.contractId || '')));
|
||||
if (contractIds.size !== 1 || contractIds.has(''))
|
||||
return this.$message.warning('付款申请必须选择同一个合同的付款结算单');
|
||||
|
||||
@@ -93,11 +93,15 @@
|
||||
><el-tag v-else-if="column.status" :type="statusType(row.approvalStatus)" class="status-text">{{
|
||||
row[column.prop] || '-'
|
||||
}}</el-tag
|
||||
><el-tag
|
||||
><el-tooltip
|
||||
v-else-if="column.kingdee"
|
||||
:disabled="row.kingdeeSyncStatus !== 'failed'"
|
||||
:content="row.kingdeeFailReason || '推送金蝶失败,请重试'"
|
||||
placement="top"
|
||||
><el-tag
|
||||
:type="kingdeeStatusType(row.kingdeeSyncStatus)"
|
||||
class="status-text"
|
||||
>{{ kingdeeSyncName(row.kingdeeSyncStatus) }}</el-tag
|
||||
></el-tooltip
|
||||
><span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span
|
||||
><span v-else>{{ displayValue(row[column.prop]) }}</span></template
|
||||
></el-table-column
|
||||
@@ -182,6 +186,7 @@ import { settlementAdjustmentSearchFields } from '@/option/settlement/settlement
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { settlementAdjustmentTableColumns } from '@/option/settlement/settlementAdjustmentTable';
|
||||
import { kingdeeSyncStatusOptions } from '@/option/settlement/formalSettlementSearch';
|
||||
import { kingdeeStatusType } from '@/utils/kingdee';
|
||||
import SettlementAdjustmentEditor from './components/settlement-adjustment-editor.vue';
|
||||
import SettlementTableTools from './components/settlement-table-tools.vue';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
@@ -369,9 +374,7 @@ export default {
|
||||
'info'
|
||||
);
|
||||
},
|
||||
kingdeeStatusType(status) {
|
||||
return { synced: 'success', failed: 'danger' }[status] || 'info';
|
||||
},
|
||||
kingdeeStatusType,
|
||||
kingdeeSyncName(value) {
|
||||
return kingdeeSyncStatusOptions.find(item => item.value === value)?.label || value || '-';
|
||||
},
|
||||
|
||||
@@ -49,24 +49,27 @@
|
||||
</template>
|
||||
<template #customerRisk="{ row }">
|
||||
<el-tooltip
|
||||
v-if="customerRiskMap[row.customerCode] && customerRiskMap[row.customerCode].risky"
|
||||
v-if="customerRowRiskName(row) && customerRowRiskName(row) !== '无风险'"
|
||||
placement="top"
|
||||
effect="dark"
|
||||
popper-class="customer-risk-popper"
|
||||
>
|
||||
<template #content>
|
||||
<div>{{ customerRiskMap[row.customerCode].riskTip || '该客商为高风险/黑名单客商' }}</div>
|
||||
<div>{{ row.hcsRiskDetail || customerRowRiskName(row) }}</div>
|
||||
</template>
|
||||
<el-tag type="danger" class="status-text">
|
||||
{{ customerRiskLabel(customerRiskMap[row.customerCode]) }}
|
||||
<el-tag
|
||||
:type="customerRowRisky(row) ? 'danger' : row.hcsRiskLevel === '1' ? 'warning' : 'success'"
|
||||
class="status-text"
|
||||
>
|
||||
{{ customerRowRiskName(row) }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tag
|
||||
v-else-if="customerRiskMap[row.customerCode]"
|
||||
:type="customerRiskMap[row.customerCode].fdRiskLevel === '1' ? 'warning' : 'success'"
|
||||
v-else-if="customerRowRiskName(row)"
|
||||
type="success"
|
||||
class="status-text"
|
||||
>
|
||||
{{ customerRiskLabel(customerRiskMap[row.customerCode]) }}
|
||||
{{ customerRowRiskName(row) }}
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
@@ -135,7 +138,13 @@
|
||||
<template #kingdeeStatus="{ row }">
|
||||
<el-tag v-if="row.kingdeeStatus === 'synced'" type="success">已推送</el-tag>
|
||||
<el-tag v-else-if="row.kingdeeStatus === 'exist'" type="primary">金蝶已有</el-tag>
|
||||
<el-tag v-else-if="row.kingdeeStatus === 'failed'" type="danger">推送失败</el-tag>
|
||||
<el-tooltip
|
||||
v-else-if="row.kingdeeStatus === 'failed'"
|
||||
:content="row.kingdeeFailReason || '推送金蝶失败,请重试'"
|
||||
placement="top"
|
||||
>
|
||||
<el-tag type="danger">推送失败</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tag v-else type="info">未推送</el-tag>
|
||||
</template>
|
||||
<template #menu="{ row }">
|
||||
@@ -285,6 +294,17 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商编码" prop="supplierCode">
|
||||
<el-input
|
||||
v-model="archiveForm.supplierCode"
|
||||
maxlength="64"
|
||||
show-word-limit
|
||||
disabled
|
||||
placeholder="金蝶供应商编码,系统自动获取"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客商类型" prop="customerKind">
|
||||
<el-select
|
||||
@@ -366,7 +386,7 @@
|
||||
<template #content>
|
||||
<div>{{ archiveNameRiskTip || '该客商为高风险/黑名单客商' }}</div>
|
||||
</template>
|
||||
<div class="archive-name-risk">高风险/黑名单客商</div>
|
||||
<div class="archive-name-risk">{{ archiveNameRiskLabel }}</div>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -1080,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" />
|
||||
@@ -1588,10 +1618,14 @@ import {
|
||||
remove,
|
||||
getScoreTemplate,
|
||||
recognizeBusinessLicenseOcr,
|
||||
queryKingdeeBank,
|
||||
queryKingdeeBankByNumber,
|
||||
queryKingdeeCustomer,
|
||||
querySupplierCode,
|
||||
syncKingdee,
|
||||
} from '@/api/vehicle/customer-archive';
|
||||
import { getRiskBatch, getRiskByName } from '@/api/business/hcs';
|
||||
import { getRisk, getRiskByName } from '@/api/business/hcs';
|
||||
import { isKingdeeBlack, isRiskyTag, resolveRiskTagName } from '@/utils/risk-display';
|
||||
import {
|
||||
getList as getCreditScoreQuantificationList,
|
||||
getDetail as getCreditScoreQuantificationDetail,
|
||||
@@ -1693,9 +1727,9 @@ export default {
|
||||
deptSearchInitialized: false,
|
||||
loading: true,
|
||||
data: [],
|
||||
customerRiskMap: {},
|
||||
archiveNameRisky: false,
|
||||
archiveNameRiskTip: '',
|
||||
archiveNameRiskLabel: '',
|
||||
page: {
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
@@ -1915,6 +1949,11 @@ export default {
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
label: '供应商编码',
|
||||
prop: 'supplierCode',
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
label: '客商简称',
|
||||
prop: 'shortName',
|
||||
@@ -1957,7 +1996,13 @@ export default {
|
||||
label: '客商风险',
|
||||
prop: 'customerRisk',
|
||||
slot: true,
|
||||
minWidth: 100,
|
||||
search: true,
|
||||
searchType: 'select',
|
||||
searchOrder: 4,
|
||||
searchPlaceholder: '请选择',
|
||||
minWidth: 150,
|
||||
// 选项走业务字典 customer_risk(initBusinessDictionaries 加载:dictKey=筛选值,dictValue=名称),未配置时下拉为空
|
||||
dicData: [],
|
||||
},
|
||||
{
|
||||
label: '客户性质',
|
||||
@@ -2463,6 +2508,7 @@ export default {
|
||||
const form = this.archiveForm;
|
||||
form.kingdeeStatus = 'none';
|
||||
form.customerCode = '';
|
||||
form.supplierCode = '';
|
||||
form.fullName = '';
|
||||
form.legalPerson = '';
|
||||
form.registeredCapital = '';
|
||||
@@ -2478,6 +2524,7 @@ export default {
|
||||
handleKingdeeCreditCodeChange(val) {
|
||||
this.kingdeeBlocked = false;
|
||||
if (this.readonly || this.archiveForm.id) return;
|
||||
this.clearArchiveNameRisk();
|
||||
if (this.archiveForm.kingdeeStatus === 'exist') {
|
||||
this.resetKingdeeBackfill();
|
||||
}
|
||||
@@ -2486,7 +2533,21 @@ export default {
|
||||
.toUpperCase();
|
||||
if (code.length !== 18 || this.unifiedCreditCodeError(code)) return;
|
||||
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) {
|
||||
let customer = null;
|
||||
@@ -2694,6 +2755,7 @@ export default {
|
||||
currentNode: '当前节点',
|
||||
currentProcessor: '当前处理人',
|
||||
customerCode: '客商编号',
|
||||
supplierCode: '供应商编码',
|
||||
shortName: '客商简称',
|
||||
fullName: '客商名称',
|
||||
customerType: '客商分类',
|
||||
@@ -3151,6 +3213,15 @@ export default {
|
||||
});
|
||||
},
|
||||
initBusinessDictionaries() {
|
||||
// 客商风险筛选项走业务字典 customer_risk(dictKey=筛选值 blacklist/high/middle/low,dictValue=名称),字典缺失保留固定兜底项
|
||||
getDictionary({ code: 'customer_risk' }).then(res => {
|
||||
const options = (res.data.data || [])
|
||||
.filter(item => item.dictKey !== '-1')
|
||||
.map(item => ({ label: item.dictValue, value: item.dictKey }));
|
||||
if (options.length) {
|
||||
this.findColumn(this.option.column, 'customerRisk').dicData = options;
|
||||
}
|
||||
});
|
||||
this.loadDictOptions('nature_of_client', 'customerNatureOptions', [], options => {
|
||||
const customerNatureColumn = this.findColumn(this.option.column, 'customerNature');
|
||||
customerNatureColumn.dicData = [{ label: '全部', value: '' }, ...options];
|
||||
@@ -3598,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('确定删除该收款信息?', '提示', {
|
||||
@@ -5499,7 +5602,9 @@ export default {
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = this.buildQuery(params);
|
||||
// Avue 只回传非空筛选项,被清空的字段不会出现在 params 里,
|
||||
// 因此查询条件必须整体重建,不能与上一次的 this.query 合并,否则清空后仍会带上次的值
|
||||
this.query = this.buildQuery(params, true);
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, this.query);
|
||||
done();
|
||||
@@ -5528,52 +5633,56 @@ export default {
|
||||
const pageData = res.data.data;
|
||||
this.page.total = pageData.total;
|
||||
this.data = pageData.records;
|
||||
this.loadCustomerRisk(this.data);
|
||||
this.selectionClear();
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 客商风险标签文案:后端 riskLevelName 转义(黑名单/高风险/中风险/低风险),缺失时兜底
|
||||
customerRiskLabel(risk) {
|
||||
if (!risk) return '';
|
||||
return risk.riskLevelName || (risk.risky ? '风险客商' : '正常');
|
||||
// 黑名单判定:仅以金蝶黑名单(A801-5)命中为准(失信类别/列入事由任一非空);C101-1 的 hcsBlackStatus 不作为黑名单依据
|
||||
customerRowIsBlack(row) {
|
||||
return isKingdeeBlack(row.kingdeeBlackCategory, row.kingdeeBlackReason);
|
||||
},
|
||||
// 客商风险名称(每日定时刷新落库字段):等级与黑名单组合展示(如"低风险、黑名单");内部组织默认无风险;未查询显示"-"
|
||||
customerRowRiskName(row) {
|
||||
return resolveRiskTagName(row.hcsRiskLevel, this.customerRowIsBlack(row), row.customerKind);
|
||||
},
|
||||
// 高风险/黑名单判定(与列表筛选口径一致,命中显示红色标签)
|
||||
customerRowRisky(row) {
|
||||
return isRiskyTag(row.hcsRiskLevel, this.customerRowIsBlack(row));
|
||||
},
|
||||
// 客商名称风险校验(C101-1,仅展示不作为安全边界):名称失焦/回显时查询,
|
||||
// risky 在名称框下展示红色提示,悬浮见风险项明细;查询失败静默不阻断填写,提交链路由后端强校验兜底
|
||||
checkArchiveNameRisk() {
|
||||
// 清空客商名称下风险提示(信用代码变化后原按旧编号+信用代码查询的结果失效)
|
||||
clearArchiveNameRisk() {
|
||||
this.archiveNameRisky = false;
|
||||
this.archiveNameRiskTip = '';
|
||||
this.archiveNameRiskLabel = '';
|
||||
},
|
||||
checkArchiveNameRisk() {
|
||||
this.clearArchiveNameRisk();
|
||||
const customerName = String(this.archiveForm.fullName || '').trim();
|
||||
if (!customerName) return;
|
||||
getRiskByName(customerName)
|
||||
// 新增客商档案本地反查不到编号:金蝶带出后表单已有客商编号,优先按编号查 C101-1,
|
||||
// 并传信用代码供金蝶黑名单(A801-5)兜底;无编号时按名称反查档案
|
||||
const customerCode = String(this.archiveForm.customerCode || '').trim();
|
||||
const request = customerCode
|
||||
? getRisk(customerCode, String(this.archiveForm.unifiedCreditCode || '').trim(), customerName)
|
||||
: getRiskByName(customerName);
|
||||
request
|
||||
.then(res => {
|
||||
const risk = (res.data && res.data.data) || {};
|
||||
this.archiveNameRisky = risk.risky === true;
|
||||
this.archiveNameRiskTip = risk.riskTip || '';
|
||||
// 红字与列表标签同口径(risk-display):等级按合同系统返回值翻译,黑名单按金蝶命中标记独立展示,组合不分家
|
||||
this.archiveNameRiskLabel = this.archiveNameRisky
|
||||
? (resolveRiskTagName(risk.fdRiskLevel, risk.kingdeeBlackHit === true) || '高风险/黑名单') + '客商'
|
||||
: '';
|
||||
})
|
||||
.catch(() => {
|
||||
// 忽略风险查询异常,表单正常填写
|
||||
});
|
||||
},
|
||||
// 客商列表风险批量查询(C101-1,仅展示不作为安全边界):失败静默,行内显示"-",提交链路由后端强校验兜底
|
||||
loadCustomerRisk(rows) {
|
||||
this.customerRiskMap = {};
|
||||
const customerCodes = [...new Set(rows.map(row => row.customerCode).filter(Boolean))];
|
||||
if (!customerCodes.length) return;
|
||||
getRiskBatch(customerCodes)
|
||||
.then(res => {
|
||||
const riskMap = {};
|
||||
((res.data && res.data.data) || []).forEach(risk => {
|
||||
if (risk && risk.customerCode) riskMap[risk.customerCode] = risk;
|
||||
});
|
||||
this.customerRiskMap = riskMap;
|
||||
})
|
||||
.catch(() => {
|
||||
// 忽略风险查询异常,列表正常展示
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.$confirm('是否导出客商档案数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -5601,9 +5710,10 @@ export default {
|
||||
[this.website.tokenHeader]: getToken(),
|
||||
};
|
||||
},
|
||||
buildQuery(params = {}) {
|
||||
// 新条件覆盖旧条件;本次显式清空的字段必须从查询里去掉,避免第二次搜索仍带着上一次的客商名称。
|
||||
const merged = { ...this.query, ...params };
|
||||
// replace=true 表示以本次搜索条件为准整体重建(清空字段不会回传,需丢弃旧条件);
|
||||
// 翻页、刷新等场景传 false,沿用上一次的查询条件
|
||||
buildQuery(params = {}, replace = false) {
|
||||
const merged = replace ? { ...params } : { ...this.query, ...params };
|
||||
Object.keys(params).forEach(key => {
|
||||
const value = params[key];
|
||||
if (
|
||||
@@ -6061,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