From 9ae22103887d84ef21b4315737a127527e4f4495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 27 Feb 2026 11:13:07 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[=EC=83=9D=EC=82=B0]=20=EC=A0=9C?= =?UTF-8?q?=ED=92=88=EC=BD=94=EB=93=9C(productCode)=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProductionDashboard, WorkerScreen 타입/변환에 productCode 필드 추가 - WorkOrderListPanel 목록에 제품코드 - 제품명 형태로 표시 - WorkerScreen 검사 항목에 제품코드 포함 --- src/components/production/ProductionDashboard/actions.ts | 5 ++++- src/components/production/ProductionDashboard/types.ts | 1 + .../production/WorkerScreen/WorkOrderListPanel.tsx | 4 ++-- src/components/production/WorkerScreen/actions.ts | 5 +++++ src/components/production/WorkerScreen/index.tsx | 7 +++++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/production/ProductionDashboard/actions.ts b/src/components/production/ProductionDashboard/actions.ts index 1003f69e..29127f48 100644 --- a/src/components/production/ProductionDashboard/actions.ts +++ b/src/components/production/ProductionDashboard/actions.ts @@ -23,10 +23,11 @@ interface WorkOrderApiItem { created_at: string; sales_order?: { id: number; order_no: string; client_id?: number; client_name?: string; + item?: { id: number; code: string; name: string } | null; client?: { id: number; name: string }; root_nodes_count?: number; }; assignee?: { id: number; name: string }; - items?: { id: number; item_name: string; quantity: number }[]; + items?: { id: number; item_name: string; item_id?: number | null; item?: { id: number; code: string; name: string } | null; quantity: number }[]; } // ===== 상태 변환 ===== @@ -41,6 +42,7 @@ function mapApiStatus(status: WorkOrderApiItem['status']): 'waiting' | 'inProgre // ===== API → WorkOrder 변환 ===== function transformToProductionFormat(api: WorkOrderApiItem): WorkOrder { const totalQuantity = (api.items || []).reduce((sum, item) => sum + Number(item.quantity), 0); + const productCode = api.sales_order?.item?.code || '-'; const productName = api.items?.[0]?.item_name || '-'; const dueDate = api.scheduled_date || ''; const today = new Date(); @@ -57,6 +59,7 @@ function transformToProductionFormat(api: WorkOrderApiItem): WorkOrder { return { id: String(api.id), orderNo: api.work_order_no, + productCode, productName, processCode: api.process?.process_code || '-', processName: api.process?.process_name || '-', diff --git a/src/components/production/ProductionDashboard/types.ts b/src/components/production/ProductionDashboard/types.ts index bf3abc27..1fa899b0 100644 --- a/src/components/production/ProductionDashboard/types.ts +++ b/src/components/production/ProductionDashboard/types.ts @@ -14,6 +14,7 @@ export interface ProcessOption { export interface WorkOrder { id: string; orderNo: string; // KD-WO-251216-01 + productCode: string; // 제품코드 (KQTS01 등) productName: string; // 스크린 서터 (표준형) - 추가 processCode: string; // 공정 코드 (P-001, P-002, ...) processName: string; // 공정명 (슬랫, 스크린, 절곡, ...) diff --git a/src/components/production/WorkerScreen/WorkOrderListPanel.tsx b/src/components/production/WorkerScreen/WorkOrderListPanel.tsx index e9f0a881..df90be9f 100644 --- a/src/components/production/WorkerScreen/WorkOrderListPanel.tsx +++ b/src/components/production/WorkerScreen/WorkOrderListPanel.tsx @@ -74,8 +74,8 @@ export function WorkOrderListPanel({ - {/* 품목명 */} -

{order.productName}

+ {/* 제품코드 - 제품명 */} +

{order.productCode} - {order.productName}

{/* 현장명 + 수량 */}
diff --git a/src/components/production/WorkerScreen/actions.ts b/src/components/production/WorkerScreen/actions.ts index d63dcb2e..a526ee3b 100644 --- a/src/components/production/WorkerScreen/actions.ts +++ b/src/components/production/WorkerScreen/actions.ts @@ -38,6 +38,7 @@ interface WorkOrderApiItem { sales_order?: { id: number; order_no: string; + item?: { id: number; code: string; name: string } | null; client?: { id: number; name: string }; client_contact?: string; options?: { manager_name?: string; [key: string]: unknown }; @@ -50,6 +51,8 @@ interface WorkOrderApiItem { items?: { id: number; item_name: string; + item_id?: number | null; + item?: { id: number; code: string; name: string } | null; quantity: number; specification?: string | null; options?: Record | null; @@ -89,6 +92,7 @@ function mapApiStatus(status: WorkOrderApiItem['status']): WorkOrderStatus { // ===== API → WorkOrder 변환 ===== function transformToWorkerScreenFormat(api: WorkOrderApiItem): WorkOrder { const totalQuantity = (api.items || []).reduce((sum, item) => sum + Number(item.quantity), 0); + const productCode = api.sales_order?.item?.code || '-'; const productName = api.items?.[0]?.item_name || '-'; // 납기일 계산 (지연 여부) @@ -173,6 +177,7 @@ function transformToWorkerScreenFormat(api: WorkOrderApiItem): WorkOrder { return { id: String(api.id), orderNo: api.work_order_no, + productCode, productName, processCode: processInfo.code, processName: processInfo.name, diff --git a/src/components/production/WorkerScreen/index.tsx b/src/components/production/WorkerScreen/index.tsx index 8ffa88fd..848966f3 100644 --- a/src/components/production/WorkerScreen/index.tsx +++ b/src/components/production/WorkerScreen/index.tsx @@ -714,7 +714,7 @@ export default function WorkerScreen() { workOrderId: selectedOrder.id, itemNo: index + 1, itemCode: selectedOrder.orderNo || '-', - itemName: itemSummary, + itemName: `${selectedOrder.productCode !== '-' ? selectedOrder.productCode + ' - ' : ''}${itemSummary}`, floor: (opts.floor as string) || '-', code: (opts.code as string) || '-', width: (opts.width as number) || 0, @@ -774,7 +774,7 @@ export default function WorkerScreen() { workOrderId: selectedOrder.id, itemNo: 1, itemCode: selectedOrder.orderNo || '-', - itemName: selectedOrder.productName || '-', + itemName: `${selectedOrder.productCode !== '-' ? selectedOrder.productCode + ' - ' : ''}${selectedOrder.productName || '-'}`, floor: '-', code: '-', width: 0, @@ -940,6 +940,7 @@ export default function WorkerScreen() { const syntheticOrder: WorkOrder = { id: item.id, orderNo: item.itemCode, + productCode: item.itemCode, productName: item.itemName, processCode: item.processType, processName: PROCESS_TAB_LABELS[item.processType], @@ -999,6 +1000,7 @@ export default function WorkerScreen() { const syntheticOrder: WorkOrder = { id: mockItem.id, orderNo: mockItem.itemCode, + productCode: mockItem.itemCode, productName: mockItem.itemName, processCode: mockItem.processType, processName: PROCESS_TAB_LABELS[mockItem.processType], @@ -1239,6 +1241,7 @@ export default function WorkerScreen() { return { id: mockItem.id, orderNo: mockItem.itemCode, + productCode: mockItem.itemCode, productName: mockItem.itemName, processCode: mockItem.processType, processName: PROCESS_TAB_LABELS[mockItem.processType],