summaryrefslogtreecommitdiff
path: root/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bidding/detail/table/bidding-detail-vendor-columns.tsx')
-rw-r--r--lib/bidding/detail/table/bidding-detail-vendor-columns.tsx171
1 files changed, 61 insertions, 110 deletions
diff --git a/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx b/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
index 6f02497f..bb1d2c62 100644
--- a/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
+++ b/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
@@ -23,13 +23,17 @@ interface GetVendorColumnsProps {
onDelete: (vendor: QuotationVendor) => void
onSelectWinner: (vendor: QuotationVendor) => void
onViewPriceAdjustment?: (vendor: QuotationVendor) => void
+ onSendBidding?: (vendor: QuotationVendor) => void
+ onUpdateParticipation?: (vendor: QuotationVendor, participated: boolean) => void
}
export function getBiddingDetailVendorColumns({
onEdit,
onDelete,
onSelectWinner,
- onViewPriceAdjustment
+ onViewPriceAdjustment,
+ onSendBidding,
+ onUpdateParticipation
}: GetVendorColumnsProps): ColumnDef<QuotationVendor>[] {
return [
{
@@ -66,13 +70,6 @@ export function getBiddingDetailVendorColumns({
),
},
{
- accessorKey: 'contactPerson',
- header: '담당자',
- cell: ({ row }) => (
- <div className="text-sm">{row.original.contactPerson || '-'}</div>
- ),
- },
- {
accessorKey: 'quotationAmount',
header: '견적금액',
cell: ({ row }) => (
@@ -82,15 +79,45 @@ export function getBiddingDetailVendorColumns({
),
},
{
+ accessorKey: 'biddingResult',
+ header: '입찰결과',
+ cell: ({ row }) => {
+ const isWinner = row.original.isWinner
+ if (isWinner === null || isWinner === undefined) {
+ return <div>-</div>
+ }
+ return (
+ <Badge variant={isWinner ? 'default' : 'secondary'} className={isWinner ? 'bg-green-600' : ''}>
+ {isWinner ? '낙찰' : '탈락'}
+ </Badge>
+ )
+ },
+ },
+ {
accessorKey: 'awardRatio',
header: '발주비율',
cell: ({ row }) => (
<div className="text-right">
- {row.original.awardRatio ? `${row.original.awardRatio}%` : '-'}
+ {row.original.awardRatio !== null ? `${row.original.awardRatio}%` : '-'}
</div>
),
},
{
+ accessorKey: 'isBiddingParticipated',
+ header: '입찰참여',
+ cell: ({ row }) => {
+ const participated = row.original.isBiddingParticipated
+ if (participated === null) {
+ return <Badge variant="outline">대기</Badge>
+ }
+ return (
+ <Badge variant={participated ? 'default' : 'destructive'}>
+ {participated ? '응찰' : '미응찰'}
+ </Badge>
+ )
+ },
+ },
+ {
accessorKey: 'status',
header: '상태',
cell: ({ row }) => {
@@ -116,103 +143,6 @@ export function getBiddingDetailVendorColumns({
),
},
{
- accessorKey: 'paymentTermsResponse',
- header: '지급조건',
- cell: ({ row }) => (
- <div className="text-sm max-w-32 truncate" title={row.original.paymentTermsResponse || ''}>
- {row.original.paymentTermsResponse || '-'}
- </div>
- ),
- },
- {
- accessorKey: 'taxConditionsResponse',
- header: '세금조건',
- cell: ({ row }) => (
- <div className="text-sm max-w-32 truncate" title={row.original.taxConditionsResponse || ''}>
- {row.original.taxConditionsResponse || '-'}
- </div>
- ),
- },
- {
- accessorKey: 'incotermsResponse',
- header: '운송조건',
- cell: ({ row }) => (
- <div className="text-sm max-w-24 truncate" title={row.original.incotermsResponse || ''}>
- {row.original.incotermsResponse || '-'}
- </div>
- ),
- },
- {
- accessorKey: 'isInitialResponse',
- header: '초도여부',
- cell: ({ row }) => (
- <Badge variant={row.original.isInitialResponse ? 'default' : 'secondary'}>
- {row.original.isInitialResponse ? 'Y' : 'N'}
- </Badge>
- ),
- },
- {
- accessorKey: 'priceAdjustmentResponse',
- header: '연동제',
- cell: ({ row }) => {
- const hasPriceAdjustment = row.original.priceAdjustmentResponse
- return (
- <div className="flex items-center gap-2">
- <Badge variant={hasPriceAdjustment ? 'default' : 'secondary'}>
- {hasPriceAdjustment ? '적용' : '미적용'}
- </Badge>
- {hasPriceAdjustment && onViewPriceAdjustment && (
- <Button
- variant="ghost"
- size="sm"
- onClick={() => onViewPriceAdjustment(row.original)}
- className="h-6 px-2 text-xs"
- >
- 상세
- </Button>
- )}
- </div>
- )
- },
- },
- {
- accessorKey: 'proposedContractDeliveryDate',
- header: '제안납기일',
- cell: ({ row }) => (
- <div className="text-sm">
- {row.original.proposedContractDeliveryDate ?
- new Date(row.original.proposedContractDeliveryDate).toLocaleDateString('ko-KR') : '-'}
- </div>
- ),
- },
- {
- accessorKey: 'proposedShippingPort',
- header: '제안선적지',
- cell: ({ row }) => (
- <div className="text-sm max-w-24 truncate" title={row.original.proposedShippingPort || ''}>
- {row.original.proposedShippingPort || '-'}
- </div>
- ),
- },
- {
- accessorKey: 'proposedDestinationPort',
- header: '제안도착지',
- cell: ({ row }) => (
- <div className="text-sm max-w-24 truncate" title={row.original.proposedDestinationPort || ''}>
- {row.original.proposedDestinationPort || '-'}
- </div>
- ),
- },
- {
- accessorKey: 'sparePartResponse',
- header: '스페어파트',
- cell: ({ row }) => (
- <div className="text-sm max-w-24 truncate" title={row.original.sparePartResponse || ''}>
- {row.original.sparePartResponse || '-'}
- </div>
- ),
- },
- {
id: 'actions',
header: '작업',
cell: ({ row }) => {
@@ -229,21 +159,42 @@ export function getBiddingDetailVendorColumns({
<DropdownMenuContent align="end">
<DropdownMenuLabel>작업</DropdownMenuLabel>
<DropdownMenuItem onClick={() => onEdit(vendor)}>
- <Edit className="mr-2 h-4 w-4" />
- 수정
+ 발주비율 산정
</DropdownMenuItem>
{vendor.status !== 'selected' && (
<DropdownMenuItem onClick={() => onSelectWinner(vendor)}>
- <Trophy className="mr-2 h-4 w-4" />
낙찰 선정
</DropdownMenuItem>
)}
+
+ {/* 입찰 참여여부 관리 */}
+ {vendor.isBiddingParticipated === null && onUpdateParticipation && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => onUpdateParticipation(vendor, true)}>
+ 응찰 설정
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => onUpdateParticipation(vendor, false)}>
+ 미응찰 설정
+ </DropdownMenuItem>
+ </>
+ )}
+
+ {/* 입찰 보내기 (응찰한 업체만) */}
+ {vendor.isBiddingParticipated === true && onSendBidding && (
+ <>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => onSendBidding(vendor)}>
+ 입찰 보내기
+ </DropdownMenuItem>
+ </>
+ )}
+
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={() => onDelete(vendor)}
className="text-destructive"
>
- <Trash2 className="mr-2 h-4 w-4" />
삭제
</DropdownMenuItem>
</DropdownMenuContent>