diff options
Diffstat (limited to 'lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx')
| -rw-r--r-- | lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx b/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx index c1b1baa5..6c209e2d 100644 --- a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx +++ b/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-toolbar-actions.tsx @@ -4,10 +4,11 @@ import * as React from "react" import { type Table } from "@tanstack/react-table" import { useTransition } from "react" import { Button } from "@/components/ui/button" -import { Plus, Send, Mail } from "lucide-react" +import { Plus, Send, Mail, CheckSquare } from "lucide-react" import { BiddingCompany } from "./bidding-pre-quote-vendor-columns" import { BiddingPreQuoteVendorCreateDialog } from "./bidding-pre-quote-vendor-create-dialog" import { BiddingPreQuoteInvitationDialog } from "./bidding-pre-quote-invitation-dialog" +import { BiddingPreQuoteSelectionDialog } from "./bidding-pre-quote-selection-dialog" import { Bidding } from "@/db/schema" import { useToast } from "@/hooks/use-toast" @@ -36,6 +37,7 @@ export function BiddingPreQuoteVendorToolbarActions({ const [isPending, startTransition] = useTransition() const [isCreateDialogOpen, setIsCreateDialogOpen] = React.useState(false) const [isInvitationDialogOpen, setIsInvitationDialogOpen] = React.useState(false) + const [isSelectionDialogOpen, setIsSelectionDialogOpen] = React.useState(false) const handleCreateCompany = () => { setIsCreateDialogOpen(true) @@ -45,6 +47,19 @@ export function BiddingPreQuoteVendorToolbarActions({ setIsInvitationDialogOpen(true) } + const handleManageSelection = () => { + const selectedRows = table.getFilteredSelectedRowModel().rows + if (selectedRows.length === 0) { + toast({ + title: '선택 필요', + description: '본입찰 선정 상태를 변경할 업체를 선택해주세요.', + variant: 'destructive', + }) + return + } + setIsSelectionDialogOpen(true) + } + return ( @@ -69,6 +84,16 @@ export function BiddingPreQuoteVendorToolbarActions({ <Mail className="mr-2 h-4 w-4" /> 초대 발송 </Button> + + <Button + variant="secondary" + size="sm" + onClick={handleManageSelection} + disabled={isPending} + > + <CheckSquare className="mr-2 h-4 w-4" /> + 본입찰 선정 + </Button> </div> <BiddingPreQuoteVendorCreateDialog @@ -87,6 +112,16 @@ export function BiddingPreQuoteVendorToolbarActions({ companies={biddingCompanies} onSuccess={onSuccess} /> + + <BiddingPreQuoteSelectionDialog + open={isSelectionDialogOpen} + onOpenChange={setIsSelectionDialogOpen} + selectedCompanies={table.getFilteredSelectedRowModel().rows.map(row => row.original)} + onSuccess={() => { + onSuccess() + table.resetRowSelection() + }} + /> </> ) } |
