1
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user