diff --git a/client/src/pages/ReimbursementDetailPage.tsx b/client/src/pages/ReimbursementDetailPage.tsx index ec6e9df8..66845fba 100644 --- a/client/src/pages/ReimbursementDetailPage.tsx +++ b/client/src/pages/ReimbursementDetailPage.tsx @@ -22,6 +22,7 @@ import { withdrawReimbursement, linkReimbursementProject, type ReimbursementItem, + type ReimbursementStatus, } from "../api/reimbursements"; import { bindInvoice, @@ -66,6 +67,23 @@ import { buildPrecheckDialogMessage } from "../lib/precheck"; type ItemEditorState = { mode: "create" } | { mode: "edit"; itemId: string } | null; type SelectedInvoiceMap = Record; +const REIMBURSEMENT_STATUS_LABEL: Record = { + draft: "草稿", + reviewing: "审批中", + approved: "已通过", + paid: "已支付", + rejected: "已驳回", + cancelled: "已取消", +}; + +const INVOICE_STATUS_LABEL: Record = { + pending_ocr: "识别中", + ocr_failed: "识别失败", + available: "可添加", + bound: "已添加", + archived: "已归档", +}; + function formatDateTime(value: string | null) { if (!value) return "-"; return value.slice(0, 19).replace("T", " "); @@ -87,6 +105,14 @@ function buildActionErrorMessage(error: unknown, fallbackMessage: string) { return fallbackMessage; } +function reimbursementStatusLabel(status: ReimbursementStatus) { + return REIMBURSEMENT_STATUS_LABEL[status] ?? status; +} + +function invoiceStatusLabel(status: string) { + return INVOICE_STATUS_LABEL[status] ?? "未知状态"; +} + function resolveErpSyncStatus( exportState: | { @@ -939,7 +965,7 @@ export function ReimbursementDetailPage() {
-
状态:{detail.status}
+
状态:{reimbursementStatusLabel(detail.status)}
报销编号:{displayCode}
报销日期:{detail.reimbursementDate ?? "-"}
金额:{detail.totalAmount ?? "-"}
@@ -1156,9 +1182,8 @@ export function ReimbursementDetailPage() { >
- {item.expenseType?.name ?? item.expenseTypeId} + {item.expenseType?.name ?? "未识别费用类型"}
-
{item.expenseType?.code ?? "-"}
{item.expenseDate ?? "-"} @@ -1295,7 +1320,7 @@ export function ReimbursementDetailPage() {
- {item.status} + {invoiceStatusLabel(item.status)} {canUnbindInvoices ? (