R55 A1-A6:报销统计仪表盘与批量审批
这个提交包含在:
@@ -201,6 +201,24 @@ export type WorkflowApproverQuery = {
|
||||
pageSize?: number;
|
||||
};
|
||||
|
||||
export type WorkflowBatchActionResult = {
|
||||
taskId: string;
|
||||
outcome: "approved" | "rejected" | "skipped" | "error";
|
||||
reason?: string;
|
||||
};
|
||||
|
||||
export type WorkflowBatchActionSummary = {
|
||||
approved: number;
|
||||
rejected?: number;
|
||||
skipped: number;
|
||||
errored: number;
|
||||
};
|
||||
|
||||
export type WorkflowBatchActionResponse = {
|
||||
results: WorkflowBatchActionResult[];
|
||||
summary: WorkflowBatchActionSummary;
|
||||
};
|
||||
|
||||
function toQueryString(query: Record<string, string | number | undefined>) {
|
||||
const params = new URLSearchParams();
|
||||
for (const [key, value] of Object.entries(query)) {
|
||||
@@ -255,3 +273,17 @@ export async function transferWorkflowTask(taskId: string, toApproverId: string,
|
||||
body: JSON.stringify({ toApproverId, reason }),
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchApproveWorkflowTasks(payload: { taskIds: string[]; comment?: string }) {
|
||||
return apiRequestData<WorkflowBatchActionResponse>("/api/workflow/batch-approve", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export async function batchRejectWorkflowTasks(payload: { taskIds: string[]; comment: string }) {
|
||||
return apiRequestData<WorkflowBatchActionResponse>("/api/workflow/batch-reject", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户