[CLAUDE] FE-PE: S22+5 Chunk B — Designer checkbox +AllowApproverEditBudget per slot + Section read flag (mirror 2 app)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m23s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m23s
FE Admin Designer (ApprovalWorkflowsV2Page.tsx): - LevelDto + EditLevelEntry +allowApproverEditBudget - copyFromDefinition + makeDefaultLevelEntry propagate default false - POST body include allowApproverEditBudget cho mỗi Level slot - NEW checkbox UI per Level inline panel: "Cho phép chỉnh sửa Section ngân sách lúc đang duyệt" (col-span-2, mirror pattern allowApproverEditDetails Mig 29) FE Types mirror 2 app: - fe-admin + fe-user `ApprovalWorkflowOptions` +allowApproverEditBudget FE BudgetAdjustSection refactor (mirror 2 app): - Trước: isApproverChoDuyet = phase ChoDuyet + actor in approvers - Sau: isApproverChoDuyet = phase ChoDuyet + actor in approvers + currentLevelOptions.allowApproverEditBudget=true (per slot opt-in) - Drafter scope Nháp/Trả lại unchanged - Admin bypass unchanged UX impact: - Admin Designer phải tick checkbox cho NV slot mới được edit ngân sách lúc duyệt - Nếu KHÔNG tick → button "Điều chỉnh" trong Section 5 KHÔNG hiện cho approver - Drafter vẫn edit bình thường khi phiếu Nháp/Trả lại Verify: - npm run build fe-admin — 569ms pass - npm run build fe-user — 528ms pass Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -974,9 +974,13 @@ function BudgetAdjustSection({ ev, readOnly }: { ev: PeDetailBundle; readOnly: b
|
||||
const isDrafter = currentUser?.id != null && ev.drafterUserId === currentUser.id
|
||||
const isDrafterPhase = ev.phase === PurchaseEvaluationPhase.DangSoanThao
|
||||
|| ev.phase === PurchaseEvaluationPhase.TraLai
|
||||
// Approver currentLevel match — phase ChoDuyet + actor in current approval level
|
||||
// F4 Approver scope (Mig 30): phase ChoDuyet + actor in currentApproval.approvers
|
||||
// + currentLevel có flag AllowApproverEditBudget=true (admin Designer tick per slot).
|
||||
const actorInCurrentLevel = ev.currentApproval?.approvers?.some(a => a.userId === currentUser?.id) ?? false
|
||||
const isApproverChoDuyet = ev.phase === PurchaseEvaluationPhase.ChoDuyet && actorInCurrentLevel
|
||||
const approverEditBudgetAllowed = ev.currentLevelOptions?.allowApproverEditBudget ?? false
|
||||
const isApproverChoDuyet = ev.phase === PurchaseEvaluationPhase.ChoDuyet
|
||||
&& actorInCurrentLevel
|
||||
&& approverEditBudgetAllowed
|
||||
|
||||
const canAdjust = !readOnly && (isAdmin || (isDrafter && isDrafterPhase) || isApproverChoDuyet)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user