From fd542b5ad4bf94b82d872f87b96aa2e7514ffbc3 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 19 Sep 2025 09:40:38 +0000
Subject: (최겸) 구매 일반계약 수정, 견적 입찰 계약 세금코드 select 적용
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../vendor/batch-update-conditions-dialog.tsx      | 59 ++++++++++++++++++++--
 1 file changed, 55 insertions(+), 4 deletions(-)

(limited to 'lib/rfq-last/vendor/batch-update-conditions-dialog.tsx')

diff --git a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
index 7de8cfa4..af38ff45 100644
--- a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
+++ b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx
@@ -46,6 +46,7 @@ import { cn } from "@/lib/utils";
 import { toast } from "sonner";
 import { updateVendorConditionsBatch } 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 { ScrollArea } from "@/components/ui/scroll-area";
 import { Alert, AlertDescription } from "@/components/ui/alert";
@@ -770,10 +771,60 @@ export function BatchUpdateConditionsDialog({
                             </FormLabel>
                             <div className="col-span-2">
                               <FormControl>
-                                <Input
-                                  {...field}
-                                  disabled={!fieldsToUpdate.taxCode}
-                                />
+                                <Popover>
+                                  <PopoverTrigger asChild>
+                                    <Button
+                                      variant="outline"
+                                      role="combobox"
+                                      className="w-full justify-between"
+                                      disabled={!fieldsToUpdate.taxCode}
+                                    >
+                                      {field.value ? (
+                                        <span className="truncate">
+                                          {TAX_CONDITIONS.find(t => t.code === field.value)?.name || field.value}
+                                        </span>
+                                      ) : (
+                                        <span className="text-muted-foreground">세금 코드 선택</span>
+                                      )}
+                                      <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
+                                    </Button>
+                                  </PopoverTrigger>
+                                  <PopoverContent className="w-full p-0" align="start">
+                                    <Command>
+                                      <CommandInput placeholder="세금 코드 검색..." />
+                                      <CommandList
+                                        onWheel={(e) => {
+                                          e.stopPropagation();
+                                          const target = e.currentTarget;
+                                          target.scrollTop += e.deltaY;
+                                        }}
+                                      >
+                                        <CommandEmpty>검색 결과가 없습니다.</CommandEmpty>
+                                        <CommandGroup>
+                                          {TAX_CONDITIONS.map((condition) => (
+                                            <CommandItem
+                                              key={condition.code}
+                                              value={`${condition.code} ${condition.name}`}
+                                              onSelect={() => field.onChange(condition.code)}
+                                            >
+                                              <div className="flex items-center gap-2 w-full">
+                                                <span className="font-medium">{condition.code}</span>
+                                                <span className="text-muted-foreground">-</span>
+                                                <span className="truncate">{condition.name}</span>
+                                                <Check
+                                                  className={cn(
+                                                    "ml-auto h-4 w-4",
+                                                    condition.code === field.value ? "opacity-100" : "opacity-0"
+                                                  )}
+                                                />
+                                              </div>
+                                            </CommandItem>
+                                          ))}
+                                        </CommandGroup>
+                                      </CommandList>
+                                    </Command>
+                                  </PopoverContent>
+                                </Popover>
                               </FormControl>
                               <FormMessage />
                             </div>
-- 
cgit v1.2.3

