From ba8cd44a0ed2c613a5f2cee06bfc9bd0f61f21c7 Mon Sep 17 00:00:00 2001 From: dujinkim 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 --- .../table/bidding-pre-quote-vendor-edit-dialog.tsx | 200 --------------------- 1 file changed, 200 deletions(-) delete mode 100644 lib/bidding/pre-quote/table/bidding-pre-quote-vendor-edit-dialog.tsx (limited to 'lib/bidding/pre-quote/table/bidding-pre-quote-vendor-edit-dialog.tsx') diff --git a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-edit-dialog.tsx b/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-edit-dialog.tsx deleted file mode 100644 index 03bf2ecb..00000000 --- a/lib/bidding/pre-quote/table/bidding-pre-quote-vendor-edit-dialog.tsx +++ /dev/null @@ -1,200 +0,0 @@ -'use client' - -import * as React from 'react' -import { Button } from '@/components/ui/button' -import { Input } from '@/components/ui/input' -import { Label } from '@/components/ui/label' -import { Textarea } from '@/components/ui/textarea' -import { Checkbox } from '@/components/ui/checkbox' -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from '@/components/ui/dialog' -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select' -import { updateBiddingCompany } from '../service' -import { BiddingCompany } from './bidding-pre-quote-vendor-columns' -import { useToast } from '@/hooks/use-toast' -import { useTransition } from 'react' - -interface BiddingPreQuoteVendorEditDialogProps { - company: BiddingCompany | null - open: boolean - onOpenChange: (open: boolean) => void - onSuccess: () => void -} - -export function BiddingPreQuoteVendorEditDialog({ - company, - open, - onOpenChange, - onSuccess -}: BiddingPreQuoteVendorEditDialogProps) { - const { toast } = useToast() - const [isPending, startTransition] = useTransition() - - // 폼 상태 - const [formData, setFormData] = React.useState({ - contactPerson: '', - contactEmail: '', - contactPhone: '', - preQuoteAmount: 0, - notes: '', - invitationStatus: 'pending' as 'pending' | 'accepted' | 'declined', - isPreQuoteSelected: false, - isAttendingMeeting: false, - }) - - // company가 변경되면 폼 데이터 업데이트 - React.useEffect(() => { - if (company) { - setFormData({ - contactPerson: company.contactPerson || '', - contactEmail: company.contactEmail || '', - contactPhone: company.contactPhone || '', - preQuoteAmount: company.preQuoteAmount ? Number(company.preQuoteAmount) : 0, - notes: company.notes || '', - invitationStatus: company.invitationStatus, - isPreQuoteSelected: company.isPreQuoteSelected, - isAttendingMeeting: company.isAttendingMeeting || false, - }) - } - }, [company]) - - const handleEdit = () => { - if (!company) return - - startTransition(async () => { - const response = await updateBiddingCompany(company.id, formData) - - if (response.success) { - toast({ - title: '성공', - description: response.message, - }) - onOpenChange(false) - onSuccess() - } else { - toast({ - title: '오류', - description: response.error, - variant: 'destructive', - }) - } - }) - } - - return ( - - - - 사전견적 업체 수정 - - {company?.companyName} 업체의 사전견적 정보를 수정해주세요. - - -
-
-
- - setFormData({ ...formData, contactPerson: e.target.value })} - /> -
-
- - setFormData({ ...formData, contactEmail: e.target.value })} - /> -
-
- - setFormData({ ...formData, contactPhone: e.target.value })} - /> -
-
-
-
- - setFormData({ ...formData, preQuoteAmount: Number(e.target.value) })} - /> -
-
- - -
-
-
-
- - setFormData({ ...formData, isPreQuoteSelected: !!checked }) - } - /> - -
-
- - setFormData({ ...formData, isAttendingMeeting: !!checked }) - } - /> - -
-
-
- -