diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-19 09:40:38 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-19 09:40:38 +0000 |
| commit | fd542b5ad4bf94b82d872f87b96aa2e7514ffbc3 (patch) | |
| tree | 0dbf6e67a56efaf556c65245cf07fcf79bbde0f1 /lib/rfq-last/vendor | |
| parent | 9ecdfb23fe3df6a5df86782385002c562dfc1198 (diff) | |
(최겸) 구매 일반계약 수정, 견적 입찰 계약 세금코드 select 적용
Diffstat (limited to 'lib/rfq-last/vendor')
| -rw-r--r-- | lib/rfq-last/vendor/batch-update-conditions-dialog.tsx | 59 |
1 files changed, 55 insertions, 4 deletions
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> |
