feat(P17B-3,P17B-4): 增加采购归档前端与审批链路E2E
这个提交包含在:
@@ -90,6 +90,27 @@ export type PurchaseAttachment = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type PurchaseArchivedFile = {
|
||||
storagePath: string | null;
|
||||
originalName: string | null;
|
||||
mimeType: string | null;
|
||||
fileSize: number;
|
||||
};
|
||||
|
||||
export type PurchaseOrderArchive = {
|
||||
id: string;
|
||||
poNo: string;
|
||||
contractNo: string | null;
|
||||
archivedAt: string | null;
|
||||
archivedBy: string;
|
||||
archivedByEmployee: {
|
||||
id: string;
|
||||
employeeNo: string;
|
||||
name: string;
|
||||
} | null;
|
||||
archivedFiles: PurchaseArchivedFile[];
|
||||
};
|
||||
|
||||
export type PurchaseRequestDetail = PurchaseRequestSummary & {
|
||||
items: PurchaseRequestItem[];
|
||||
attachments: PurchaseAttachment[];
|
||||
@@ -105,10 +126,12 @@ export type PurchaseRequestDetail = PurchaseRequestSummary & {
|
||||
assigneeRole: string | null;
|
||||
} | null;
|
||||
} | null;
|
||||
archiveOrder: PurchaseOrderArchive | null;
|
||||
permissions: {
|
||||
canEditDraft: boolean;
|
||||
canSubmit: boolean;
|
||||
canWithdraw: boolean;
|
||||
canArchiveOrder: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -197,6 +220,10 @@ export async function submitPurchaseRequest(purchaseRequestId: string) {
|
||||
currentTaskId: string;
|
||||
budgetPoolId: string | null;
|
||||
warnings: string[];
|
||||
budgetReservation: {
|
||||
applied: boolean;
|
||||
reservedAmount: string;
|
||||
};
|
||||
}>(`/api/purchase-requests/${purchaseRequestId}/submit`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({}),
|
||||
@@ -208,12 +235,34 @@ export async function withdrawPurchaseRequest(purchaseRequestId: string) {
|
||||
purchaseRequestId: string;
|
||||
status: "draft";
|
||||
workflowInstanceId: string | null;
|
||||
budgetRelease: {
|
||||
applied: boolean;
|
||||
items: Array<{ budgetPoolId: string; amount: string }>;
|
||||
};
|
||||
}>(`/api/purchase-requests/${purchaseRequestId}/withdraw`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({}),
|
||||
});
|
||||
}
|
||||
|
||||
export async function fetchPurchaseOrderArchive(purchaseRequestId: string) {
|
||||
return apiRequestData<{ archiveOrder: PurchaseOrderArchive | null }>(`/api/purchase-requests/${purchaseRequestId}/archive-order`);
|
||||
}
|
||||
|
||||
export async function archivePurchaseOrder(
|
||||
purchaseRequestId: string,
|
||||
payload: {
|
||||
poNo: string;
|
||||
contractNo?: string | null;
|
||||
archivedFiles?: PurchaseArchivedFile[];
|
||||
},
|
||||
) {
|
||||
return apiRequestData<{ archiveOrder: PurchaseOrderArchive }>(`/api/purchase-requests/${purchaseRequestId}/archive-order`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export async function uploadPurchaseAttachment(purchaseRequestId: string, file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
|
||||
在新工单中引用
屏蔽一个用户