From faac8f657e42c23a7356fa435ea50ffb614fd47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 18 Mar 2026 13:17:40 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20[receiving]=20=EB=AF=B8=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20searchItems=20dead=20code=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ItemOption 인터페이스, MOCK_ITEMS, searchItems() 함수 제거 - 실제 품목검색은 ItemSearchModal → fetchItems()를 사용 --- .../material/ReceivingManagement/actions.ts | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/src/components/material/ReceivingManagement/actions.ts b/src/components/material/ReceivingManagement/actions.ts index db78735d..81fa3392 100644 --- a/src/components/material/ReceivingManagement/actions.ts +++ b/src/components/material/ReceivingManagement/actions.ts @@ -683,58 +683,6 @@ export async function processReceiving( return { success: result.success, data: result.data, error: result.error }; } -// ===== 품목 검색 (입고 등록용) ===== -export interface ItemOption { - value: string; // itemCode - label: string; // itemCode 표시 - description?: string; // 품목명 + 규격 - itemName: string; - specification: string; - unit: string; -} - -const MOCK_ITEMS: ItemOption[] = [ - { value: 'STEEL-001', label: 'STEEL-001', description: 'SUS304 스테인리스 판재 (1000x2000x3T)', itemName: 'SUS304 스테인리스 판재', specification: '1000x2000x3T', unit: 'EA' }, - { value: 'STEEL-002', label: 'STEEL-002', description: '알루미늄 프로파일 (40x40x2000L)', itemName: '알루미늄 프로파일', specification: '40x40x2000L', unit: 'EA' }, - { value: 'ELEC-002', label: 'ELEC-002', description: 'MCU 컨트롤러 IC (STM32F103C8T6)', itemName: 'MCU 컨트롤러 IC', specification: 'STM32F103C8T6', unit: 'EA' }, - { value: 'ELEC-005', label: 'ELEC-005', description: 'DC 모터 24V (24V 100RPM)', itemName: 'DC 모터 24V', specification: '24V 100RPM', unit: 'EA' }, - { value: 'ELEC-007', label: 'ELEC-007', description: '커패시터 100uF (100uF 50V)', itemName: '커패시터 100uF', specification: '100uF 50V', unit: 'EA' }, - { value: 'PLAS-003', label: 'PLAS-003', description: 'ABS 사출 케이스 (150x100x50)', itemName: 'ABS 사출 케이스', specification: '150x100x50', unit: 'SET' }, - { value: 'CHEM-001', label: 'CHEM-001', description: '에폭시 접착제 (500ml)', itemName: '에폭시 접착제', specification: '500ml', unit: 'EA' }, - { value: 'BOLT-001', label: 'BOLT-001', description: 'SUS 볼트 M8x30 (M8x30 SUS304)', itemName: 'SUS 볼트 M8x30', specification: 'M8x30 SUS304', unit: 'EA' }, -]; - -export async function searchItems(query?: string): Promise<{ - success: boolean; - data: ItemOption[]; -}> { - if (USE_MOCK_DATA) { - if (!query) return { success: true, data: MOCK_ITEMS }; - const q = query.toLowerCase(); - const filtered = MOCK_ITEMS.filter( - (item) => - item.value.toLowerCase().includes(q) || - item.itemName.toLowerCase().includes(q) - ); - return { success: true, data: filtered }; - } - - interface ItemApiData { data: Array> } - const result = await executeServerAction({ - url: buildApiUrl('/api/v1/items', { search: query, per_page: 50 }), - transform: (d) => (d.data || []).map((item) => ({ - value: item.item_code, - label: item.item_code, - description: `${item.item_name} (${item.specification || '-'})`, - itemName: item.item_name, - specification: item.specification || '', - unit: item.unit || 'EA', - })), - errorMessage: '품목 검색에 실패했습니다.', - }); - return { success: result.success, data: result.data || [] }; -} - // ===== 발주처 검색 (입고 등록용) ===== export interface SupplierOption { value: string;