R111/A7-A10 统一报销双端发票附件体验
这个提交包含在:
@@ -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,
|
||||
|
||||
在新工单中引用
屏蔽一个用户