diff --git a/fe-admin/src/components/contracts/ContractDetailContent.tsx b/fe-admin/src/components/contracts/ContractDetailContent.tsx index 80c6620..cd4508e 100644 --- a/fe-admin/src/components/contracts/ContractDetailContent.tsx +++ b/fe-admin/src/components/contracts/ContractDetailContent.tsx @@ -4,7 +4,7 @@ // trong WorkflowHistoryPanel (Panel 3). import { useState, type FormEvent } from 'react' import { useMutation, useQueryClient } from '@tanstack/react-query' -import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, Info, ListChecks, History } from 'lucide-react' +import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, ListChecks, History } from 'lucide-react' import { toast } from 'sonner' import { PhaseBadge } from '@/components/PhaseBadge' import { SlaTimer } from '@/components/SlaTimer' @@ -17,7 +17,6 @@ import { Textarea } from '@/components/ui/Textarea' import { Dialog } from '@/components/ui/Dialog' import { api } from '@/lib/api' import { getErrorMessage } from '@/lib/apiError' -import { cn } from '@/lib/cn' import { ApprovalDecision, ContractPhase, @@ -29,8 +28,6 @@ import { ContractTypeLabel } from '@/types/forms' const fmt = (s: string) => new Date(s).toLocaleString('vi-VN') const fmtMoney = (v: number) => v.toLocaleString('vi-VN') + ' VND' -type Tab = 'overview' | 'details' | 'history' - export function ContractDetailContent({ contract: c, onBack, @@ -45,7 +42,6 @@ export function ContractDetailContent({ const [decision, setDecision] = useState(ApprovalDecision.Approve) const [comment, setComment] = useState('') const [commentInput, setCommentInput] = useState('') - const [tab, setTab] = useState('overview') const transition = useMutation({ mutationFn: async () => { @@ -122,76 +118,81 @@ export function ContractDetailContent({ - {/* Tabs nav — Tổng quan / Chi tiết / Lịch sử */} - + {/* Tổng quan content — luôn hiển thị, không tabs */} +
+

Thông tin HĐ

+
+
Loại
{ContractTypeLabel[c.type] ?? '—'}
+
Giá trị
{fmtMoney(c.giaTri)}
+
NCC
{c.supplierName}
+
Dự án
{c.projectName}
+
Phòng ban
{c.departmentName ?? '—'}
+
Người soạn
{c.drafterName ?? '—'}
+
+
SLA
+
+
+
Bypass CCM
{c.bypassProcurementAndCCM ? 'Có (HĐ Chủ đầu tư)' : 'Không'}
+
+ {c.noiDung && ( +
+
Nội dung
+
{c.noiDung}
+
+ )} +
- {tab === 'overview' && ( - <> -
-

Thông tin HĐ

-
-
Loại
{ContractTypeLabel[c.type] ?? '—'}
-
Giá trị
{fmtMoney(c.giaTri)}
-
NCC
{c.supplierName}
-
Dự án
{c.projectName}
-
Phòng ban
{c.departmentName ?? '—'}
-
Người soạn
{c.drafterName ?? '—'}
-
-
SLA
-
+
+

+ + Góp ý ({c.comments.length}) +

+
+ {c.comments.length === 0 &&
Chưa có góp ý.
} + {c.comments.map(cm => ( +
+
+ {cm.userName} + {fmt(cm.createdAt)} · {ContractPhaseLabel[cm.phase]}
-
Bypass CCM
{c.bypassProcurementAndCCM ? 'Có (HĐ Chủ đầu tư)' : 'Không'}
-
- {c.noiDung && ( -
-
Nội dung
-
{c.noiDung}
-
- )} -
- -
-

- - Góp ý ({c.comments.length}) -

-
- {c.comments.length === 0 &&
Chưa có góp ý.
} - {c.comments.map(cm => ( -
-
- {cm.userName} - {fmt(cm.createdAt)} · {ContractPhaseLabel[cm.phase]} -
-
{cm.content}
-
- ))} +
{cm.content}
-
{ - e.preventDefault() - if (!commentInput.trim()) return - addComment.mutate(commentInput.trim()) - }} - > -