From 8cf1fe214ae4720fbc4e6718f371c24431a976ed Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 24 Apr 2026 13:06:18 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE:=20H=C4=90=20move=20Lich=20su=20d?= =?UTF-8?q?ieu=20chinh=20sang=20Panel=203=20duoi=20Lich=20su=20duyet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User request: 'cho hop dong dua cac thong tin lich su dieu chinh sang duoi lich su duyet nhen'. ContractDetailContent (Panel 2): xoa section 'Lich su dieu chinh' (cot 3/10 grid 7/3) → Chi tiet HD gio full-width. Remove import History + ContractChangelogsTab. WorkflowHistoryPanel (Panel 3): them section Lich su dieu chinh duoi Lich su duyet. Import History icon + ContractChangelogsTab. Reuse same component, chi doi vi tri render. Mirror fe-admin + fe-user. --- .../contracts/ContractDetailContent.tsx | 42 +++++++------------ .../contracts/WorkflowHistoryPanel.tsx | 15 ++++++- .../contracts/ContractDetailContent.tsx | 28 ++++--------- .../contracts/WorkflowHistoryPanel.tsx | 16 +++++-- 4 files changed, 50 insertions(+), 51 deletions(-) diff --git a/fe-admin/src/components/contracts/ContractDetailContent.tsx b/fe-admin/src/components/contracts/ContractDetailContent.tsx index cd4508e..b6ca917 100644 --- a/fe-admin/src/components/contracts/ContractDetailContent.tsx +++ b/fe-admin/src/components/contracts/ContractDetailContent.tsx @@ -1,16 +1,15 @@ // Reusable detail body — used by full-page ContractDetailPage AND embedded -// in ContractsListPage 3-panel layout (Panel 2). Admin variant include thêm -// Phòng ban + Bypass CCM trong Info section. Workflow + history live separately -// trong WorkflowHistoryPanel (Panel 3). +// in MyContractsPage 3-panel layout (Panel 2). Renders header (title + phase +// + actions) + Info + Comments + Attachments + transition Dialog. Workflow + +// approval history live separately in WorkflowHistoryPanel (Panel 3). import { useState, type FormEvent } from 'react' import { useMutation, useQueryClient } from '@tanstack/react-query' -import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, ListChecks, History } from 'lucide-react' +import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, ListChecks } from 'lucide-react' import { toast } from 'sonner' import { PhaseBadge } from '@/components/PhaseBadge' import { SlaTimer } from '@/components/SlaTimer' import { ContractAttachmentsSection } from '@/components/ContractAttachmentsSection' import { ContractDetailsTab } from '@/components/contracts/ContractDetailsTab' -import { ContractChangelogsTab } from '@/components/contracts/ContractChangelogsTab' import { Button } from '@/components/ui/Button' import { Select } from '@/components/ui/Select' import { Textarea } from '@/components/ui/Textarea' @@ -49,7 +48,7 @@ export function ContractDetailContent({ }, onSuccess: () => { qc.invalidateQueries({ queryKey: ['contract', c.id] }) - qc.invalidateQueries({ queryKey: ['contracts'] }) + qc.invalidateQueries({ queryKey: ['my-contracts'] }) qc.invalidateQueries({ queryKey: ['inbox'] }) toast.success('Đã chuyển phase') setActionOpen(false) @@ -65,7 +64,7 @@ export function ContractDetailContent({ onSuccess: () => { qc.invalidateQueries({ queryKey: ['contract', c.id] }) setCommentInput('') - toast.success('Đã gửi comment') + toast.success('Đã gửi') }, onError: err => toast.error(getErrorMessage(err)), }) @@ -84,7 +83,7 @@ export function ContractDetailContent({ return (
- {/* Header — sticky inside scroll container */} + {/* Header — sticky inside scroll container so actions luôn visible */}
@@ -126,13 +125,11 @@ export function ContractDetailContent({
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 && (
@@ -176,23 +173,14 @@ export function ContractDetailContent({ - {/* Chi tiết + Lịch sử điều chỉnh — 7/3 grid bên dưới */} -
-
-

- - Chi tiết ({ContractTypeLabel[c.type] ?? '—'}) -

- -
-
-

- - Lịch sử điều chỉnh -

- -
-
+ {/* Chi tiết HĐ full-width — Lịch sử điều chỉnh đã move sang Panel 3 */} +
+

+ + Chi tiết ({ContractTypeLabel[c.type] ?? '—'}) +

+ +
new Date(s).toLocaleString('vi-VN') @@ -40,6 +43,14 @@ export function WorkflowHistoryPanel({ contract: c }: { contract: ContractDetail ))} + +
+

+ + Lịch sử điều chỉnh +

+ +
) } diff --git a/fe-user/src/components/contracts/ContractDetailContent.tsx b/fe-user/src/components/contracts/ContractDetailContent.tsx index a5a25fb..b6ca917 100644 --- a/fe-user/src/components/contracts/ContractDetailContent.tsx +++ b/fe-user/src/components/contracts/ContractDetailContent.tsx @@ -4,13 +4,12 @@ // approval history live separately in WorkflowHistoryPanel (Panel 3). import { useState, type FormEvent } from 'react' import { useMutation, useQueryClient } from '@tanstack/react-query' -import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, ListChecks, History } from 'lucide-react' +import { ArrowLeft, CheckCircle2, MessageSquare, XCircle, ListChecks } from 'lucide-react' import { toast } from 'sonner' import { PhaseBadge } from '@/components/PhaseBadge' import { SlaTimer } from '@/components/SlaTimer' import { ContractAttachmentsSection } from '@/components/ContractAttachmentsSection' import { ContractDetailsTab } from '@/components/contracts/ContractDetailsTab' -import { ContractChangelogsTab } from '@/components/contracts/ContractChangelogsTab' import { Button } from '@/components/ui/Button' import { Select } from '@/components/ui/Select' import { Textarea } from '@/components/ui/Textarea' @@ -174,23 +173,14 @@ export function ContractDetailContent({ - {/* Chi tiết + Lịch sử điều chỉnh — 7/3 grid bên dưới */} -
-
-

- - Chi tiết ({ContractTypeLabel[c.type] ?? '—'}) -

- -
-
-

- - Lịch sử điều chỉnh -

- -
-
+ {/* Chi tiết HĐ full-width — Lịch sử điều chỉnh đã move sang Panel 3 */} +
+

+ + Chi tiết ({ContractTypeLabel[c.type] ?? '—'}) +

+ +
new Date(s).toLocaleString('vi-VN') @@ -41,6 +43,14 @@ export function WorkflowHistoryPanel({ contract: c }: { contract: ContractDetail ))} + +
+

+ + Lịch sử điều chỉnh +

+ +
) }