From d47334639bd717aa860563ec1020a29827524fd4 Mon Sep 17 00:00:00 2001 From: dujinkim 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 --- .../vendor/components/pr-items-pricing-table.tsx | 125 +++++++++++++++++++-- 1 file changed, 118 insertions(+), 7 deletions(-) (limited to 'lib/bidding/vendor/components/pr-items-pricing-table.tsx') diff --git a/lib/bidding/vendor/components/pr-items-pricing-table.tsx b/lib/bidding/vendor/components/pr-items-pricing-table.tsx index 5afb2b67..6910e360 100644 --- a/lib/bidding/vendor/components/pr-items-pricing-table.tsx +++ b/lib/bidding/vendor/components/pr-items-pricing-table.tsx @@ -4,7 +4,17 @@ import * as React from 'react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' - +import { Button } from '@/components/ui/button' +import { Calendar } from '@/components/ui/calendar' +import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog' import { Badge } from '@/components/ui/badge' import { Table, @@ -16,10 +26,12 @@ import { } from '@/components/ui/table' import { Package, - Download, - Calculator + Calculator, + CalendarIcon } from 'lucide-react' +import { format } from 'date-fns' +import { cn } from '@/lib/utils' import { formatDate } from '@/lib/utils' import { downloadFile, formatFileSize, getFileInfo } from '@/lib/file-download' import { getSpecDocumentsForPrItem } from '../../pre-quote/service' @@ -186,6 +198,8 @@ export function PrItemsPricingTable({ }: PrItemsPricingTableProps) { const [quotations, setQuotations] = React.useState([]) const [specDocuments, setSpecDocuments] = React.useState>({}) + const [showBulkDateDialog, setShowBulkDateDialog] = React.useState(false) + const [bulkDeliveryDate, setBulkDeliveryDate] = React.useState(undefined) // 초기 견적 데이터 설정 및 SPEC 문서 로드 React.useEffect(() => { @@ -279,6 +293,21 @@ export function PrItemsPricingTable({ onTotalAmountChange(totalAmount) } + // 일괄 납기일 적용 + const applyBulkDeliveryDate = () => { + if (bulkDeliveryDate && quotations.length > 0) { + const formattedDate = format(bulkDeliveryDate, 'yyyy-MM-dd') + const updatedQuotations = quotations.map(q => ({ + ...q, + proposedDeliveryDate: formattedDate + })) + + setQuotations(updatedQuotations) + onQuotationsChange(updatedQuotations) + setShowBulkDateDialog(false) + setBulkDeliveryDate(undefined) + } + } // 통화 포맷팅 const formatCurrency = (amount: number) => { @@ -292,12 +321,26 @@ export function PrItemsPricingTable({ const totalAmount = quotations.reduce((sum, q) => sum + q.bidAmount, 0) return ( + <> - - - 품목별 입찰 작성 - +
+ + + 품목별 입찰 작성 + + {!readOnly && ( + + )} +
@@ -467,5 +510,73 @@ export function PrItemsPricingTable({
+ + {/* 일괄 납품예정일 설정 다이얼로그 */} + + + + 전체 납품예정일 설정 + + 모든 PR 아이템에 동일한 납품예정일을 적용합니다. + + + +
+
+ + + + + + + + + +
+ +
+

+ 선택된 날짜가 {prItems.length}개의 모든 PR 아이템에 적용됩니다. + 기존에 설정된 납품예정일은 모두 교체됩니다. +

+
+
+ + + + + +
+
+ ) } -- cgit v1.2.3