diff --git a/fe-admin/src/components/pe/PeDetailTabs.tsx b/fe-admin/src/components/pe/PeDetailTabs.tsx index f4fd7bc..1ccdd26 100644 --- a/fe-admin/src/components/pe/PeDetailTabs.tsx +++ b/fe-admin/src/components/pe/PeDetailTabs.tsx @@ -69,10 +69,10 @@ export function PeDetailTabs({ /** Auto open Section 1 InfoTab in edit mode khi mount — triggered từ pencil icon Panel 1 */ autoEditHeader?: boolean }) { - const navigate = useNavigate() const qc = useQueryClient() - // isDraft renamed → canEditPhase: bao gồm cả TraLai (per user 2026-05-07). - // Header bar action buttons (Sửa header / Xóa) hiện khi phase editable + !readOnly. + // canEditPhase: bao gồm cả TraLai (user 2026-05-07). Header bar action + // buttons "Sửa header" + "Xóa" + "Đóng" workspace mode đã chuyển xuống bottom + // action bar (B11+ user 2026-05-07). const canEditPhase = isEditablePhase(evaluation.phase) const opinionsReadOnly = readOnly || mode === 'workspace' @@ -137,19 +137,14 @@ export function PeDetailTabs({ {evaluation.drafterName && <>·Soạn: {evaluation.drafterName}} -
- {canEditPhase && !readOnly && ( - <> - - - - )} - -
+ {/* Header bar actions: User 2026-05-07 chốt bỏ "Sửa header" + "Xóa" + + "Đóng" (workspace mode actions chuyển xuống bottom action bar). Vẫn + giữ Đóng cho non-workspace view (Danh sách + Duyệt — readOnly). */} + {(readOnly || mode !== 'workspace') && ( +
+ +
+ )}
@@ -176,17 +171,45 @@ export function PeDetailTabs({
- {/* Action bar bottom — workspace mode + canEdit + !readOnly. 2 nút Lưu - (đóng workspace, các thay đổi đã auto-save inline) + Lưu & Gửi Duyệt - (POST /transitions → next phase, vào quy trình duyệt). User 2026-05-07. */} + {/* Action bar bottom — workspace mode + canEdit + !readOnly. 3 nút: + - Xóa phiếu (CHỈ Bản nháp, soft-delete BE) — bên trái red + - Lưu (toast confirm, KHÔNG đóng workspace) — chính giữa ghost + - Lưu & Gửi Duyệt → (POST /transitions → next phase) — bên phải brand + User 2026-05-07. */} {mode === 'workspace' && canEditPhase && !readOnly && (
-
- ✓ Các thay đổi đã tự động lưu khi chỉnh sửa từng phần. +
+ {/* Xóa phiếu — CHỈ DangSoanThao (bản nháp). TraLai không cho xóa + (đã có lịch sử workflow). Soft-delete qua DELETE /pe/:id endpoint + (AuditableEntity IsDeleted=true, không xóa hoàn toàn DB). */} + {evaluation.phase === PurchaseEvaluationPhase.DangSoanThao && ( + + )} + + ✓ Các thay đổi đã tự động lưu khi chỉnh sửa từng phần. +
- {!isWinner && ( - <> - - - + + )} + {canDelete ? ( + + ) : !isWinner && hasQuotes && ( + + + )}
@@ -1138,8 +1172,11 @@ function ItemsTab({ ev, readOnly = false }: { ev: PeDetailBundle; readOnly?: boo )} {ev.suppliers.map(s => ( - - {s.displayName ?? s.supplierName} + + {/* User 2026-05-07: dùng tên NCC (master) thay vì displayName + (custom name) để column header rõ ràng. displayName fallback + sang title tooltip nếu có. */} + {s.supplierName} ))} {!readOnly && } diff --git a/fe-user/src/components/pe/PeDetailTabs.tsx b/fe-user/src/components/pe/PeDetailTabs.tsx index f4fd7bc..1ccdd26 100644 --- a/fe-user/src/components/pe/PeDetailTabs.tsx +++ b/fe-user/src/components/pe/PeDetailTabs.tsx @@ -69,10 +69,10 @@ export function PeDetailTabs({ /** Auto open Section 1 InfoTab in edit mode khi mount — triggered từ pencil icon Panel 1 */ autoEditHeader?: boolean }) { - const navigate = useNavigate() const qc = useQueryClient() - // isDraft renamed → canEditPhase: bao gồm cả TraLai (per user 2026-05-07). - // Header bar action buttons (Sửa header / Xóa) hiện khi phase editable + !readOnly. + // canEditPhase: bao gồm cả TraLai (user 2026-05-07). Header bar action + // buttons "Sửa header" + "Xóa" + "Đóng" workspace mode đã chuyển xuống bottom + // action bar (B11+ user 2026-05-07). const canEditPhase = isEditablePhase(evaluation.phase) const opinionsReadOnly = readOnly || mode === 'workspace' @@ -137,19 +137,14 @@ export function PeDetailTabs({ {evaluation.drafterName && <>·Soạn: {evaluation.drafterName}}
-
- {canEditPhase && !readOnly && ( - <> - - - - )} - -
+ {/* Header bar actions: User 2026-05-07 chốt bỏ "Sửa header" + "Xóa" + + "Đóng" (workspace mode actions chuyển xuống bottom action bar). Vẫn + giữ Đóng cho non-workspace view (Danh sách + Duyệt — readOnly). */} + {(readOnly || mode !== 'workspace') && ( +
+ +
+ )}
@@ -176,17 +171,45 @@ export function PeDetailTabs({
- {/* Action bar bottom — workspace mode + canEdit + !readOnly. 2 nút Lưu - (đóng workspace, các thay đổi đã auto-save inline) + Lưu & Gửi Duyệt - (POST /transitions → next phase, vào quy trình duyệt). User 2026-05-07. */} + {/* Action bar bottom — workspace mode + canEdit + !readOnly. 3 nút: + - Xóa phiếu (CHỈ Bản nháp, soft-delete BE) — bên trái red + - Lưu (toast confirm, KHÔNG đóng workspace) — chính giữa ghost + - Lưu & Gửi Duyệt → (POST /transitions → next phase) — bên phải brand + User 2026-05-07. */} {mode === 'workspace' && canEditPhase && !readOnly && (
-
- ✓ Các thay đổi đã tự động lưu khi chỉnh sửa từng phần. +
+ {/* Xóa phiếu — CHỈ DangSoanThao (bản nháp). TraLai không cho xóa + (đã có lịch sử workflow). Soft-delete qua DELETE /pe/:id endpoint + (AuditableEntity IsDeleted=true, không xóa hoàn toàn DB). */} + {evaluation.phase === PurchaseEvaluationPhase.DangSoanThao && ( + + )} + + ✓ Các thay đổi đã tự động lưu khi chỉnh sửa từng phần. +
- {!isWinner && ( - <> - - - + + )} + {canDelete ? ( + + ) : !isWinner && hasQuotes && ( + + + )}
@@ -1138,8 +1172,11 @@ function ItemsTab({ ev, readOnly = false }: { ev: PeDetailBundle; readOnly?: boo )} {ev.suppliers.map(s => ( - - {s.displayName ?? s.supplierName} + + {/* User 2026-05-07: dùng tên NCC (master) thay vì displayName + (custom name) để column header rõ ràng. displayName fallback + sang title tooltip nếu có. */} + {s.supplierName} ))} {!readOnly && }