diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/po/vendor-table/shi-vendor-po-columns.tsx | 39 | ||||
| -rw-r--r-- | lib/po/vendor-table/shi-vendor-po-table.tsx | 46 |
2 files changed, 7 insertions, 78 deletions
diff --git a/lib/po/vendor-table/shi-vendor-po-columns.tsx b/lib/po/vendor-table/shi-vendor-po-columns.tsx index 356b3dab..2aa7996b 100644 --- a/lib/po/vendor-table/shi-vendor-po-columns.tsx +++ b/lib/po/vendor-table/shi-vendor-po-columns.tsx @@ -2,10 +2,8 @@ import * as React from "react" import { type ColumnDef } from "@tanstack/react-table" -import { - SendIcon, +import { FileTextIcon, - MoreHorizontalIcon, EyeIcon, } from "lucide-react" import { useRouter, useParams } from "next/navigation" @@ -14,14 +12,6 @@ import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { Tooltip, TooltipContent, TooltipProvider, @@ -31,10 +21,10 @@ import { DataTableColumnHeaderSimple } from "@/components/data-table/data-table- import { VendorPO } from "./types" -// 서명 요청 전용 액션 타입 -type ShiVendorPORowAction = { +// 액션 타입 +export type ShiVendorPORowAction = { row: { original: VendorPO } - type: "view-items" | "signature-request" + type: "view-items" } interface GetShiVendorColumnsProps { @@ -410,7 +400,7 @@ export function getShiVendorColumns({ const router = useRouter() // eslint-disable-next-line react-hooks/rules-of-hooks const params = useParams() - const lng = params.lng as string + const lng = (params?.lng as string) || 'ko' return ( <div className="flex items-center justify-center gap-2"> @@ -434,25 +424,6 @@ export function getShiVendorColumns({ </Tooltip> </TooltipProvider> - {/* 서명 요청 버튼 */} - <TooltipProvider> - <Tooltip> - <TooltipTrigger asChild> - <Button - variant="outline" - size="sm" - className="h-8 px-2 text-blue-600 border-blue-200 hover:bg-blue-50" - onClick={() => setRowAction({ row, type: "signature-request" })} - > - <SendIcon className="h-3.5 w-3.5 mr-1" aria-hidden="true" /> - 서명 요청 - </Button> - </TooltipTrigger> - <TooltipContent> - 벤더에게 전자서명 요청 - </TooltipContent> - </Tooltip> - </TooltipProvider> </div> ) }, diff --git a/lib/po/vendor-table/shi-vendor-po-table.tsx b/lib/po/vendor-table/shi-vendor-po-table.tsx index 851f831e..6c5f62ef 100644 --- a/lib/po/vendor-table/shi-vendor-po-table.tsx +++ b/lib/po/vendor-table/shi-vendor-po-table.tsx @@ -4,7 +4,6 @@ import * as React from "react" import type { DataTableAdvancedFilterField, DataTableFilterField, - DataTableRowAction, } from "@/types/table" import { useDataTable } from "@/hooks/use-data-table" @@ -13,11 +12,10 @@ import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-adv import { toast } from "sonner" import { getVendorPOs, handleVendorPOAction } from "./service" -import { getShiVendorColumns } from "./shi-vendor-po-columns" +import { getShiVendorColumns, type ShiVendorPORowAction } from "./shi-vendor-po-columns" import { VendorPO, VendorPOActionType } from "./types" import { VendorPOItemsDialog } from "./vendor-po-items-dialog" import { ShiVendorPOToolbarActions } from "./shi-vendor-po-toolbar-actions" -import { SignatureRequestModal } from "@/lib/po/table/sign-request-dialog" interface ShiVendorPoTableProps { promises: Promise< @@ -27,14 +25,6 @@ interface ShiVendorPoTableProps { > } -// Interface for signing party (서명 요청에 사용) -interface SigningParty { - signerEmail: string; - signerName: string; - signerPosition: string; - signerType: "REQUESTER" | "VENDOR"; - vendorContactId?: number; -} export function ShiVendorPoTable({ promises }: ShiVendorPoTableProps) { const [data, setData] = React.useState<{ @@ -53,11 +43,10 @@ export function ShiVendorPoTable({ promises }: ShiVendorPoTableProps) { }, [promises]); const [rowAction, setRowAction] = - React.useState<DataTableRowAction<VendorPO> | null>(null) + React.useState<ShiVendorPORowAction | null>(null) // 다이얼로그 상태 const [itemsDialogOpen, setItemsDialogOpen] = React.useState(false) - const [signatureModalOpen, setSignatureModalOpen] = React.useState(false) const [selectedPO, setSelectedPO] = React.useState<VendorPO | null>(null) // 행 선택 처리 (1개만 선택 가능) @@ -80,9 +69,6 @@ export function ShiVendorPoTable({ promises }: ShiVendorPoTableProps) { case "view-items": setItemsDialogOpen(true) break - case "signature-request": - setSignatureModalOpen(true) - break case "item-status": setItemsDialogOpen(true) break @@ -109,20 +95,6 @@ export function ShiVendorPoTable({ promises }: ShiVendorPoTableProps) { } } - // 서명 요청 처리 함수 - const handleSignatureRequest = async ( - values: { signers: SigningParty[] }, - contractId: number - ): Promise<void> => { - try { - // TODO: 실제 서명 요청 API 호출 - console.log("Signature request for contract:", contractId, values); - toast.success("서명 요청이 성공적으로 전송되었습니다."); - } catch (error) { - console.error("Error sending signature requests:", error); - toast.error("서명 요청 전송 중 오류가 발생했습니다."); - } - } const columns = React.useMemo( () => getShiVendorColumns({ @@ -248,20 +220,6 @@ export function ShiVendorPoTable({ promises }: ShiVendorPoTableProps) { po={selectedPO} /> - {/* 서명 요청 모달 */} - {selectedPO && ( - <SignatureRequestModal - contract={{ - id: selectedPO.id, - contractNo: selectedPO.contractNo, - contractName: selectedPO.contractName, - // 필요한 다른 필드들 매핑 - } as any} - open={signatureModalOpen} - onOpenChange={setSignatureModalOpen} - onSubmit={handleSignatureRequest} - /> - )} </> ) } |
