- {primaryAction ?
{primaryAction}
: null}
- {secondaryActions ?
{secondaryActions}
: null}
- {moreActions ?
{moreActions}
: null}
+ {hasPrimaryAction ?
{primaryAction}
: null}
+ {hasSecondaryActions ?
{secondaryActions}
: null}
+ {hasMoreActions ?
{moreActions}
: null}
{hasChildren ? (
{children}
) : null}
- {summary ? (
+ {hasSummary ? (
diff --git a/client/src/layouts/AppShellLayout.tsx b/client/src/layouts/AppShellLayout.tsx
index 9ad58b21..465e3ab3 100644
--- a/client/src/layouts/AppShellLayout.tsx
+++ b/client/src/layouts/AppShellLayout.tsx
@@ -66,7 +66,7 @@ export function AppShellLayout() {
{isMobileRoute ? null :
}
{isMobileRoute ? null : }
diff --git a/client/src/lib/approvalDisplay.ts b/client/src/lib/approvalDisplay.ts
index 5caac535..8da08af0 100644
--- a/client/src/lib/approvalDisplay.ts
+++ b/client/src/lib/approvalDisplay.ts
@@ -52,6 +52,22 @@ export function workflowActionLabel(action: string | null | undefined) {
return action ? labels[action] ?? action : "-";
}
+export function approvalRoleLabel(role: string | null | undefined) {
+ if (!role?.trim()) {
+ return "-";
+ }
+
+ const labels: Record = {
+ manager: "主管",
+ ceo: "负责人",
+ finance: "财务",
+ finance_mgr: "财务经理",
+ hr: "人事",
+ };
+
+ return labels[role.trim().toLowerCase()] ?? "审批人";
+}
+
export function formatApprovalHistoryTime(value: string | null | undefined) {
return value ? value.slice(0, 19).replace("T", " ") : "-";
}
diff --git a/client/src/pages/WorkflowTaskDetailPage.tsx b/client/src/pages/WorkflowTaskDetailPage.tsx
index bbca30cf..03816d55 100644
--- a/client/src/pages/WorkflowTaskDetailPage.tsx
+++ b/client/src/pages/WorkflowTaskDetailPage.tsx
@@ -32,7 +32,7 @@ import { PageScaffold } from "../components/patterns/PageScaffold";
import { SectionPanel } from "../components/patterns/SectionPanel";
import { Button } from "../components/ui/button";
import { Textarea } from "../components/ui/textarea";
-import { resolvePurchaseDisplayCode, workflowActionLabel } from "../lib/approvalDisplay";
+import { approvalRoleLabel, resolvePurchaseDisplayCode, workflowActionLabel } from "../lib/approvalDisplay";
import { formatDisplayDateTime } from "../lib/displayFormat";
import {
buildPcDetailSource,
@@ -254,13 +254,16 @@ export function WorkflowTaskDetailPage() {
onClick={() => navigate(backSource, { replace: true })}
type="button"
>
- {backSource.startsWith("/reimbursements") ? "返回报销列表" : "返回待办列表"}
+ 返回审批列表
);
}
const detail = detailQuery.data;
+ const canApprove = allowedActions.has("approve");
+ const canReturn = allowedActions.has("return");
+ const canReject = allowedActions.has("reject");
const canTransfer = allowedActions.has("transfer");
const allowedActionLabels = detail.allowedActions.map(workflowActionLabel).join(" / ");
const businessStatusLabel = workflowInstanceStatusLabel(detail.workflowInstance?.currentStatus);
@@ -281,7 +284,7 @@ export function WorkflowTaskDetailPage() {
actions={(