summaryrefslogtreecommitdiff
path: root/lib/vendor-investigation/table/investigation-table.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vendor-investigation/table/investigation-table.tsx')
-rw-r--r--lib/vendor-investigation/table/investigation-table.tsx51
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