This commit is contained in:
2026-08-10 15:47:07 +08:00
parent 6d30347cdb
commit e8e590948c
6 changed files with 166 additions and 163 deletions
+6 -3
View File
@@ -8,12 +8,15 @@ interface InvoiceRecord {
orderNo: string;
orderType: string;
amount: number;
createTime: string;
createTime?: string;
createdAt?: string;
status: 'pending' | 'processing' | 'issued' | 'rejected';
headerName?: string;
headerType?: string;
headerTaxNo?: string;
selectedOrders?: any[];
email?: string;
failureReason?: string;
}
interface InvoiceHeader {
@@ -95,14 +98,14 @@ const InvoicePage: React.FC = () => {
setRecordsLoading(true);
try {
const data = await getInvoices({ page: 1, pageSize: 50 });
const items = (data.items || []).map((item: any) => ({
const items: InvoiceRecord[] = (data.items || []).map((item: any) => ({
id: item.id,
orderNo: item.invoiceNo,
orderType: item.headerType === 'company' ? '企业' : '个人',
amount: item.totalAmount,
createdAt: item.createdAt,
// 后端状态映射:processing→processing, success→issued, failed→rejected
status: item.status === 'success' ? 'issued' : item.status === 'failed' ? 'rejected' : 'processing',
status: (item.status === 'success' ? 'issued' : item.status === 'failed' ? 'rejected' : 'processing') as InvoiceRecord['status'],
headerName: item.headerName,
headerType: item.headerType,
headerTaxNo: item.headerTaxNo,