diff --git a/fe-user/src/components/pe/PeWorkflowPanel.tsx b/fe-user/src/components/pe/PeWorkflowPanel.tsx index a3eebf6..02e3ee9 100644 --- a/fe-user/src/components/pe/PeWorkflowPanel.tsx +++ b/fe-user/src/components/pe/PeWorkflowPanel.tsx @@ -22,7 +22,14 @@ import { } from '@/types/purchaseEvaluation' import { PeApprovalsSection, PeHistorySection } from './PeDetailTabs' -export function PeWorkflowPanel({ evaluation }: { evaluation: PeDetailBundle }) { +export function PeWorkflowPanel({ + evaluation, + readOnly = false, +}: { + evaluation: PeDetailBundle + /** true = ẩn Chuyển tiếp + Dialog transition (dùng cho Danh sách, không dùng Duyệt). */ + readOnly?: boolean +}) { const [target, setTarget] = useState(null) const [comment, setComment] = useState('') const qc = useQueryClient() @@ -92,7 +99,7 @@ export function PeWorkflowPanel({ evaluation }: { evaluation: PeDetailBundle }) })} - {next.length > 0 && ( + {next.length > 0 && !readOnly && (
@@ -113,6 +120,11 @@ export function PeWorkflowPanel({ evaluation }: { evaluation: PeDetailBundle })
)} + {readOnly && next.length > 0 && ( +
+ Vào menu “Duyệt” để chuyển phase. +
+ )} {target !== null && ( setParam('id', null)} onDelete={() => del.mutate(detail.data!.id)} - readOnly={pendingMe} + readOnly={true} /> )} {/* Panel 3: Workflow + history */} + {/* Danh sách (pendingMe=false) → readOnly=true → ẩn Chuyển tiếp transition. + Duyệt (pendingMe=true) → readOnly=false → cho approver chuyển phase. */}