From aaa1c6cba6dd0cbb4260601f024c620bdb097a15 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 8 May 2026 17:07:23 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20PE-Duy=E1=BB=87t:=20=E1=BA=A9n=20dro?= =?UTF-8?q?pdown=20tr=E1=BA=A1ng=20th=C3=A1i=20+=20filter=20c=E1=BB=A9ng?= =?UTF-8?q?=20"=C4=90=C3=A3=20g=E1=BB=ADi=20duy=E1=BB=87t"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Leaf "Duyệt" (pendingMe=1) chỉ load phiếu trạng thái "Đã gửi duyệt". Nháp / Trả lại / Đã duyệt / Từ chối lọc bỏ client-side. - Replace )} - + {/* Duyệt (pendingMe) → filter cứng "Đã gửi duyệt", ẩn dropdown trạng thái. + Danh sách (pendingMe=false) → giữ dropdown cho user filter mọi trạng thái. */} + {pendingMe ? ( +
+ Lọc cố định: Đã gửi duyệt (phiếu đang chờ duyệt) +
+ ) : ( + + )}
diff --git a/fe-user/src/pages/pe/PurchaseEvaluationsListPage.tsx b/fe-user/src/pages/pe/PurchaseEvaluationsListPage.tsx index fa2ee56..d188848 100644 --- a/fe-user/src/pages/pe/PurchaseEvaluationsListPage.tsx +++ b/fe-user/src/pages/pe/PurchaseEvaluationsListPage.tsx @@ -107,7 +107,13 @@ export function PurchaseEvaluationsListPage() { } } - const rows = list.data?.items ?? [] + const allRows = list.data?.items ?? [] + // Duyệt (pendingMe) → filter cứng client-side chỉ "Đã gửi duyệt" (Nháp/Trả lại/ + // Đã duyệt/Từ chối loại bỏ). BE /inbox hiện loose UAT có thể trả phiếu Nháp → + // FE filter để UX đúng kỳ vọng. Phân quyền strict V2 BE pending Session 18+. + const rows = pendingMe + ? allRows.filter(p => getPeDisplayStatus(p.phase) === PeDisplayStatus.DaGuiDuyet) + : allRows const headerTitle = typeFilter ? (pendingMe ? `${PurchaseEvaluationTypeLabel[typeFilter]} — Chờ duyệt` : PurchaseEvaluationTypeLabel[typeFilter]) @@ -120,7 +126,7 @@ export function PurchaseEvaluationsListPage() {

{headerTitle}

- {list.data?.total ?? 0} + {pendingMe ? rows.length : (list.data?.total ?? 0)}
@@ -151,23 +157,31 @@ export function PurchaseEvaluationsListPage() { ))} )} - + {/* Duyệt (pendingMe) → filter cứng "Đã gửi duyệt", ẩn dropdown trạng thái. + Danh sách (pendingMe=false) → giữ dropdown cho user filter mọi trạng thái. */} + {pendingMe ? ( +
+ Lọc cố định: Đã gửi duyệt (phiếu đang chờ duyệt) +
+ ) : ( + + )}