R111/A7-A10 统一报销双端发票附件体验

这个提交包含在:
2026-05-08 10:05:38 +08:00
父节点 0ab0740d1a
当前提交 ae054ca497
共修改 8 个文件,包含 908 行新增和 168 行删除
+35 -1
查看文件
@@ -62,9 +62,12 @@ export type InvoicePoolListResponse = {
};
export type UploadInvoiceResponse = {
invoicePoolId: string;
invoicePoolId: string | null;
status: InvoicePoolStatus;
fileSha256: string;
uploadAction?: "create" | "reuse_existing" | "blocked";
unavailableReason?: string | null;
unavailableMessage?: string | null;
};
export type InvoicePoolDetail = {
@@ -136,6 +139,31 @@ export type BindableInvoiceListResponse = {
items: BindableInvoiceSummary[];
};
export type InvoiceStatusItem = {
id: string;
status: InvoicePoolStatus;
reason: string;
message: string;
invoiceCode: string | null;
invoiceNumber: string | null;
invoiceDate: string | null;
sellerName: string | null;
totalAmount: string | null;
originalName: string | null;
linkedReimbursementId: string | null;
linkedItemId: string | null;
linkedTravelOrderId: string | null;
ocrAttempts: number;
ocrLastError: string | null;
ocrCompletedAt: string | null;
updatedAt: string | null;
};
export type InvoiceStatusResponse = {
items: InvoiceStatusItem[];
missingIds: string[];
};
function toQueryString(query: Record<string, string | number | undefined>) {
const params = new URLSearchParams();
@@ -170,6 +198,12 @@ export async function fetchBindableInvoices(query: {
);
}
export async function fetchInvoiceStatuses(ids: string[]) {
return apiRequestData<InvoiceStatusResponse>(
`/api/invoice-pool/status${toQueryString({ ids: ids.join(",") })}`,
);
}
export async function uploadInvoice(
file: File,
ocrType?: string,