From e84cf02a1cb4959a9d3bb5bbf37885c13a447f78 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 13 Oct 2025 17:29:33 +0900
Subject: (김준회) SHI/벤더 PO 구현
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/po/vendor-table/vendor-po-columns.tsx | 158 +++---------------------------
 1 file changed, 16 insertions(+), 142 deletions(-)

(limited to 'lib/po/vendor-table/vendor-po-columns.tsx')

diff --git a/lib/po/vendor-table/vendor-po-columns.tsx b/lib/po/vendor-table/vendor-po-columns.tsx
index 0910eaf8..c954b872 100644
--- a/lib/po/vendor-table/vendor-po-columns.tsx
+++ b/lib/po/vendor-table/vendor-po-columns.tsx
@@ -2,43 +2,16 @@
 
 import * as React from "react"
 import { type ColumnDef } from "@tanstack/react-table"
-import { 
-  FileTextIcon, 
-  MoreHorizontalIcon,
-  EyeIcon,
-  PrinterIcon,
-  FileXIcon,
-  PlusIcon,
-  EditIcon
-} from "lucide-react"
+import { FileTextIcon } from "lucide-react"
 import { Button } from "@/components/ui/button"
 import { Badge } from "@/components/ui/badge"
 import { Checkbox } from "@/components/ui/checkbox"
-import {
-  Tooltip,
-  TooltipContent,
-  TooltipProvider,
-  TooltipTrigger,
-} from "@/components/ui/tooltip"
-import {
-  DropdownMenu,
-  DropdownMenuContent,
-  DropdownMenuItem,
-  DropdownMenuLabel,
-  DropdownMenuSeparator,
-  DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
 import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table-column-simple-header"
 import { VendorPO, VendorPOActionType } from "./types"
-
-// 벤더 PO용 행 액션 타입
-type VendorPORowAction = {
-  row: { original: VendorPO }
-  type: VendorPOActionType
-}
+import { VendorPOActions } from "./vendor-po-actions"
 
 interface GetVendorColumnsProps {
-  setRowAction: React.Dispatch<React.SetStateAction<VendorPORowAction | null>>
+  setRowAction: React.Dispatch<React.SetStateAction<{ row: { original: VendorPO }; type: VendorPOActionType } | null>>
   selectedRows?: number[]
   onRowSelect?: (id: number, selected: boolean) => void
 }
@@ -333,18 +306,19 @@ export function getVendorColumns({ setRowAction, selectedRows = [], onRowSelect
       size: 120,
     },
 
+    // 데이터 및 룰이 없어 구현불가한 컬럼 주석 처리 --> 안내됨
     // L/C No.
-    {
-      accessorKey: "lcNo",
-      header: ({ column }) => (
-        <DataTableColumnHeaderSimple column={column} title="L/C No." />
-      ),
-      cell: ({ row }) => {
-        const lcNo = row.getValue("lcNo") as string
-        return <div className="text-sm">{lcNo || '-'}</div>
-      },
-      size: 120,
-    },
+    // {
+    //   accessorKey: "lcNo",
+    //   header: ({ column }) => (
+    //     <DataTableColumnHeaderSimple column={column} title="L/C No." />
+    //   ),
+    //   cell: ({ row }) => {
+    //     const lcNo = row.getValue("lcNo") as string
+    //     return <div className="text-sm">{lcNo || '-'}</div>
+    //   },
+    //   size: 120,
+    // },
 
     // 납품대금 연동제 대상
     {
@@ -403,107 +377,7 @@ export function getVendorColumns({ setRowAction, selectedRows = [], onRowSelect
       id: "actions",
       enableHiding: false,
       header: () => <div className="text-center">액션</div>,
-      cell: function Cell({ row }) {
-        return (
-          <div className="flex gap-1">
-            {/* 상세품목 버튼 */}
-            <TooltipProvider>
-              <Tooltip>
-                <TooltipTrigger asChild>
-                  <Button
-                    variant="outline"
-                    size="sm"
-                    className="h-8 px-2"
-                    onClick={() => setRowAction({ row, type: "view-items" })}
-                  >
-                    <FileTextIcon className="h-3.5 w-3.5" aria-hidden="true" />
-                  </Button>
-                </TooltipTrigger>
-                <TooltipContent>
-                  상세품목 보기
-                </TooltipContent>
-              </Tooltip>
-            </TooltipProvider>
-
-            {/* 드롭다운 메뉴
-            <DropdownMenu>
-              <DropdownMenuTrigger asChild>
-                <Button variant="ghost" className="h-8 w-8 p-0">
-                  <span className="sr-only">Open menu</span>
-                  <MoreHorizontalIcon className="h-4 w-4" />
-                </Button>
-              </DropdownMenuTrigger>
-              <DropdownMenuContent align="end">
-                <DropdownMenuLabel>액션</DropdownMenuLabel>
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "view-items" })}
-                >
-                  <FileTextIcon className="mr-2 h-4 w-4" />
-                  상세품목 보기
-                </DropdownMenuItem>
-                <DropdownMenuSeparator />
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "pcr-create" })}
-                >
-                  <PlusIcon className="mr-2 h-4 w-4" />
-                  PCR생성
-                </DropdownMenuItem>
-                
-                <DropdownMenuSeparator />
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "approve" })}
-                >
-                  승인
-                </DropdownMenuItem>
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "cancel-approve" })}
-                >
-                  승인취소
-                </DropdownMenuItem>
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "reject-contract" })}
-                  className="text-red-600"
-                >
-                  <FileXIcon className="mr-2 h-4 w-4" />
-                  계약거절
-                </DropdownMenuItem>
-                
-                <DropdownMenuSeparator />
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "print-contract" })}
-                >
-                  <PrinterIcon className="mr-2 h-4 w-4" />
-                  계약서출력
-                </DropdownMenuItem>
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "contract-detail" })}
-                >
-                  <EyeIcon className="mr-2 h-4 w-4" />
-                  계약상세
-                </DropdownMenuItem>
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "po-note" })}
-                >
-                  <EditIcon className="mr-2 h-4 w-4" />
-                  PO Note
-                </DropdownMenuItem>
-                
-                <DropdownMenuItem
-                  onClick={() => setRowAction({ row, type: "price-index" })}
-                >
-                  연동표입력
-                </DropdownMenuItem>
-              </DropdownMenuContent>
-            </DropdownMenu> */}
-          </div>
-        );
-      },
+      cell: ({ row }) => <VendorPOActions row={row} setRowAction={setRowAction} />,
       size: 120,
       minSize: 100,
     },
-- 
cgit v1.2.3

