[CLAUDE] PurchaseEvaluation · FE-User · FE-Admin · Tests: PE note "Duyệt là KẾT THÚC quy trình (không trình CEO)" — 3 surface
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m58s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m58s
Phiếu mà quy trình duyệt có cấp bật AllowApproverFinalize (Mig 58) sẽ kết thúc tại cấp đó, KHÔNG trình CEO. Hiển thị note cho MỌI NGƯỜI NẮM ở 3 surface (anh Kiệt FDC). KHÔNG migration (cột AllowApproverFinalize đã có Mig 58, prod ở Mig 59). BE (3 file, computed DTO): - PurchaseEvaluationDtos.cs: +bool EndsBeforeCeo +string? FinalizeStepName +string? FinalizeLevelName trên DetailBundle + ListItem; flow-level +bool AllowApproverFinalize. - PurchaseEvaluationFeatures.cs: detail compute first-reachable (Step.Order↑→Level.Order↑, dept-name in-memory); list + inbox projection qua 3 subquery EF-safe (lv.Step!.Name). V1 (workflowId==null) → false. - CreateContractFromEvaluationFeatures.cs: ListApproved projection cùng DTO → +3 subquery y hệt. FE 2-app (fe-user + fe-admin SHA-mirror component): - PeFinalizeChip.tsx (MỚI, chip tím) ở 3 danh sách: PeListPanel + PurchaseEvaluationsListPage (cây) + InboxPage. - PeWorkflowPanel.tsx: note callout trong phiếu, branch DaDuyet (past-tense) / đang-chạy; copy boundary-aware "...là KẾT THÚC, không trình CEO. Các cấp trước vẫn duyệt như thường." (tránh cấp giữa hiểu nhầm). - UserDashboardPage.tsx (chỉ fe-user): dải "Phiếu Duyệt NCC gần đây" + chip (admin dashboard để nguyên). - types: PeListItem/PeDetailBundle/PeApprovalFlowLevel +field. Tests: +PeFinalizeProjectionTests (EF-translate smoke 3 subquery + first-reachable + V1-false). Full suite 421→422. em-main self-gate sau workflow (impl-frontend return rỗng #53 → mirror fe-admin + verify 5 site recover-disk). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
23
fe-user/src/components/pe/PeFinalizeChip.tsx
Normal file
23
fe-user/src/components/pe/PeFinalizeChip.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
// PE — chip "Quy trình kết thúc tại cấp này" (không trình CEO). Hiện khi quy
|
||||
// trình của phiếu có cấp bật AllowApproverFinalize (Mig 58, anh Kiệt FDC S89).
|
||||
// SINGLE SOURCE OF TRUTH cho pill này dùng ở MỌI danh sách phiếu (cây danh sách
|
||||
// + picker workspace/chờ-duyệt + inbox) để mọi người NẮM ngay "phiếu này duyệt
|
||||
// đến đây là xong, không lên CEO" mà KHÔNG cần mở phiếu. Shape khớp PeUrgentChips.
|
||||
|
||||
export function PeFinalizeChip({
|
||||
endsBeforeCeo,
|
||||
finalizeStepName,
|
||||
}: {
|
||||
endsBeforeCeo: boolean
|
||||
finalizeStepName: string | null
|
||||
}) {
|
||||
if (!endsBeforeCeo) return null
|
||||
return (
|
||||
<span
|
||||
className="inline-flex shrink-0 items-center rounded bg-violet-100 px-1.5 py-0.5 text-[11px] font-semibold text-violet-800"
|
||||
title={`Quy trình kết thúc tại ${finalizeStepName ?? 'cấp này'} — không trình CEO`}
|
||||
>
|
||||
{finalizeStepName ? `⚑ Kết thúc · ${finalizeStepName}` : '⚑ Không lên CEO'}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@ -26,6 +26,7 @@ import {
|
||||
type PeListItem,
|
||||
} from '@/types/purchaseEvaluation'
|
||||
import { PeUrgentChips } from '@/components/pe/PeUrgentChips'
|
||||
import { PeFinalizeChip } from '@/components/pe/PeFinalizeChip'
|
||||
|
||||
export function PeListPanel({
|
||||
typeFilter,
|
||||
@ -158,6 +159,7 @@ export function PeListPanel({
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex min-w-0 items-center gap-1 text-[13px] font-medium text-slate-900">
|
||||
<PeUrgentChips isUrgentByPro={p.isUrgentByPro} isUrgentByCcm={p.isUrgentByCcm} />
|
||||
<PeFinalizeChip endsBeforeCeo={p.endsBeforeCeo} finalizeStepName={p.finalizeStepName} />
|
||||
<span className="truncate">{p.tenGoiThau}</span>
|
||||
</div>
|
||||
<div className="mt-0.5 flex items-center gap-1.5 text-[11px] text-slate-500">
|
||||
|
||||
@ -251,6 +251,29 @@ export function PeWorkflowPanel({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* [Mig 58 AllowApproverFinalize — anh Kiệt FDC, S89] NOTE cho MỌI người NẮM:
|
||||
quy trình của phiếu này có cấp được cấu hình "Duyệt là KẾT THÚC" (không
|
||||
trình CEO). Branch theo phase: đang chạy = callout xanh-lá báo trước /
|
||||
Đã duyệt = xác nhận đã kết thúc tại đâu. */}
|
||||
{evaluation.endsBeforeCeo && (
|
||||
<div className="rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-[12px] text-emerald-800">
|
||||
{evaluation.phase === PurchaseEvaluationPhase.DaDuyet ? (
|
||||
<span>
|
||||
✅ Phiếu đã kết thúc tại{' '}
|
||||
<span className="font-semibold">{evaluation.finalizeStepName ?? 'cấp duyệt'}</span>
|
||||
{evaluation.finalizeLevelName ? <> · {evaluation.finalizeLevelName}</> : null} — không qua CEO.
|
||||
</span>
|
||||
) : (
|
||||
<span>
|
||||
⚑ Quy trình rút gọn: duyệt đến{' '}
|
||||
<span className="font-semibold">{evaluation.finalizeStepName ?? 'cấp này'}</span>
|
||||
{evaluation.finalizeLevelName ? <> · {evaluation.finalizeLevelName}</> : null} là KẾT THÚC,
|
||||
không trình CEO. Các cấp trước vẫn duyệt như thường.
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Mig 24 V2 — Flow render Bước → Cấp → NV thay phase cards.
|
||||
Status: Done (✓ emerald) / Current (● brand) / Pending (○ slate) */}
|
||||
{flow && flow.steps.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user