summaryrefslogtreecommitdiff
path: root/lib/po/vendor-table/vendor-po-table.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-10-13 17:29:33 +0900
committerjoonhoekim <26rote@gmail.com>2025-10-13 17:29:33 +0900
commite84cf02a1cb4959a9d3bb5bbf37885c13a447f78 (patch)
treecfb2817e3bd8f5ef08b4428b9e6fc619ef3884a1 /lib/po/vendor-table/vendor-po-table.tsx
parent89274bffa596ffdfc4275fb8d11cdb02ff9a2d02 (diff)
(김준회) SHI/벤더 PO 구현
Diffstat (limited to 'lib/po/vendor-table/vendor-po-table.tsx')
-rw-r--r--lib/po/vendor-table/vendor-po-table.tsx20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/po/vendor-table/vendor-po-table.tsx b/lib/po/vendor-table/vendor-po-table.tsx
index a3ad4949..99b0e5eb 100644
--- a/lib/po/vendor-table/vendor-po-table.tsx
+++ b/lib/po/vendor-table/vendor-po-table.tsx
@@ -4,18 +4,19 @@ import * as React from "react"
import type {
DataTableAdvancedFilterField,
DataTableFilterField,
- DataTableRowAction,
} from "@/types/table"
import { useDataTable } from "@/hooks/use-data-table"
import { DataTable } from "@/components/data-table/data-table"
import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar"
import { toast } from "sonner"
+import { useRouter, useParams } from "next/navigation"
import { getVendorPOs, handleVendorPOAction } from "./service"
import { getVendorColumns } from "./vendor-po-columns"
import { VendorPO, VendorPOActionType } from "./types"
import { VendorPOItemsDialog } from "./vendor-po-items-dialog"
+import { VendorPONoteDialog } from "./vendor-po-note-dialog"
import { VendorPOToolbarActions } from "./vendor-po-toolbar-actions"
interface VendorPoTableProps {
@@ -27,6 +28,10 @@ interface VendorPoTableProps {
}
export function VendorPoTable({ promises }: VendorPoTableProps) {
+ const router = useRouter()
+ const params = useParams()
+ const lng = params.lng as string
+
const [data, setData] = React.useState<{
data: VendorPO[];
pageCount: number;
@@ -43,10 +48,11 @@ export function VendorPoTable({ promises }: VendorPoTableProps) {
}, [promises]);
const [rowAction, setRowAction] =
- React.useState<DataTableRowAction<VendorPO> | null>(null)
+ React.useState<{ row: { original: VendorPO }; type: VendorPOActionType } | null>(null)
// 다이얼로그 상태
const [itemsDialogOpen, setItemsDialogOpen] = React.useState(false)
+ const [noteDialogOpen, setNoteDialogOpen] = React.useState(false)
const [selectedPO, setSelectedPO] = React.useState<VendorPO | null>(null)
// 행 선택 처리 (1개만 선택 가능)
@@ -88,10 +94,10 @@ export function VendorPoTable({ promises }: VendorPoTableProps) {
setItemsDialogOpen(true)
break
case "contract-detail":
- toast.info("계약상세 기능은 개발 중입니다.")
+ router.push(`/${lng}/partners/po/${po.id}`)
break
case "po-note":
- toast.info("PO Note 기능은 개발 중입니다.")
+ setNoteDialogOpen(true)
break
case "price-index":
toast.info("연동표입력 기능은 개발 중입니다.")
@@ -242,6 +248,12 @@ export function VendorPoTable({ promises }: VendorPoTableProps) {
onOpenChange={setItemsDialogOpen}
po={selectedPO}
/>
+
+ <VendorPONoteDialog
+ open={noteDialogOpen}
+ onOpenChange={setNoteDialogOpen}
+ po={selectedPO}
+ />
</>
)
} \ No newline at end of file