🐛 修复总单地址回填、结算费用英文项与项目部门提示

常用地址级联回填不再误清空;预结算/正式结算过滤 freightJson 杂项;项目查看态业务部门/平台公司支持悬停完整信息。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-29 14:04:55 +08:00
parent 7ba6620f06
commit a528788409
6 changed files with 284 additions and 51 deletions
@@ -3222,10 +3222,47 @@ export default {
return files.length ? JSON.stringify(files) : '';
},
parseFeeItems(value) {
const raw = this.parseRawFeeItems(value);
const metaKeys = new Set([
'currency',
'totalFreightAmount',
'otherFreightAmount',
'freightItems',
'freightTotal',
'totalFreight',
'totalAmount',
'freight',
'freightAmount',
'transportFee',
'otherFeeTotal',
'otherAmount',
]);
const result = {};
let otherFeeAmount = 0;
Object.entries(raw).forEach(([key, amount]) => {
if (!key) return;
if (key === 'otherFreightAmount' || key === 'otherFeeTotal' || key === 'otherAmount') {
otherFeeAmount += Number(amount || 0);
return;
}
if (metaKeys.has(key)) return;
if (amount && typeof amount === 'object') return;
result[key] = amount;
});
const hasOtherFee = Object.keys(result).some(
name => String(name).includes('其它费') || String(name).includes('其他费')
);
if (otherFeeAmount && !hasOtherFee) {
result['其它费用'] = otherFeeAmount;
}
return result;
},
parseRawFeeItems(value) {
if (!value) return {};
if (typeof value === 'object') return value;
if (typeof value === 'object') return { ...value };
try {
return JSON.parse(value);
const parsed = JSON.parse(value);
return parsed && typeof parsed === 'object' ? parsed : {};
} catch {
return {};
}
@@ -3061,6 +3061,42 @@ export default {
});
},
parseFeeItems(value) {
const raw = this.parseRawFeeItems(value);
const metaKeys = new Set([
'currency',
'totalFreightAmount',
'otherFreightAmount',
'freightItems',
'freightTotal',
'totalFreight',
'totalAmount',
'freight',
'freightAmount',
'transportFee',
'otherFeeTotal',
'otherAmount',
]);
const result = {};
let otherFeeAmount = 0;
Object.entries(raw).forEach(([key, amount]) => {
if (!key) return;
if (key === 'otherFreightAmount' || key === 'otherFeeTotal' || key === 'otherAmount') {
otherFeeAmount += Number(amount || 0);
return;
}
if (metaKeys.has(key)) return;
if (amount && typeof amount === 'object') return;
result[key] = amount;
});
const hasOtherFee = Object.keys(result).some(
name => String(name).includes('其它费') || String(name).includes('其他费')
);
if (otherFeeAmount && !hasOtherFee) {
result['其它费用'] = otherFeeAmount;
}
return result;
},
parseRawFeeItems(value) {
if (!value) return {};
if (typeof value === 'object') return { ...value };
try {