From 91ae2e8b382e6945f713c66a68c5c3483d6ec5cf Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 17 Nov 2025 10:35:43 +0900 Subject: (김준회) 견적: 협력업체 조건설정 Dialog: Currency 공통 선택기 적용, 불필요 텍스트 제거 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendor/batch-update-conditions-dialog.tsx | 96 +++++++++------------- 1 file changed, 40 insertions(+), 56 deletions(-) (limited to 'lib') diff --git a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx index 6112aed4..acdf751b 100644 --- a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx +++ b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx @@ -37,7 +37,6 @@ import { PopoverTrigger } from "@/components/ui/popover"; import { Textarea } from "@/components/ui/textarea"; -import { Switch } from "@/components/ui/switch"; import { Calendar } from "@/components/ui/calendar"; import { CalendarIcon, Loader2, Info, Package, Check, ChevronsUpDown } from "lucide-react"; import { format } from "date-fns"; @@ -47,7 +46,7 @@ import { toast } from "sonner"; import { updateVendorConditionsBatch, getVendorConditions } from "../service"; import { Badge } from "@/components/ui/badge"; import { TAX_CONDITIONS } from "@/lib/tax-conditions/types"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { Checkbox } from "@/components/ui/checkbox"; @@ -57,6 +56,8 @@ import { getPlaceOfShippingForSelection, getPlaceOfDestinationForSelection } from "@/lib/procurement-select/service"; +import { CurrencySelectorSingleDialog } from "@/components/common/selectors/currency/currency-selector-single-dialog"; +import type { Currency } from "@/components/common/selectors/currency/currency-service"; interface BatchUpdateConditionsDialogProps { open: boolean; @@ -98,8 +99,6 @@ const formSchema = z.object({ type FormValues = z.infer; -const currencies = ["USD", "EUR", "KRW", "JPY", "CNY"]; - export function BatchUpdateConditionsDialog({ open, onOpenChange, @@ -128,7 +127,10 @@ export function BatchUpdateConditionsDialog({ const [shippingOpen, setShippingOpen] = React.useState(false); const [destinationOpen, setDestinationOpen] = React.useState(false); const [calendarOpen, setCalendarOpen] = React.useState(false); - const [currencyOpen, setCurrencyOpen] = React.useState(false); + const [currencyDialogOpen, setCurrencyDialogOpen] = React.useState(false); + + // 선택된 통화 객체 + const [selectedCurrencyObj, setSelectedCurrencyObj] = React.useState(); // 체크박스로 각 필드 업데이트 여부 관리 const [fieldsToUpdate, setFieldsToUpdate] = React.useState({ @@ -280,6 +282,7 @@ export function BatchUpdateConditionsDialog({ sparepartDescription: "", }); } + setSelectedCurrencyObj(undefined); setFieldsToUpdate({ currency: false, paymentTermsCode: false, @@ -304,7 +307,7 @@ export function BatchUpdateConditionsDialog({ } // 선택된 필드만 포함하여 conditions 객체 생성 - const conditions: any = {}; + const conditions: Record = {}; if (fieldsToUpdate.currency && data.currency) { conditions.currency = data.currency; @@ -476,56 +479,24 @@ export function BatchUpdateConditionsDialog({
- - - - - - - - { - e.stopPropagation(); // 이벤트 전파 차단 - const target = e.currentTarget; - target.scrollTop += e.deltaY; // 직접 스크롤 처리 - }} - > - 검색 결과가 없습니다. - - {currencies.map((currency) => ( - { - field.onChange(currency); - setCurrencyOpen(false); - }} - > - {currency} - - - ))} - - - - - +
@@ -1234,6 +1205,19 @@ export function BatchUpdateConditionsDialog({ + + {/* 통화 선택 다이얼로그 */} + { + setSelectedCurrencyObj(currency); + form.setValue("currency", currency.CURRENCY_CODE); + }} + title="통화 선택" + description="일괄 설정할 통화를 선택하세요" + /> ); } \ No newline at end of file -- cgit v1.2.3