summaryrefslogtreecommitdiff
path: root/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-08 10:29:19 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-08 10:29:19 +0000
commitf93493f68c9f368e10f1c3379f1c1384068e3b14 (patch)
treea9dada58741750fa7ca6e04b210443ad99a6bccc /lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
parente832a508e1b3c531fb3e1b9761e18e1b55e3d76a (diff)
(대표님, 최겸) rfqLast, bidding, prequote
Diffstat (limited to 'lib/rfq-last/vendor/batch-update-conditions-dialog.tsx')
-rw-r--r--lib/rfq-last/vendor/batch-update-conditions-dialog.tsx81
1 files changed, 55 insertions, 26 deletions
diff --git a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
index 1b8fa528..7de8cfa4 100644
--- a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
+++ b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
@@ -50,11 +50,11 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
import { ScrollArea } from "@/components/ui/scroll-area";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Checkbox } from "@/components/ui/checkbox";
-import {
+import {
getIncotermsForSelection,
getPaymentTermsForSelection,
getPlaceOfShippingForSelection,
- getPlaceOfDestinationForSelection
+ getPlaceOfDestinationForSelection
} from "@/lib/procurement-select/service";
interface BatchUpdateConditionsDialogProps {
@@ -108,19 +108,19 @@ export function BatchUpdateConditionsDialog({
onSuccess,
}: BatchUpdateConditionsDialogProps) {
const [isLoading, setIsLoading] = React.useState(false);
-
+
// Select 옵션들 상태
const [incoterms, setIncoterms] = React.useState<SelectOption[]>([]);
const [paymentTerms, setPaymentTerms] = React.useState<SelectOption[]>([]);
const [shippingPlaces, setShippingPlaces] = React.useState<SelectOption[]>([]);
const [destinationPlaces, setDestinationPlaces] = React.useState<SelectOption[]>([]);
-
+
// 로딩 상태
const [incotermsLoading, setIncotermsLoading] = React.useState(false);
const [paymentTermsLoading, setPaymentTermsLoading] = React.useState(false);
const [shippingLoading, setShippingLoading] = React.useState(false);
const [destinationLoading, setDestinationLoading] = React.useState(false);
-
+
// Popover 열림 상태
const [incotermsOpen, setIncotermsOpen] = React.useState(false);
const [paymentTermsOpen, setPaymentTermsOpen] = React.useState(false);
@@ -254,7 +254,7 @@ export function BatchUpdateConditionsDialog({
// 선택된 필드만 포함하여 conditions 객체 생성
const conditions: any = {};
-
+
if (fieldsToUpdate.currency && data.currency) {
conditions.currency = data.currency;
}
@@ -372,7 +372,7 @@ export function BatchUpdateConditionsDialog({
<Alert>
<Info className="h-4 w-4" />
<AlertDescription>
- 체크박스를 선택한 항목만 업데이트됩니다.
+ 체크박스를 선택한 항목만 업데이트됩니다.
선택하지 않은 항목은 기존 값이 유지됩니다.
</AlertDescription>
</Alert>
@@ -387,7 +387,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.currency}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, currency: !!checked })
}
/>
@@ -419,7 +419,13 @@ export function BatchUpdateConditionsDialog({
<PopoverContent className="w-full p-0" align="start">
<Command>
<CommandInput placeholder="통화 검색..." />
- <CommandList>
+ <CommandList
+ onWheel={(e) => {
+ e.stopPropagation(); // 이벤트 전파 차단
+ const target = e.currentTarget;
+ target.scrollTop += e.deltaY; // 직접 스크롤 처리
+ }}
+ >
<CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
<CommandGroup>
{currencies.map((currency) => (
@@ -454,7 +460,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.paymentTermsCode}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, paymentTermsCode: !!checked })
}
/>
@@ -496,7 +502,13 @@ export function BatchUpdateConditionsDialog({
<PopoverContent className="w-full p-0" align="start">
<Command>
<CommandInput placeholder="코드 또는 설명으로 검색..." />
- <CommandList>
+ <CommandList
+ onWheel={(e) => {
+ e.stopPropagation(); // 이벤트 전파 차단
+ const target = e.currentTarget;
+ target.scrollTop += e.deltaY; // 직접 스크롤 처리
+ }}
+ >
<CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
<CommandGroup>
{paymentTerms.map((term) => (
@@ -538,7 +550,7 @@ export function BatchUpdateConditionsDialog({
<Checkbox
className="mt-3"
checked={fieldsToUpdate.incoterms}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, incoterms: !!checked })
}
/>
@@ -581,7 +593,12 @@ export function BatchUpdateConditionsDialog({
<PopoverContent className="w-full p-0" align="start">
<Command>
<CommandInput placeholder="코드 또는 설명으로 검색..." />
- <CommandList>
+ <CommandList
+ onWheel={(e) => {
+ e.stopPropagation(); // 이벤트 전파 차단
+ const target = e.currentTarget;
+ target.scrollTop += e.deltaY; // 직접 스크롤 처리
+ }}>
<CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
<CommandGroup>
{incoterms.map((incoterm) => (
@@ -640,7 +657,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.deliveryDate}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, deliveryDate: !!checked })
}
/>
@@ -701,7 +718,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.contractDuration}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, contractDuration: !!checked })
}
/>
@@ -736,7 +753,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.taxCode}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, taxCode: !!checked })
}
/>
@@ -770,7 +787,7 @@ export function BatchUpdateConditionsDialog({
<Checkbox
className="mt-3"
checked={fieldsToUpdate.shipping}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, shipping: !!checked })
}
/>
@@ -813,7 +830,13 @@ export function BatchUpdateConditionsDialog({
<PopoverContent className="w-full p-0" align="start">
<Command>
<CommandInput placeholder="선적지 검색..." />
- <CommandList>
+ <CommandList
+ onWheel={(e) => {
+ e.stopPropagation(); // 이벤트 전파 차단
+ const target = e.currentTarget;
+ target.scrollTop += e.deltaY; // 직접 스크롤 처리
+ }}
+ >
<CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
<CommandGroup>
{shippingPlaces.map((place) => (
@@ -848,7 +871,7 @@ export function BatchUpdateConditionsDialog({
</FormItem>
)}
/>
-
+
<FormField
control={form.control}
name="placeOfDestination"
@@ -887,7 +910,13 @@ export function BatchUpdateConditionsDialog({
<PopoverContent className="w-full p-0" align="start">
<Command>
<CommandInput placeholder="도착지 검색..." />
- <CommandList>
+ <CommandList
+ onWheel={(e) => {
+ e.stopPropagation(); // 이벤트 전파 차단
+ const target = e.currentTarget;
+ target.scrollTop += e.deltaY; // 직접 스크롤 처리
+ }}
+ >
<CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
<CommandGroup>
{destinationPlaces.map((place) => (
@@ -937,7 +966,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.materialPrice}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, materialPrice: !!checked })
}
/>
@@ -973,7 +1002,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.sparepart}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, sparepart: !!checked })
}
/>
@@ -1028,7 +1057,7 @@ export function BatchUpdateConditionsDialog({
<div className="flex items-center gap-4">
<Checkbox
checked={fieldsToUpdate.first}
- onCheckedChange={(checked) =>
+ onCheckedChange={(checked) =>
setFieldsToUpdate({ ...fieldsToUpdate, first: !!checked })
}
/>
@@ -1086,7 +1115,7 @@ export function BatchUpdateConditionsDialog({
<DialogFooter className="p-6 pt-4 border-t">
<div className="flex items-center justify-between w-full">
<div className="text-sm text-muted-foreground">
- {getUpdateCount() > 0
+ {getUpdateCount() > 0
? `${getUpdateCount()}개 항목 선택됨`
: '변경할 항목을 선택하세요'
}
@@ -1100,12 +1129,12 @@ export function BatchUpdateConditionsDialog({
>
취소
</Button>
- <Button
+ <Button
type="submit"
disabled={isLoading || getUpdateCount() === 0}
>
{isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
- {getUpdateCount() > 0
+ {getUpdateCount() > 0
? `${getUpdateCount()}개 항목 업데이트`
: '조건 업데이트'
}