diff --git a/fe-admin/src/components/pe/PeDetailTabs.tsx b/fe-admin/src/components/pe/PeDetailTabs.tsx index ab08dad..3288152 100644 --- a/fe-admin/src/components/pe/PeDetailTabs.tsx +++ b/fe-admin/src/components/pe/PeDetailTabs.tsx @@ -1079,7 +1079,7 @@ function PeBudgetSummaryTable({ ev, readOnly }: { ev: PeDetailBundle; readOnly: }) // PUT /budget/ccm — chỉ khi canEditCcm. initialAmount + adjustmentAmount. const ccmMut = useMutation({ - mutationFn: async (body: { initialAmount: number | null; adjustmentAmount: number | null }) => + mutationFn: async (body: { initialAmount: number | null; adjustmentAmount: number | null; ccmNote: string | null }) => api.put(`/purchase-evaluations/${ev.id}/budget/ccm`, body), onSuccess: () => { toast.success('Đã lưu ngân sách ban hành'); invalidate() }, onError: e => toast.error(getErrorMessage(e)), @@ -1097,6 +1097,9 @@ function PeBudgetSummaryTable({ ev, readOnly }: { ev: PeDetailBundle; readOnly: // proNote inline-edit state (Textarea — không dùng VndInlineEdit) const [proNoteText, setProNoteText] = useState(bs?.proNote ?? '') useEffect(() => { setProNoteText(bs?.proNote ?? '') }, [bs?.proNote]) + // ccmNote inline-edit state (mirror proNoteText) — [Mig anh Kiệt FDC] + const [ccmNoteText, setCcmNoteText] = useState(bs?.ccmNote ?? '') + useEffect(() => { setCcmNoteText(bs?.ccmNote ?? '') }, [bs?.ccmNote]) // Phiếu cũ chưa gắn Hạng mục công việc → budgetSummary null. if (!bs) { @@ -1172,7 +1175,7 @@ function PeBudgetSummaryTable({ ev, readOnly }: { ev: PeDetailBundle; readOnly: initial={bs.initialAmount} saving={ccmMut.isPending} label="Ngân sách ban hành lần đầu" - onSave={v => ccmMut.mutate({ initialAmount: v, adjustmentAmount: bs.adjustmentAmount })} + onSave={v => ccmMut.mutate({ initialAmount: v, adjustmentAmount: bs.adjustmentAmount, ccmNote: bs.ccmNote })} /> ) : bs.initialAmount != null ? fmtVnd(bs.initialAmount) : } @@ -1188,7 +1191,7 @@ function PeBudgetSummaryTable({ ev, readOnly }: { ev: PeDetailBundle; readOnly: allowNegative saving={ccmMut.isPending} label="Ngân sách hiệu chỉnh tăng giảm" - onSave={v => ccmMut.mutate({ initialAmount: bs.initialAmount, adjustmentAmount: v })} + onSave={v => ccmMut.mutate({ initialAmount: bs.initialAmount, adjustmentAmount: v, ccmNote: bs.ccmNote })} /> ) : bs.adjustmentAmount != null ? ( {fmtVndSigned(bs.adjustmentAmount)} @@ -1196,6 +1199,37 @@ function PeBudgetSummaryTable({ ev, readOnly }: { ev: PeDetailBundle; readOnly: } /> + {/* Ghi chú từ CCM (CCM editable — Textarea, mirror Ghi chú từ PRO) — [Mig anh Kiệt FDC] */} +
+
Ghi chú từ CCM
+
+ {bs.canEditCcm ? ( +
+