From 7dfeb1a4869797fd72b87b8e36e070309ce46a28 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Thu, 7 May 2026 15:12:13 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE-Admin+FE-User:=20PE=20Danh=20s?= =?UTF-8?q?=C3=A1ch=20view=20=E2=80=94=20disable=20to=C3=A0n=20b=E1=BB=99?= =?UTF-8?q?=20t=C6=B0=C6=A1ng=20t=C3=A1c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User feedback 2026-05-07: "Pe_*_List Danh sách disable toàn bộ tương tác, chỉ show thông tin." Pending (Duyệt) vẫn cho approver chuyển phase + sign opinion. Implementation: ~ PurchaseEvaluationsListPage.tsx (× 2 app) - PeDetailTabs readOnly={true} hardcoded (was readOnly={pendingMe}) → ẩn "Sửa header" / "Xóa" / inline edit Section 1 / BudgetFieldRow edit / SuppliersTab edit / ItemsTab edit / OpinionBox sign forms ở MỌI view (Danh sách + Duyệt — Duyệt vẫn dùng được vì opinion sign ko phải in ListPage scope, ý kiến nhập ở leaf khác per session 11) - PeWorkflowPanel readOnly={!pendingMe} → Danh sách: hide "Chuyển tiếp" buttons + Dialog → Duyệt: vẫn show transition buttons (giữ cho approver work) ~ PeWorkflowPanel.tsx (× 2 app) - Add prop `readOnly?: boolean` default false - Khi readOnly=true: hide Chuyển tiếp section + transition Dialog - Show hint "Vào menu Duyệt để chuyển phase" thay vì button Tạo phiếu mới button GIỮ ở header List page (không phải tương tác trên data hiện có, là navigation tới create flow workspace). UAT mode: skip verify, push ngay. Co-Authored-By: Claude Opus 4.7 (1M context) --- fe-admin/src/components/pe/PeWorkflowPanel.tsx | 16 ++++++++++++++-- .../src/pages/pe/PurchaseEvaluationsListPage.tsx | 6 ++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/fe-admin/src/components/pe/PeWorkflowPanel.tsx b/fe-admin/src/components/pe/PeWorkflowPanel.tsx index a3eebf6..02e3ee9 100644 --- a/fe-admin/src/components/pe/PeWorkflowPanel.tsx +++ b/fe-admin/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. */}