diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-29 07:43:44 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-29 07:43:44 +0000 |
| commit | 2eb717eb2bbfd97a5f149d13049aa336c26c393b (patch) | |
| tree | 274283b7759bfba619e6d143edccf3845ba45ed6 /lib/vendor-investigation/table/investigation-table.tsx | |
| parent | bfc26491991997b5b109af6ea6bc75a8be138e9a (diff) | |
(최겸) 구매 실사 개발(진행중)
Diffstat (limited to 'lib/vendor-investigation/table/investigation-table.tsx')
| -rw-r--r-- | lib/vendor-investigation/table/investigation-table.tsx | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/lib/vendor-investigation/table/investigation-table.tsx b/lib/vendor-investigation/table/investigation-table.tsx index b7663629..ee122f04 100644 --- a/lib/vendor-investigation/table/investigation-table.tsx +++ b/lib/vendor-investigation/table/investigation-table.tsx @@ -16,8 +16,10 @@ import { getColumns } from "./investigation-table-columns" import { getVendorsInvestigation } from "../service" import { VendorsTableToolbarActions } from "./investigation-table-toolbar-actions" import { VendorInvestigationsViewWithContacts } from "@/config/vendorInvestigationsColumnsConfig" -import { UpdateVendorInvestigationSheet } from "./update-investigation-sheet" +import { InvestigationResultSheet } from "./investigation-result-sheet" +import { InvestigationProgressSheet } from "./investigation-progress-sheet" import { VendorDetailsDialog } from "./vendor-details-dialog" +import { SupplementRequestDialog } from "@/components/investigation/supplement-request-dialog" interface VendorsTableProps { promises: Promise< @@ -54,12 +56,34 @@ export function VendorsInvestigationTable({ promises }: VendorsTableProps) { const [vendorDetailsOpen, setVendorDetailsOpen] = React.useState(false) const [selectedVendorId, setSelectedVendorId] = React.useState<number | null>(null) + // Add state for supplement request dialog + const [supplementRequestOpen, setSupplementRequestOpen] = React.useState(false) + const [supplementRequestData, setSupplementRequestData] = React.useState<{ + investigationId: number + investigationMethod: string + vendorName: string + } | null>(null) + // Create handler for opening vendor details modal const openVendorDetailsModal = React.useCallback((vendorId: number) => { setSelectedVendorId(vendorId) setVendorDetailsOpen(true) }, []) + // Create handler for opening supplement request dialog + const openSupplementRequestDialog = React.useCallback(( + investigationId: number, + investigationMethod: string, + vendorName: string + ) => { + setSupplementRequestData({ + investigationId, + investigationMethod, + vendorName + }) + setSupplementRequestOpen(true) + }, []) + // Get router const router = useRouter() @@ -67,9 +91,10 @@ export function VendorsInvestigationTable({ promises }: VendorsTableProps) { const columns = React.useMemo( () => getColumns({ setRowAction, - openVendorDetailsModal + openVendorDetailsModal, + openSupplementRequestDialog }), - [setRowAction, openVendorDetailsModal] + [setRowAction, openVendorDetailsModal, openSupplementRequestDialog] ) // 기본 필터 필드들 @@ -174,9 +199,15 @@ export function VendorsInvestigationTable({ promises }: VendorsTableProps) { </DataTableAdvancedToolbar> </DataTable> - {/* Update Investigation Sheet */} - <UpdateVendorInvestigationSheet - open={rowAction?.type === "update"} + {/* Update Investigation Sheets */} + <InvestigationProgressSheet + open={rowAction?.type === "update-progress"} + onOpenChange={() => setRowAction(null)} + investigation={rowAction?.row.original ?? null} + /> + + <InvestigationResultSheet + open={rowAction?.type === "update-result"} onOpenChange={() => setRowAction(null)} investigation={rowAction?.row.original ?? null} /> @@ -187,6 +218,14 @@ export function VendorsInvestigationTable({ promises }: VendorsTableProps) { onOpenChange={setVendorDetailsOpen} vendorId={selectedVendorId} /> + + <SupplementRequestDialog + open={supplementRequestOpen} + onOpenChange={setSupplementRequestOpen} + investigationId={supplementRequestData?.investigationId || 0} + investigationMethod={supplementRequestData?.investigationMethod || ""} + vendorName={supplementRequestData?.vendorName || ""} + /> </> ) }
\ No newline at end of file |
