This commit is contained in:
2026-08-15 09:57:49 +08:00
parent a26e2e6c3e
commit fc8480426d
3 changed files with 25 additions and 5 deletions
@@ -137,7 +137,12 @@ function displayDate(value?: string) { return value || '—' }
function rowTotal(value: unknown) { return totalAmount(value as SettlementRow) }
function rowPaid(value: unknown) { return paidAmount(value as SettlementRow) }
function rowOutstanding(value: unknown) { return Number((value as SettlementRow).outstandingAmount || 0) }
function customerName(customerId: string, snapshot?: string) { return snapshot || customers.value.find((item) => String(item.id) === String(customerId))?.tenantName || '—' }
function customerName(customerId: string, snapshot?: string) {
const mappedName = customers.value.find((item) => String(item.id) === String(customerId))?.tenantName
// Backend snapshots may contain the internal fallback label; never promote that ID to the finance UI.
if (snapshot && !/^客户\d+$/.test(snapshot.trim())) return snapshot
return mappedName || '—'
}
function totalAmount(row: SettlementRow) { return props.kind === 'receivable' ? (row as FinanceReceivableSettlement).receivableAmount : (row as FinancePayableSettlement).payableAmount }
function paidAmount(row: SettlementRow) { return props.kind === 'receivable' ? (row as FinanceReceivableSettlement).receivedAmount : (row as FinancePayableSettlement).paidAmount }
function selectedSupplierName() { return selectedRow.value && 'supplierName' in selectedRow.value ? selectedRow.value.supplierName || '—' : '—' }