diff --git a/fe-admin/src/pages/pe/PurchaseEvaluationsListPage.tsx b/fe-admin/src/pages/pe/PurchaseEvaluationsListPage.tsx index fa2ee56..d188848 100644 --- a/fe-admin/src/pages/pe/PurchaseEvaluationsListPage.tsx +++ b/fe-admin/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) +
+ ) : ( + + )}
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) +
+ ) : ( + + )}