feat: 合同列表新增客商风险列并抽取风险标签公共展示方法(客商页复用)
This commit is contained in:
@@ -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';
|
||||
}
|
||||
Reference in New Issue
Block a user