summaryrefslogtreecommitdiff
path: root/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-09 10:34:05 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-09 10:34:05 +0000
commit86b1fd1cc801f45642f84d24c0b5c84368454ff0 (patch)
tree63176d1feb6d3fbbb71d942343056ba6d793b586 /lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
parentc62ec046327fd388ebce04571b55910747e69a3b (diff)
(최겸) 구매 입찰 사전견적, 입찰, 낙찰, 유찰, 재입찰 기능 개발
Diffstat (limited to 'lib/bidding/detail/table/bidding-detail-vendor-columns.tsx')
-rw-r--r--lib/bidding/detail/table/bidding-detail-vendor-columns.tsx43
1 files changed, 35 insertions, 8 deletions
diff --git a/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx b/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
index bb1d2c62..cbdf79c2 100644
--- a/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
+++ b/lib/bidding/detail/table/bidding-detail-vendor-columns.tsx
@@ -23,6 +23,7 @@ interface GetVendorColumnsProps {
onDelete: (vendor: QuotationVendor) => void
onSelectWinner: (vendor: QuotationVendor) => void
onViewPriceAdjustment?: (vendor: QuotationVendor) => void
+ onViewItemDetails?: (vendor: QuotationVendor) => void
onSendBidding?: (vendor: QuotationVendor) => void
onUpdateParticipation?: (vendor: QuotationVendor, participated: boolean) => void
}
@@ -32,6 +33,7 @@ export function getBiddingDetailVendorColumns({
onDelete,
onSelectWinner,
onViewPriceAdjustment,
+ onViewItemDetails,
onSendBidding,
onUpdateParticipation
}: GetVendorColumnsProps): ColumnDef<QuotationVendor>[] {
@@ -72,11 +74,24 @@ export function getBiddingDetailVendorColumns({
{
accessorKey: 'quotationAmount',
header: '견적금액',
- cell: ({ row }) => (
- <div className="text-right font-mono">
- {row.original.quotationAmount ? Number(row.original.quotationAmount).toLocaleString() : '-'} {row.original.currency}
- </div>
- ),
+ cell: ({ row }) => {
+ const hasAmount = row.original.quotationAmount && Number(row.original.quotationAmount) > 0
+ return (
+ <div className="text-right font-mono">
+ {hasAmount ? (
+ <button
+ onClick={() => onViewItemDetails?.(row.original)}
+ className="text-primary hover:text-primary/80 hover:underline cursor-pointer"
+ title="품목별 견적 상세 보기"
+ >
+ {Number(row.original.quotationAmount).toLocaleString()} {row.original.currency}
+ </button>
+ ) : (
+ <span className="text-muted-foreground">- {row.original.currency}</span>
+ )}
+ </div>
+ )
+ },
},
{
accessorKey: 'biddingResult',
@@ -84,7 +99,7 @@ export function getBiddingDetailVendorColumns({
cell: ({ row }) => {
const isWinner = row.original.isWinner
if (isWinner === null || isWinner === undefined) {
- return <div>-</div>
+ return <div>미정</div>
}
return (
<Badge variant={isWinner ? 'default' : 'secondary'} className={isWinner ? 'bg-green-600' : ''}>
@@ -158,12 +173,24 @@ export function getBiddingDetailVendorColumns({
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel>작업</DropdownMenuLabel>
- <DropdownMenuItem onClick={() => onEdit(vendor)}>
+ <DropdownMenuItem
+ onClick={() => onEdit(vendor)}
+ disabled={vendor.isBiddingParticipated !== true}
+ >
발주비율 산정
+ {vendor.isBiddingParticipated !== true && (
+ <span className="text-xs text-muted-foreground ml-2">(입찰참여 필요)</span>
+ )}
</DropdownMenuItem>
{vendor.status !== 'selected' && (
- <DropdownMenuItem onClick={() => onSelectWinner(vendor)}>
+ <DropdownMenuItem
+ onClick={() => onSelectWinner(vendor)}
+ disabled={vendor.isBiddingParticipated !== true}
+ >
낙찰 선정
+ {vendor.isBiddingParticipated !== true && (
+ <span className="text-xs text-muted-foreground ml-2">(입찰참여 필요)</span>
+ )}
</DropdownMenuItem>
)}