// THROWAWAY — harness FD2 cho S162 (cây 4 folder GĐ). XOÁ SAU KHI CHỤP. // Render CHÍNH các component thật (không vẽ lại markup) với cache TanStack seed // sẵn + menu quyền seed vào localStorage ⇒ soi được UI mà không cần API/SQL. import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import { MemoryRouter } from 'react-router-dom' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import './index.css' import { AuthProvider } from '@/contexts/AuthContext' import { PipelineStageFolders } from '@/components/pipeline/PipelineStageFolders' import { PipelineTreePanel } from '@/components/pipeline/PipelineTreePanel' const menu = [ { key: 'PurchaseEvaluations', label: 'Duyệt NCC', parentKey: null, order: 1, icon: null, canRead: true, canCreate: true, canUpdate: true, canDelete: true, isVisible: true, displayLabel: null, children: [] }, { key: 'KeHoachKyKet', label: 'Kế hoạch ký kết HĐ', parentKey: null, order: 2, icon: null, canRead: true, canCreate: true, canUpdate: true, canDelete: true, isVisible: true, displayLabel: null, children: [] }, { key: 'Contracts', label: 'Duyệt hợp đồng', parentKey: null, order: 3, icon: null, canRead: true, canCreate: true, canUpdate: true, canDelete: true, isVisible: true, displayLabel: null, children: [] }, { key: 'HopDongCung', label: 'Hợp đồng cứng', parentKey: null, order: 4, icon: null, canRead: true, canCreate: true, canUpdate: true, canDelete: true, isVisible: true, displayLabel: null, children: [] }, ] localStorage.setItem('solution-erp-user-token', 'harness') localStorage.setItem('solution-erp-user-user', JSON.stringify({ id: 'u1', fullName: 'Harness', email: 'h@x.vn', roles: [] })) localStorage.setItem('solution-erp-user-menu', JSON.stringify(menu)) const pe = (i: number, over: Record) => ({ id: `pe-${i}`, maPhieu: `PDG-2026-${String(i).padStart(3, '0')}`, tenGoiThau: 'Cung cấp và lắp đặt hệ thống điện nhẹ khối A', type: 1, phase: 7, projectId: 'prj-1', projectName: 'Khu phức hợp Sunrise Riverside', projectCode: 'SRS', workItemId: 'wi-1', workItemName: '02 Hệ thống điện nhẹ', selectedSupplierId: null, selectedSupplierName: null, contractId: null, slaDeadline: null, createdAt: '2026-05-14T03:00:00Z', updatedAt: null, drafterUserId: 'u1', drafterName: 'Nguyễn Văn Kiệt', departmentId: 'd1', departmentName: 'Phòng Mua hàng', budgetPeriodAmount: null, expectedRemainingAmount: null, isUrgentByPro: false, isUrgentByCcm: false, winnerSupplierNames: [], endsBeforeCeo: false, finalizeStepName: null, finalizeLevelName: null, ...over, }) const peRows = [ pe(1, { contractId: 'ct-1' }), pe(2, { phase: 3, tenGoiThau: 'Thi công phần thô tháp B', maPhieu: 'PDG-2026-002' }), pe(3, { workItemId: 'wi-2', workItemName: '10 Cửa nhôm kính', tenGoiThau: 'Cửa nhôm kính mặt dựng', maPhieu: 'PDG-2026-003', createdAt: '2026-03-02T03:00:00Z' }), pe(4, { projectId: 'prj-2', projectName: 'Nhà máy Đại An giai đoạn 2', projectCode: 'DAN', workItemId: null, workItemName: null, tenGoiThau: 'San lấp mặt bằng', maPhieu: 'PDG-2026-004', createdAt: '2025-11-20T03:00:00Z' }), ] const khkk = [{ id: 'kh-1', maKeHoach: 'KHKK-2026-001', phase: 3, purchaseEvaluationId: 'pe-1', peMaPhieu: 'PDG-2026-001', peTenGoiThau: 'Cung cấp và lắp đặt hệ thống điện nhẹ khối A', projectId: 'prj-1', projectName: 'Khu phức hợp Sunrise Riverside', departmentId: null, departmentName: null, drafterUserId: 'u1', drafterFullName: 'Nguyễn Văn Kiệt', approvalWorkflowId: null, workflowCode: null, currentApprovalLevelOrder: null, totalProposedAmount: 4200000000, createdAt: '2026-06-01T03:00:00Z', updatedAt: null, }] const contracts = [{ id: 'ct-1', maHopDong: 'HĐ-TP-2026-014', tenHopDong: 'HĐ thi công hệ thống điện nhẹ khối A', type: 1, phase: 9, supplierId: 's1', supplierName: 'Công ty TNHH Điện nhẹ Toàn Cầu', projectId: 'prj-1', projectName: 'Khu phức hợp Sunrise Riverside', giaTri: 4150000000, slaDeadline: null, createdAt: '2026-06-20T03:00:00Z', hasSealedCopy: true, }] const qc = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: 600_000 } } }) qc.setQueryData(['pipeline-pe-index'], peRows) qc.setQueryData(['pipeline-khkk-index'], khkk) qc.setQueryData(['pipeline-contract-index'], contracts) // Vỏ cây trang Duyệt NCC (sao markup từ PurchaseEvaluationsListPage để soi // folder trong đúng ngữ cảnh). Leaf phiếu = rút gọn của dòng phiếu thật. function PeTreeShell() { return ( ) } function Section({ title, children }: { title: string; children: React.ReactNode }) { return (

{title}

{children}
) } createRoot(document.getElementById('root')!).render(
{} }] }, { n: 2, leaves: [], locked: true }, { n: 3, leaves: [], failed: true }, { n: 4, leaves: [] }, ]} />
, )