diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-09 10:34:05 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-09 10:34:05 +0000 |
| commit | 86b1fd1cc801f45642f84d24c0b5c84368454ff0 (patch) | |
| tree | 63176d1feb6d3fbbb71d942343056ba6d793b586 /lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx | |
| parent | c62ec046327fd388ebce04571b55910747e69a3b (diff) | |
(최겸) 구매 입찰 사전견적, 입찰, 낙찰, 유찰, 재입찰 기능 개발
Diffstat (limited to 'lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx')
| -rw-r--r-- | lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx | 86 |
1 files changed, 64 insertions, 22 deletions
diff --git a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx b/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx index 7e84f178..5c6f41ce 100644 --- a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx +++ b/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-columns.tsx @@ -6,7 +6,7 @@ import { Checkbox } from "@/components/ui/checkbox" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { - MoreHorizontal, Edit, Trash2, UserPlus, Paperclip + MoreHorizontal, Edit, Trash2, Paperclip } from "lucide-react" import { DropdownMenu, @@ -27,7 +27,9 @@ export interface BiddingCompany { respondedAt: Date | null preQuoteAmount: string | null preQuoteSubmittedAt: Date | null + preQuoteDeadline: Date | null isPreQuoteSelected: boolean + isPreQuoteParticipated: boolean | null isAttendingMeeting: boolean | null notes: string | null contactPerson: string | null @@ -56,7 +58,6 @@ export interface BiddingCompany { interface GetBiddingCompanyColumnsProps { onEdit: (company: BiddingCompany) => void onDelete: (company: BiddingCompany) => void - onInvite: (company: BiddingCompany) => void onViewPriceAdjustment?: (company: BiddingCompany) => void onViewItemDetails?: (company: BiddingCompany) => void onViewAttachments?: (company: BiddingCompany) => void @@ -65,7 +66,6 @@ interface GetBiddingCompanyColumnsProps { export function getBiddingPreQuoteVendorColumns({ onEdit, onDelete, - onInvite, onViewPriceAdjustment, onViewItemDetails, onViewAttachments @@ -109,11 +109,28 @@ export function getBiddingPreQuoteVendorColumns({ header: '초대 상태', cell: ({ row }) => { const status = row.original.invitationStatus - const variant = status === 'accepted' ? 'default' : - status === 'declined' ? 'destructive' : 'outline' + let variant: any + let label: string - const label = status === 'accepted' ? '수락' : - status === 'declined' ? '거절' : '대기중' + if (status === 'accepted') { + variant = 'default' + label = '수락' + } else if (status === 'declined') { + variant = 'destructive' + label = '거절' + } else if (status === 'pending') { + variant = 'outline' + label = '대기중' + } else if (status === 'sent') { + variant = 'outline' + label = '요청됨' + } else if (status === 'submitted') { + variant = 'outline' + label = '제출됨' + } else { + variant = 'outline' + label = status || '-' + } return <Badge variant={variant}>{label}</Badge> }, @@ -150,6 +167,31 @@ export function getBiddingPreQuoteVendorColumns({ ), }, { + accessorKey: 'preQuoteDeadline', + header: '사전견적 마감일', + cell: ({ row }) => { + const deadline = row.original.preQuoteDeadline + if (!deadline) { + return <div className="text-muted-foreground text-sm">-</div> + } + + const now = new Date() + const deadlineDate = new Date(deadline) + const isExpired = deadlineDate < now + + return ( + <div className={`text-sm ${isExpired ? 'text-red-600' : ''}`}> + <div>{deadlineDate.toLocaleDateString('ko-KR')}</div> + {isExpired && ( + <Badge variant="destructive" className="text-xs mt-1"> + 마감 + </Badge> + )} + </div> + ) + }, + }, + { accessorKey: 'attachments', header: '첨부파일', cell: ({ row }) => { @@ -174,6 +216,21 @@ export function getBiddingPreQuoteVendorColumns({ }, }, { + accessorKey: 'isPreQuoteParticipated', + header: '사전견적 참여의사', + cell: ({ row }) => { + const participated = row.original.isPreQuoteParticipated + if (participated === null) { + return <Badge variant="outline">미결정</Badge> + } + return ( + <Badge variant={participated ? 'default' : 'destructive'}> + {participated ? '참여' : '미참여'} + </Badge> + ) + }, + }, + { accessorKey: 'isPreQuoteSelected', header: '본입찰 선정', cell: ({ row }) => ( @@ -307,15 +364,6 @@ export function getBiddingPreQuoteVendorColumns({ ), }, { - accessorKey: 'notes', - header: '특이사항', - cell: ({ row }) => ( - <div className="text-sm max-w-32 truncate" title={row.original.notes || ''}> - {row.original.notes || '-'} - </div> - ), - }, - { id: 'actions', header: '액션', cell: ({ row }) => { @@ -334,12 +382,6 @@ export function getBiddingPreQuoteVendorColumns({ <Edit className="mr-2 h-4 w-4" /> 수정 </DropdownMenuItem> */} - {company.invitationStatus === 'pending' && ( - <DropdownMenuItem onClick={() => onInvite(company)}> - <UserPlus className="mr-2 h-4 w-4" /> - 초대 발송 - </DropdownMenuItem> - )} <DropdownMenuItem onClick={() => onDelete(company)} className="text-destructive" |
