diff --git a/fe-admin/src/components/pe/PeDetailTabs.tsx b/fe-admin/src/components/pe/PeDetailTabs.tsx index d28eaa1..a5e6043 100644 --- a/fe-admin/src/components/pe/PeDetailTabs.tsx +++ b/fe-admin/src/components/pe/PeDetailTabs.tsx @@ -1977,6 +1977,17 @@ function ThongTinChonThauSection({ ev, readOnly = false }: { ev: PeDetailBundle; a => a.purchaseEvaluationSupplierId === null && a.purpose !== PeAttachmentPurpose.ApprovalAttachment, ) + // [Fix UAT — phiếu bị Trả lại: không xóa/tải lại được file "Bảng so sánh"] + // Nút xóa/tải file so sánh phải theo NGƯỜI-SOẠN (hoặc Admin) + TRẠNG-THÁI-được-sửa, + // KHÔNG theo readOnly của MÀN HÌNH: màn "Danh sách" mở phiếu readOnly=true nên ẩn + // nút ở MỌI phase — kể cả Trả lại, vốn nằm trong isEditablePhase. Chỉ tách RIÊNG + // khối đính kèm này; HoSoLink + winner bên dưới vẫn theo readOnly màn hình (không + // mở nhầm). Chỉ áp cho "Bảng so sánh" (GeneralAttachmentsSection) — file per-NCC + // (SupplierAttachmentsCell) giữ nguyên carve-out approverEditMode (Mig 28 F3). + const { user: currentUser } = useAuth() + const isAdmin = currentUser?.roles?.includes('Admin') ?? false + const isDrafter = currentUser?.id != null && ev.drafterUserId === currentUser.id + const attachEditable = (isAdmin || isDrafter) && isEditablePhase(ev.phase) return (
@@ -2010,7 +2021,7 @@ function ThongTinChonThauSection({ ev, readOnly = false }: { ev: PeDetailBundle; {/* 4. Bảng so sánh giá */}
4. Bảng so sánh giá
- +
{/* 5. Link hồ sơ */} diff --git a/fe-user/src/components/pe/PeDetailTabs.tsx b/fe-user/src/components/pe/PeDetailTabs.tsx index d28eaa1..a5e6043 100644 --- a/fe-user/src/components/pe/PeDetailTabs.tsx +++ b/fe-user/src/components/pe/PeDetailTabs.tsx @@ -1977,6 +1977,17 @@ function ThongTinChonThauSection({ ev, readOnly = false }: { ev: PeDetailBundle; a => a.purchaseEvaluationSupplierId === null && a.purpose !== PeAttachmentPurpose.ApprovalAttachment, ) + // [Fix UAT — phiếu bị Trả lại: không xóa/tải lại được file "Bảng so sánh"] + // Nút xóa/tải file so sánh phải theo NGƯỜI-SOẠN (hoặc Admin) + TRẠNG-THÁI-được-sửa, + // KHÔNG theo readOnly của MÀN HÌNH: màn "Danh sách" mở phiếu readOnly=true nên ẩn + // nút ở MỌI phase — kể cả Trả lại, vốn nằm trong isEditablePhase. Chỉ tách RIÊNG + // khối đính kèm này; HoSoLink + winner bên dưới vẫn theo readOnly màn hình (không + // mở nhầm). Chỉ áp cho "Bảng so sánh" (GeneralAttachmentsSection) — file per-NCC + // (SupplierAttachmentsCell) giữ nguyên carve-out approverEditMode (Mig 28 F3). + const { user: currentUser } = useAuth() + const isAdmin = currentUser?.roles?.includes('Admin') ?? false + const isDrafter = currentUser?.id != null && ev.drafterUserId === currentUser.id + const attachEditable = (isAdmin || isDrafter) && isEditablePhase(ev.phase) return (
@@ -2010,7 +2021,7 @@ function ThongTinChonThauSection({ ev, readOnly = false }: { ev: PeDetailBundle; {/* 4. Bảng so sánh giá */}
4. Bảng so sánh giá
- +
{/* 5. Link hồ sơ */}