From d47334639bd717aa860563ec1020a29827524fd4 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 5 Dec 2025 06:29:23 +0000
Subject: (최겸)구매 결재일 기준 공고 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../detail/table/bidding-detail-vendor-table.tsx   | 41 ++++++----------------
 1 file changed, 11 insertions(+), 30 deletions(-)

(limited to 'lib/bidding/detail/table/bidding-detail-vendor-table.tsx')

diff --git a/lib/bidding/detail/table/bidding-detail-vendor-table.tsx b/lib/bidding/detail/table/bidding-detail-vendor-table.tsx
index a6f64964..407cc51c 100644
--- a/lib/bidding/detail/table/bidding-detail-vendor-table.tsx
+++ b/lib/bidding/detail/table/bidding-detail-vendor-table.tsx
@@ -10,9 +10,9 @@ import { BiddingDetailVendorToolbarActions } from './bidding-detail-vendor-toolb
 import { BiddingDetailVendorEditDialog } from './bidding-detail-vendor-edit-dialog'
 import { BiddingAwardDialog } from './bidding-award-dialog'
 import { getBiddingDetailVendorColumns } from './bidding-detail-vendor-columns'
-import { QuotationVendor, getPriceAdjustmentFormByBiddingCompanyId } from '@/lib/bidding/detail/service'
+import { QuotationVendor } from '@/lib/bidding/detail/service'
 import { Bidding } from '@/db/schema'
-import { PriceAdjustmentDialog } from '@/components/bidding/price-adjustment-dialog'
+import { VendorPriceAdjustmentViewDialog } from './vendor-price-adjustment-view-dialog'
 import { QuotationHistoryDialog } from './quotation-history-dialog'
 import { ApprovalPreviewDialog } from '@/lib/approval/approval-preview-dialog'
 import { ApplicationReasonDialog } from '@/lib/rfq-last/vendor/application-reason-dialog'
@@ -98,8 +98,7 @@ export function BiddingDetailVendorTableContent({
   const [selectedVendor, setSelectedVendor] = React.useState<QuotationVendor | null>(null)
   const [isAwardDialogOpen, setIsAwardDialogOpen] = React.useState(false)
   const [isAwardRatioDialogOpen, setIsAwardRatioDialogOpen] = React.useState(false)
-  const [priceAdjustmentData, setPriceAdjustmentData] = React.useState<any>(null)
-  const [isPriceAdjustmentDialogOpen, setIsPriceAdjustmentDialogOpen] = React.useState(false)
+  const [isVendorPriceAdjustmentDialogOpen, setIsVendorPriceAdjustmentDialogOpen] = React.useState(false)
   const [quotationHistoryData, setQuotationHistoryData] = React.useState<any>(null)
   const [isQuotationHistoryDialogOpen, setIsQuotationHistoryDialogOpen] = React.useState(false)
   const [approvalPreviewData, setApprovalPreviewData] = React.useState<{
@@ -116,28 +115,9 @@ export function BiddingDetailVendorTableContent({
   } | null>(null)
   const [isApprovalPreviewDialogOpen, setIsApprovalPreviewDialogOpen] = React.useState(false)
 
-  const handleViewPriceAdjustment = async (vendor: QuotationVendor) => {
-    try {
-      const priceAdjustmentForm = await getPriceAdjustmentFormByBiddingCompanyId(vendor.id)
-      if (priceAdjustmentForm) {
-        setPriceAdjustmentData(priceAdjustmentForm)
-        setSelectedVendor(vendor)
-        setIsPriceAdjustmentDialogOpen(true)
-      } else {
-        toast({
-          title: '연동제 정보 없음',
-          description: '해당 업체의 연동제 정보가 없습니다.',
-          variant: 'default',
-        })
-      }
-    } catch (error) {
-      console.error('Failed to load price adjustment form:', error)
-      toast({
-        title: '오류',
-        description: '연동제 정보를 불러오는데 실패했습니다.',
-        variant: 'destructive',
-      })
-    }
+  const handleViewPriceAdjustment = (vendor: QuotationVendor) => {
+    setSelectedVendor(vendor)
+    setIsVendorPriceAdjustmentDialogOpen(true)
   }
 
   const handleViewQuotationHistory = async (vendor: QuotationVendor) => {
@@ -299,11 +279,12 @@ export function BiddingDetailVendorTableContent({
         }}
       />
 
-      <PriceAdjustmentDialog
-        open={isPriceAdjustmentDialogOpen}
-        onOpenChange={setIsPriceAdjustmentDialogOpen}
-        data={priceAdjustmentData}
+      <VendorPriceAdjustmentViewDialog
+        open={isVendorPriceAdjustmentDialogOpen}
+        onOpenChange={setIsVendorPriceAdjustmentDialogOpen}
         vendorName={selectedVendor?.vendorName || ''}
+        priceAdjustmentResponse={selectedVendor?.priceAdjustmentResponse ?? null}
+        biddingCompanyId={selectedVendor?.id || 0}
       />
 
       <QuotationHistoryDialog
-- 
cgit v1.2.3

