From aec660a8fec9b06782f3e82bbde74dfc6078d402 Mon Sep 17 00:00:00 2001 From: shunli Date: Tue, 12 May 2026 02:34:15 +0800 Subject: [PATCH] =?UTF-8?q?PC6=20=E5=AE=8C=E5=96=84=20PC=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E4=B8=8E=E5=AE=A1=E6=89=B9=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/portal.ts | 14 ++ client/src/api/workflow.ts | 1 + client/src/pages/ApOperationsPage.tsx | 8 +- client/src/pages/PortalHomePage.tsx | 184 +++++++++++++++++- client/src/pages/PurchaseRequestsPage.tsx | 26 ++- client/src/pages/WorkflowTasksPage.tsx | 151 ++++++++++---- client/tests/e2e/visual-portal.spec.ts | 18 +- .../tests/e2e/workflow-quick-approve.spec.ts | 1 + ...-12_01-40-00-r6-pc-workbench-ia-polish.csv | 8 +- server/src/routes/portal.js | 88 ++++++++- server/src/routes/workflow.js | 6 + server/tests/unit/routes/portal.test.js | 72 ++++++- .../unit/routes/workflow.permissions.test.js | 15 +- 13 files changed, 518 insertions(+), 74 deletions(-) diff --git a/client/src/api/portal.ts b/client/src/api/portal.ts index dc2b58bc..319ef97d 100644 --- a/client/src/api/portal.ts +++ b/client/src/api/portal.ts @@ -71,6 +71,20 @@ export type PortalHomePayload = { } | null; peopleLifecycle: { onboardingCount: number; offboardingCount: number; assetReturnPendingCount: number; href: string } | null; + roleCapabilities?: { + canSubmitApplications: boolean; + canApproveTasks: boolean; + canUseFinance: boolean; + canManageSystem: boolean; + canViewTeam: boolean; + isAdminOnly: boolean; + }; + financeSummary?: { + pendingBatchCount: number; + failedItemCount: number; + riskCount: number; + href: string; + } | null; adoptionSummary: | { activeEmployeeCount: number; diff --git a/client/src/api/workflow.ts b/client/src/api/workflow.ts index f5f11f18..b7ebaf17 100644 --- a/client/src/api/workflow.ts +++ b/client/src/api/workflow.ts @@ -203,6 +203,7 @@ export type WorkflowApproverListResponse = { export type WorkflowTaskListQuery = { status?: "pending" | "completed" | "rejected" | "cancelled" | "skipped"; + entityType?: "reimbursement" | "leave" | "purchase_request" | "travel_request"; page?: number; pageSize?: number; }; diff --git a/client/src/pages/ApOperationsPage.tsx b/client/src/pages/ApOperationsPage.tsx index 2029c11e..d68e05f5 100644 --- a/client/src/pages/ApOperationsPage.tsx +++ b/client/src/pages/ApOperationsPage.tsx @@ -480,7 +480,7 @@ export function ApOperationsPage() { }), onSuccess: (response, format) => { downloadBlob(response.blob, response.filename ?? `ap-operations.${format}`); - toast.success(`AP 运营数据已导出为 ${format.toUpperCase()}`); + toast.success(`财务处理数据已导出为 ${format.toUpperCase()}`); }, onError: (error) => { toast.error(resolveErrorMessage(error, "导出失败")); @@ -533,14 +533,14 @@ export function ApOperationsPage() { }; if (summaryQuery.isLoading && paymentBatchesQuery.isLoading && riskFlagsQuery.isLoading) { - return
加载 AP 运营工作台...
; + return
加载财务工作台...
; } return (
+
+
+
采购状态
+
+
+
+
总金额
+
{totalAmountPreview}
+
+
+
当前节点
+
{detail.pendingWorkflow?.task?.stepName ?? "-"}
+
+
+
附件
+
{detail.attachments.length} 个
+
+
+
@@ -1059,10 +1078,15 @@ export function PurchaseRequestsPage() {