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-response | |
| parent | 9ecdfb23fe3df6a5df86782385002c562dfc1198 (diff) | |
(최겸) 구매 일반계약 수정, 견적 입찰 계약 세금코드 select 적용
Diffstat (limited to 'lib/rfq-last/vendor-response')
| -rw-r--r-- | lib/rfq-last/vendor-response/editor/commercial-terms-form.tsx | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/lib/rfq-last/vendor-response/editor/commercial-terms-form.tsx b/lib/rfq-last/vendor-response/editor/commercial-terms-form.tsx index 143d08f3..f0c69d8b 100644 --- a/lib/rfq-last/vendor-response/editor/commercial-terms-form.tsx +++ b/lib/rfq-last/vendor-response/editor/commercial-terms-form.tsx @@ -31,6 +31,7 @@ import { getPlaceOfShippingForSelection, getPlaceOfDestinationForSelection } from "@/lib/procurement-select/service" +import { TAX_CONDITIONS } from "@/lib/tax-conditions/types" import { toast } from "sonner" interface CommercialTermsFormProps { @@ -427,11 +428,53 @@ export default function CommercialTermsForm({ rfqDetail, rfq }: CommercialTermsF <div className="grid grid-cols-2 gap-4"> <div className="space-y-2"> <Label htmlFor="vendorTaxCode">세금 코드</Label> - <Input - id="vendorTaxCode" - {...register("vendorTaxCode")} - placeholder="세금 코드 입력" - /> + <Popover> + <PopoverTrigger asChild> + <Button + variant="outline" + role="combobox" + className="w-full justify-between" + > + {watch("vendorTaxCode") ? ( + <span className="truncate"> + {TAX_CONDITIONS.find(t => t.code === watch("vendorTaxCode"))?.name || watch("vendorTaxCode")} + </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> + <CommandEmpty>검색 결과가 없습니다.</CommandEmpty> + <CommandGroup> + {TAX_CONDITIONS.map((condition) => ( + <CommandItem + key={condition.code} + value={`${condition.code} ${condition.name}`} + onSelect={() => setValue("vendorTaxCode", 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 === watch("vendorTaxCode") ? "opacity-100" : "opacity-0" + )} + /> + </div> + </CommandItem> + ))} + </CommandGroup> + </CommandList> + </Command> + </PopoverContent> + </Popover> </div> <div className="space-y-2"> <Label htmlFor="vendorPlaceOfShipping">선적지</Label> |
