diff options
| author | joonhoekim <26rote@gmail.com> | 2025-09-26 18:09:01 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-09-26 18:09:01 +0900 |
| commit | 19d87786fb83447561e2420cc46f133ae1d56821 (patch) | |
| tree | 463c719487b73ca399f8689cae1bda0cfe36c98f | |
| parent | 9966b9709884713d296d74073714e5c4acef2521 (diff) | |
(김준회) 구매 AVL 관련 요구사항 처리 및 AVL 등록시 선적지 선택기 다이얼로그로 변경
5 files changed, 49 insertions, 15 deletions
diff --git a/components/common/selectors/place-of-shipping/index.ts b/components/common/selectors/place-of-shipping/index.ts index 8d157b4d..af426a3a 100644 --- a/components/common/selectors/place-of-shipping/index.ts +++ b/components/common/selectors/place-of-shipping/index.ts @@ -1,2 +1,2 @@ -export { PlaceOfShippingSelector } from './place-of-shipping-selector' +export { PlaceOfShippingSelector, PlaceOfShippingSelectorDialogSingle } from './place-of-shipping-selector' export type { PlaceOfShippingSelectorProps } from './place-of-shipping-selector' diff --git a/components/common/selectors/place-of-shipping/place-of-shipping-selector.tsx b/components/common/selectors/place-of-shipping/place-of-shipping-selector.tsx index 0a9916cd..2e9756a0 100644 --- a/components/common/selectors/place-of-shipping/place-of-shipping-selector.tsx +++ b/components/common/selectors/place-of-shipping/place-of-shipping-selector.tsx @@ -40,7 +40,7 @@ interface PlaceOfShippingData { description: string } -interface PlaceOfShippingSelectorProps { +export interface PlaceOfShippingSelectorProps { value?: string onValueChange?: (value: string) => void placeholder?: string diff --git a/components/common/selectors/vendor-tier/vendor-tier-selector.tsx b/components/common/selectors/vendor-tier/vendor-tier-selector.tsx index ba33c9cf..f27d184b 100644 --- a/components/common/selectors/vendor-tier/vendor-tier-selector.tsx +++ b/components/common/selectors/vendor-tier/vendor-tier-selector.tsx @@ -1,7 +1,6 @@ "use client" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" -import { useState } from "react" @@ -31,15 +30,35 @@ export function VendorTierSelector({ disabled = false, className }: VendorTierSelectorProps) { + // 선택된 값에 따른 툴팁 텍스트 + const getTooltipText = (value: string) => { + switch (value) { + case "Tier 1": + return "당사 협조도 우수, 필수 견적 의뢰 업체" + case "Tier 2": + return "해당 품목 주요 제작사, Tier 1 후보군" + case "none": + return "Tier 1, 2 미해당 업체" + default: + return "" + } + } + return ( <Select value={value} onValueChange={onValueChange} disabled={disabled}> - <SelectTrigger className={className}> + <SelectTrigger className={className} title={value ? getTooltipText(value) : ""}> <SelectValue placeholder={placeholder} /> </SelectTrigger> <SelectContent> - <SelectItem value="Tier 1">Tier 1: 당사 협조도 우수, 필수 견적 의뢰 업체</SelectItem> - <SelectItem value="Tier 2">Tier 2: 해당 품목 주요 제작사, Tier 1 후보군</SelectItem> - <SelectItem value="none">등급 외: Tier 1, 2 미해당 업체</SelectItem> + <SelectItem value="Tier 1" title="당사 협조도 우수, 필수 견적 의뢰 업체"> + Tier 1 + </SelectItem> + <SelectItem value="Tier 2" title="해당 품목 주요 제작사, Tier 1 후보군"> + Tier 2 + </SelectItem> + <SelectItem value="none" title="Tier 1, 2 미해당 업체"> + 등급 외 + </SelectItem> </SelectContent> </Select> ) diff --git a/lib/avl/table/avl-vendor-add-and-modify-dialog.tsx b/lib/avl/table/avl-vendor-add-and-modify-dialog.tsx index 8fb910da..f4050907 100644 --- a/lib/avl/table/avl-vendor-add-and-modify-dialog.tsx +++ b/lib/avl/table/avl-vendor-add-and-modify-dialog.tsx @@ -28,7 +28,7 @@ import { MaterialGroupSelectorDialogSingle } from "@/components/common/material/ import type { MaterialSearchItem } from "@/lib/material/material-group-service" import { VendorSelectorDialogSingle } from "@/components/common/vendor" import type { VendorSearchItem } from "@/components/common/vendor" -import { PlaceOfShippingSelector } from "@/components/common/selectors/place-of-shipping" +import { PlaceOfShippingSelectorDialogSingle } from "@/components/common/selectors/place-of-shipping/place-of-shipping-selector" import { VendorTierSelector } from "@/components/common/selectors/vendor-tier" import { DatePicker } from "@/components/ui/date-picker" import { NationSelector, type NationCode } from "@/components/common/selectors/nation" @@ -187,8 +187,9 @@ export function AvlVendorAddAndModifyDialog({ id: -1, // 임시 ID (실제 벤더 ID는 알 수 없음) vendorName: editingItem.vendorName || "", vendorCode: editingItem.vendorCode || null, + taxId: null, // 사업자번호 정보 없음 status: "UNKNOWN", // 상태 정보 없음 - displayText: editingItem.vendorCode + displayText: editingItem.vendorCode ? `${editingItem.vendorName} (${editingItem.vendorCode})` : editingItem.vendorName || "" }) @@ -802,12 +803,26 @@ export function AvlVendorAddAndModifyDialog({ </div> <div className="space-y-2"> <Label htmlFor="manufacturingLocation">제작/선적지 (국가)</Label> - <PlaceOfShippingSelector - value={formData.manufacturingLocation} - onValueChange={(value) => setFormData(prev => ({ ...prev, manufacturingLocation: value }))} - placeholder="제작/선적지를 선택하세요" - className="h-9" + <PlaceOfShippingSelectorDialogSingle + triggerLabel="제작/선적지 선택" + selectedPlace={formData.manufacturingLocation ? { + code: formData.manufacturingLocation, + description: formData.manufacturingLocation // 임시로 code와 동일하게 설정, 실제로는 DB에서 조회 필요 + } : null} + onPlaceSelect={(place) => setFormData(prev => ({ + ...prev, + manufacturingLocation: place?.code || "" + }))} + placeholder="제작/선적지를 검색하세요..." + title="제작/선적지 선택" + description="원하는 제작/선적지를 검색하고 선택해주세요." + triggerVariant="outline" /> + {formData.manufacturingLocation && ( + <div className="text-xs text-muted-foreground bg-blue-50 p-2 rounded"> + <span>선택됨: {formData.manufacturingLocation}</span> + </div> + )} </div> </div> </div> diff --git a/lib/vendor-pool/table/vendor-pool-table-columns.tsx b/lib/vendor-pool/table/vendor-pool-table-columns.tsx index 52a0ad28..897b8b1e 100644 --- a/lib/vendor-pool/table/vendor-pool-table-columns.tsx +++ b/lib/vendor-pool/table/vendor-pool-table-columns.tsx @@ -658,7 +658,7 @@ export const columns: ColumnDef<VendorPoolItem>[] = [ /> ) }, - size: 200, + size: 120, }, { accessorKey: "isAgent", |
