From ba8cd44a0ed2c613a5f2cee06bfc9bd0f61f21c7 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 7 Nov 2025 08:39:04 +0000
Subject: (최겸) 입찰/견적 수정사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../vendor/partners-bidding-list-columns.tsx       | 104 ++++++++++-----------
 1 file changed, 50 insertions(+), 54 deletions(-)

(limited to 'lib/bidding/vendor/partners-bidding-list-columns.tsx')

diff --git a/lib/bidding/vendor/partners-bidding-list-columns.tsx b/lib/bidding/vendor/partners-bidding-list-columns.tsx
index 7fb62122..5870067a 100644
--- a/lib/bidding/vendor/partners-bidding-list-columns.tsx
+++ b/lib/bidding/vendor/partners-bidding-list-columns.tsx
@@ -17,7 +17,6 @@ import {
   MoreHorizontal,
   Calendar,
   User,
-  Calculator,
   Paperclip,
   AlertTriangle
 } from 'lucide-react'
@@ -25,6 +24,7 @@ import { formatDate } from '@/lib/utils'
 import { biddingStatusLabels, contractTypeLabels } from '@/db/schema'
 import { PartnersBiddingListItem } from '../detail/service'
 import { Checkbox } from '@/components/ui/checkbox'
+import { toast } from 'sonner'
 
 const columnHelper = createColumnHelper<PartnersBiddingListItem>()
 
@@ -62,11 +62,15 @@ export function getPartnersBiddingListColumns({ setRowAction }: PartnersBiddingL
       header: '입찰 No.',
       cell: ({ row }) => {
         const biddingNumber = row.original.biddingNumber
+        const originalBiddingNumber = row.original.originalBiddingNumber
         const revision = row.original.revision
         return (
           <div className="font-mono text-sm">
             <div>{biddingNumber}</div>
-              <div className="text-muted-foreground">Rev. {revision ?? 0}</div>
+            <div className="text-muted-foreground text-xs">Rev. {revision ?? 0}</div>
+            {originalBiddingNumber && (
+              <div className="text-xs text-muted-foreground">원: {originalBiddingNumber}</div>
+            )}
           </div>
         )
       },
@@ -148,27 +152,36 @@ export function getPartnersBiddingListColumns({ setRowAction }: PartnersBiddingL
       id: 'actions',
       header: '액션',
       cell: ({ row }) => {
-        const handleView = () => {
-          if (setRowAction) {
-            setRowAction({
-              type: 'view',
-              row: { original: row.original }
+        // 사양설명회 참석여부 체크 함수
+        const checkSpecificationMeeting = () => {
+          const hasSpecMeeting = row.original.hasSpecificationMeeting
+          const isAttending = row.original.isAttendingMeeting
+          
+          // 사양설명회가 있고, 참석여부가 아직 설정되지 않은 경우
+          if (hasSpecMeeting && isAttending === null) {
+            toast.warning('사양설명회 참석여부 필요', {
+              description: '사전견적 또는 입찰을 진행하기 전에 사양설명회 참석여부를 먼저 설정해주세요.',
+              duration: 5000,
             })
+            return false
           }
+          return true
         }
 
-        const handlePreQuote = () => {
+        const handleView = () => {
+          // 사양설명회 체크
+          if (!checkSpecificationMeeting()) {
+            return
+          }
+
           if (setRowAction) {
             setRowAction({
-              type: 'pre-quote',
+              type: 'view',
               row: { original: row.original }
             })
           }
         }
 
-        const biddingStatus = row.original.status
-        const isClosed = biddingStatus === 'bidding_closed' || biddingStatus === 'vendor_selected' || biddingStatus === 'bidding_disposal'
-
         return (
           <DropdownMenu>
             <DropdownMenuTrigger asChild>
@@ -185,12 +198,6 @@ export function getPartnersBiddingListColumns({ setRowAction }: PartnersBiddingL
                 <FileText className="mr-2 h-4 w-4" />
                 입찰 상세보기
               </DropdownMenuItem>
-              {!isClosed && (
-                <DropdownMenuItem onClick={handlePreQuote}>
-                  <Calculator className="mr-2 h-4 w-4" />
-                  사전견적하기
-                </DropdownMenuItem>
-              )}
             </DropdownMenuContent>
           </DropdownMenu>
         )
@@ -327,61 +334,50 @@ export function getPartnersBiddingListColumns({ setRowAction }: PartnersBiddingL
         const endDate = row.original.contractEndDate
 
         if (!startDate || !endDate) {
-          return <div className="max-w-24 truncate">-</div>
+          return <div className="text-muted-foreground text-center">-</div>
         }
 
         return (
-          <div className="max-w-24 truncate" title={`${formatDate(startDate, 'KR')} ~ ${formatDate(endDate, 'KR')}`}>
-            {formatDate(startDate, 'KR')} ~ {formatDate(endDate, 'KR')}
+          <div className="text-sm">
+            <div>{formatDate(startDate, 'KR')}</div>
+            <div className="text-muted-foreground">~</div>
+            <div>{formatDate(endDate, 'KR')}</div>
           </div>
         )
       },
     }),
 
-    // 참여회신 마감일
-    columnHelper.accessor('responseDeadline', {
-      header: '참여회신 마감일',
-      cell: ({ row }) => {
-        const deadline = row.original.responseDeadline
-        if (!deadline) {
-          return <div className="text-muted-foreground">-</div>
-        }
-        return <div className="text-sm">{formatDate(deadline, 'KR')}</div>
-      },
-    }),
-
-    // 입찰제출일
-    columnHelper.accessor('submissionDate', {
-      header: '입찰제출일',
+    // 입찰담당자
+    columnHelper.display({
+      id: 'bidPicName',
+      header: '입찰담당자',
       cell: ({ row }) => {
-        const date = row.original.submissionDate
-        if (!date) {
-          return <div className="text-muted-foreground">-</div>
+        const name = row.original.bidPicName
+        if (!name) {
+          return <div className="text-muted-foreground text-center">-</div>
         }
-        return <div className="text-sm">{formatDate(date, 'KR')}</div>
+        return (
+          <div className="flex items-center gap-1">
+            <User className="h-4 w-4" />
+            <div className="text-sm">{name}</div>
+          </div>
+        )
       },
     }),
 
-    // 입찰담당자
-    columnHelper.accessor('managerName', {
-      header: '입찰담당자',
+    // 조달담당자
+    columnHelper.display({
+      id: 'supplyPicName',
+      header: '조달담당자',
       cell: ({ row }) => {
-        const name = row.original.managerName
-        const email = row.original.managerEmail
+        const name = row.original.supplyPicName
         if (!name) {
-          return <div className="text-muted-foreground">-</div>
+          return <div className="text-muted-foreground text-center">-</div>
         }
         return (
           <div className="flex items-center gap-1">
             <User className="h-4 w-4" />
-            <div>
-              <div className="text-sm">{name}</div>
-              {email && (
-                <div className="text-xs text-muted-foreground truncate max-w-32" title={email}>
-                  {email}
-                </div>
-              )}
-            </div>
+            <div className="text-sm">{name}</div>
           </div>
         )
       },
-- 
cgit v1.2.3

