优化
This commit is contained in:
@@ -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 || '—' : '—' }
|
||||
|
||||
Reference in New Issue
Block a user