summaryrefslogtreecommitdiff
path: root/lib/bidding/selection/vendor-selection-table.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-11-12 10:42:36 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-11-12 10:42:36 +0000
commit8642ee064ddf96f1db2b948b4cc8bbbd6cfee820 (patch)
tree36bd57d147ba929f1d72918d1fb91ad2c4778624 /lib/bidding/selection/vendor-selection-table.tsx
parent57ea2f740abf1c7933671561cfe0e421fb5ef3fc (diff)
(최겸) 구매 일반계약, 입찰 수정
Diffstat (limited to 'lib/bidding/selection/vendor-selection-table.tsx')
-rw-r--r--lib/bidding/selection/vendor-selection-table.tsx66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/bidding/selection/vendor-selection-table.tsx b/lib/bidding/selection/vendor-selection-table.tsx
new file mode 100644
index 00000000..8570b5b6
--- /dev/null
+++ b/lib/bidding/selection/vendor-selection-table.tsx
@@ -0,0 +1,66 @@
+'use client'
+
+import * as React from 'react'
+import { Bidding } from '@/db/schema'
+import { BiddingDetailVendorTableContent } from '../detail/table/bidding-detail-vendor-table'
+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
+import { getBiddingDetailData } from '../detail/service'
+
+interface VendorSelectionTableProps {
+ biddingId: number
+ bidding: Bidding
+ onRefresh: () => void
+}
+
+export function VendorSelectionTable({ biddingId, bidding, onRefresh }: VendorSelectionTableProps) {
+ const [vendors, setVendors] = React.useState<any[]>([])
+ const [loading, setLoading] = React.useState(true)
+
+ React.useEffect(() => {
+ const loadData = async () => {
+ try {
+ setLoading(true)
+ const data = await getBiddingDetailData(biddingId)
+ setVendors(data.quotationVendors)
+ } catch (error) {
+ console.error('Failed to load vendors:', error)
+ } finally {
+ setLoading(false)
+ }
+ }
+
+ loadData()
+ }, [biddingId])
+
+ if (loading) {
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>업체선정</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <div className="flex items-center justify-center py-8">
+ <div className="text-sm text-muted-foreground">로딩 중...</div>
+ </div>
+ </CardContent>
+ </Card>
+ )
+ }
+
+ return (
+ <Card>
+ <CardHeader>
+ <CardTitle>업체선정</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <BiddingDetailVendorTableContent
+ biddingId={biddingId}
+ bidding={bidding}
+ vendors={vendors}
+ onRefresh={onRefresh}
+ onOpenSelectionReasonDialog={() => {}}
+ />
+ </CardContent>
+ </Card>
+ )
+}