diff --git a/fe-admin/src/components/pe/PeWorkspaceCreateView.tsx b/fe-admin/src/components/pe/PeWorkspaceCreateView.tsx index 3f91927..3d13fde 100644 --- a/fe-admin/src/components/pe/PeWorkspaceCreateView.tsx +++ b/fe-admin/src/components/pe/PeWorkspaceCreateView.tsx @@ -14,7 +14,6 @@ import { Button } from '@/components/ui/Button' import { Input } from '@/components/ui/Input' import { Label } from '@/components/ui/Label' import { Select } from '@/components/ui/Select' -import { Textarea } from '@/components/ui/Textarea' import { api } from '@/lib/api' import { getErrorMessage } from '@/lib/apiError' import { @@ -24,6 +23,22 @@ import { import { BudgetPhase, type BudgetListItem } from '@/types/budget' import type { Paged, Project } from '@/types/master' +// Preset điều khoản thanh toán phổ biến — user chọn 1 trong list, hoặc "Khác" +// để nhập tay. Save as plain text (không JSON như cũ — code-style không phù +// hợp UI cho end-user). User 2026-05-07 chỉnh. +const PAYMENT_PRESETS = [ + '100% sau khi nghiệm thu', + 'Tạm ứng 30% / Thanh toán 70% sau nghiệm thu', + 'Tạm ứng 50% / Thanh toán 50% sau nghiệm thu', + 'TGN-30 ngày (Thanh toán giao nhận 30 ngày)', + 'TGN-45 ngày', + 'TGN-60 ngày', + 'Tiến độ theo từng đợt', + 'Bảo hành 5% trong 12 tháng', +] as const + +const PAYMENT_CUSTOM = '__custom__' + export function PeWorkspaceCreateView({ defaultType, onSaved, @@ -48,6 +63,9 @@ export function PeWorkspaceCreateView({ budgetManualName: '', budgetManualAmount: 0, }) + // Payment terms: select preset OR "Khác" → text input + const [paymentMode, setPaymentMode] = useState('') // '' / preset / __custom__ + const isPaymentCustom = paymentMode === PAYMENT_CUSTOM const projects = useQuery({ queryKey: ['all-projects'], @@ -112,12 +130,12 @@ export function PeWorkspaceCreateView({
- - + +
@@ -157,12 +175,32 @@ export function PeWorkspaceCreateView({
-