summaryrefslogtreecommitdiff
path: root/lib/po/vendor-table/shi-vendor-po-table.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/po/vendor-table/shi-vendor-po-table.tsx')
-rw-r--r--lib/po/vendor-table/shi-vendor-po-table.tsx46
1 files changed, 2 insertions, 44 deletions
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}
- />
- )}
</>
)
}