From 6c11fccc84f4c84fa72ee01f9caad9f76f35cea2 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 16 Sep 2025 09:20:58 +0000 Subject: (대표님, 최겸) 계약, 업로드 관련, 메뉴처리, 입찰, 프리쿼트, rfqLast관련, tbeLast관련 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../list/biddings-table-toolbar-actions.tsx | 100 +++++++++++++-------- 1 file changed, 65 insertions(+), 35 deletions(-) (limited to 'lib/bidding/list/biddings-table-toolbar-actions.tsx') diff --git a/lib/bidding/list/biddings-table-toolbar-actions.tsx b/lib/bidding/list/biddings-table-toolbar-actions.tsx index 2b7a9d7d..ed5538c6 100644 --- a/lib/bidding/list/biddings-table-toolbar-actions.tsx +++ b/lib/bidding/list/biddings-table-toolbar-actions.tsx @@ -2,12 +2,12 @@ import * as React from "react" import { type Table } from "@tanstack/react-table" -import { - Plus, Send, Gavel, Download, FileSpreadsheet, - Eye, Clock, CheckCircle +import { + Plus, Send, Download, FileSpreadsheet } from "lucide-react" import { toast } from "sonner" import { useRouter } from "next/navigation" +import { useSession } from "next-auth/react" import { exportTableToExcel } from "@/lib/export" import { Button } from "@/components/ui/button" import { @@ -19,6 +19,7 @@ import { } from "@/components/ui/dropdown-menu" import { BiddingListItem } from "@/db/schema" import { CreateBiddingDialog } from "./create-bidding-dialog" +import { TransmissionDialog } from "./biddings-transmission-dialog" interface BiddingsTableToolbarActionsProps { table: Table @@ -28,7 +29,11 @@ interface BiddingsTableToolbarActionsProps { export function BiddingsTableToolbarActions({ table, paymentTermsOptions, incotermsOptions }: BiddingsTableToolbarActionsProps) { const router = useRouter() + const { data: session } = useSession() const [isExporting, setIsExporting] = React.useState(false) + const [isTransmissionDialogOpen, setIsTransmissionDialogOpen] = React.useState(false) + + const userId = session?.user?.id ? Number(session.user.id) : 1 // 선택된 입찰들 const selectedBiddings = React.useMemo(() => { @@ -38,6 +43,9 @@ export function BiddingsTableToolbarActions({ table, paymentTermsOptions, incote .map(row => row.original) }, [table.getFilteredSelectedRowModel().rows]) + // 업체선정이 완료된 입찰만 전송 가능 + const canTransmit = selectedBiddings.length === 1 && selectedBiddings[0].status === 'vendor_selected' + const handleExport = async () => { try { setIsExporting(true) @@ -54,47 +62,69 @@ export function BiddingsTableToolbarActions({ table, paymentTermsOptions, incote } return ( -
- {/* 신규 생성 */} - + <> +
+ {/* 신규 생성 */} + - {/* 개찰 (입찰 오픈) */} - {/* {openEligibleBiddings.length > 0 && ( - - )} */} - {/* Export */} - - + {/* 개찰 (입찰 오픈) */} + {/* {openEligibleBiddings.length > 0 && ( - - - - - 입찰 목록 내보내기 - - - -
+ )} */} + + {/* Export */} + + + + + + + + 입찰 목록 내보내기 + + + +
+ + {/* 전송 다이얼로그 */} + + ) } \ No newline at end of file -- cgit v1.2.3