feat(P20T2-4): 差旅支付轨道卡片与发票绑定前端交互
这个提交包含在:
@@ -34,6 +34,7 @@ export type InvoicePoolListItem = {
|
||||
totalAmount: string | null;
|
||||
linkedReimbursementId: string | null;
|
||||
linkedItemId: string | null;
|
||||
linkedTravelOrderId: string | null;
|
||||
originalName: string;
|
||||
mimeType: string;
|
||||
fileSize: number;
|
||||
@@ -88,6 +89,7 @@ export type InvoicePoolDetail = {
|
||||
totalAmount: string | null;
|
||||
linkedReimbursementId: string | null;
|
||||
linkedItemId: string | null;
|
||||
linkedTravelOrderId: string | null;
|
||||
isDuplicateOverride: boolean;
|
||||
overrideRefFormNumber: string | null;
|
||||
overrideReason: string | null;
|
||||
@@ -104,6 +106,15 @@ export type InvoicePoolListQuery = {
|
||||
ownerScope?: "own" | "all";
|
||||
};
|
||||
|
||||
export type InvoiceBindPayload =
|
||||
| {
|
||||
reimbursementId: string;
|
||||
linkedItemId?: string;
|
||||
}
|
||||
| {
|
||||
travelOrderId: string;
|
||||
};
|
||||
|
||||
function toQueryString(query: Record<string, string | number | undefined>) {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
@@ -147,10 +158,19 @@ export async function uploadInvoice(file: File, ocrType?: string, ownerEmployeeI
|
||||
);
|
||||
}
|
||||
|
||||
export async function bindInvoice(invoiceId: string, reimbursementId: string, linkedItemId?: string) {
|
||||
export async function bindInvoice(
|
||||
invoiceId: string,
|
||||
reimbursementIdOrPayload: string | InvoiceBindPayload,
|
||||
linkedItemId?: string,
|
||||
) {
|
||||
const payload =
|
||||
typeof reimbursementIdOrPayload === "string"
|
||||
? { reimbursementId: reimbursementIdOrPayload, linkedItemId }
|
||||
: reimbursementIdOrPayload;
|
||||
|
||||
return apiRequestData<Record<string, unknown>>(`/api/invoice-pool/${invoiceId}/bind`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ reimbursementId, linkedItemId }),
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户