完善企业编辑页面并修复采购建单重试

This commit is contained in:
2026-10-30 15:42:38 +08:00
parent d6ef770e48
commit 55868177cd
19 changed files with 568 additions and 224 deletions
+12 -2
View File
@@ -36,8 +36,18 @@ export function formatInboundDateTime(value: string | null | undefined) {
}).format(date)
}
export function getChargeModeLabel(value: 'KG' | 'CBM') {
return value === 'KG' ? '按重量计费' : '按体积计费'
export function getChargeModeLabel(
chargeMode: 'KG' | 'CBM',
actualWeightKg: number,
actualVolumeCbm: number,
convertedQuantity: number,
) {
const actualQuantity = chargeMode === 'KG' ? actualWeightKg : actualVolumeCbm
if (!Number.isFinite(actualQuantity) || !Number.isFinite(convertedQuantity)) return '-'
const usesConvertedQuantity = convertedQuantity > actualQuantity
return chargeMode === 'KG'
? usesConvertedQuantity ? '按体积重计费' : '按毛重计费'
: usesConvertedQuantity ? '按重量折算体积计费' : '按体积计费'
}
export function getTaxModeLabel(value: string) {