From d91057aeb1664d62aae3da0c853e2b53a3298c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 21 Mar 2026 21:20:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[=EC=9E=91=EC=97=85=EC=9D=BC=EC=A7=80]?= =?UTF-8?q?=20=EC=9E=AC=EA=B3=B5=ED=92=88=20=EA=B3=B5=EC=A0=95=EB=B3=84=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=EC=9D=BC=EC=A7=80=20=EC=96=91=EC=8B=9D=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=8C=90=EB=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/WorkerScreen/WorkLogModal.tsx | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/production/WorkerScreen/WorkLogModal.tsx b/src/components/production/WorkerScreen/WorkLogModal.tsx index 9649892e..7e40c0f3 100644 --- a/src/components/production/WorkerScreen/WorkLogModal.tsx +++ b/src/components/production/WorkerScreen/WorkLogModal.tsx @@ -42,8 +42,10 @@ interface WorkLogModalProps { * 양식명 → 공정 타입 매핑 * 공정관리에서 매핑된 양식명을 기반으로 콘텐츠 컴포넌트를 결정 */ -function resolveProcessTypeFromTemplate(templateName?: string): ProcessType | undefined { +function resolveProcessTypeFromTemplate(templateName?: string): ProcessType | 'template' | undefined { if (!templateName) return undefined; + // 재공품 전용 작업일지는 템플릿 기반(범용) 렌더링 + if (templateName.includes('재공품')) return 'template'; if (templateName.includes('스크린')) return 'screen'; if (templateName.includes('슬랫')) return 'slat'; if (templateName.includes('절곡')) return 'bending'; @@ -236,11 +238,16 @@ export function WorkLogModal({ // 1순위: 공정관리에서 매핑된 양식명으로 결정 const templateType = resolveProcessTypeFromTemplate(workLogTemplateName); - // 2순위: processType 폴백 (양식 미매핑 시) - const type = templateType || processType || order.processType; + // 2순위: 작업지시 공정명에서 판별 (process_id가 자식 공정인 경우) + const orderProcessType = order.processName?.includes('재공품') + ? 'template' as const + : undefined; + + // 3순위: processType 폴백 (양식 미매핑 시) + const type = templateType || orderProcessType || processType || order.processType; // 양식이 매핑되어 있지 않은 경우 안내 - if (!workLogTemplateId && !processType) { + if (!workLogTemplateId && !processType && !orderProcessType) { return renderNoTemplate(); } @@ -256,15 +263,28 @@ export function WorkLogModal({ lotNoMap[lot.item_code] = lot.lot_no; } } - return ; + // STOCK 단일부품: 원자재 LOT 번호를 직접 전달 + const rawMaterialLotNo = materialLots.find(lot => !lot.item_code.startsWith('BD-'))?.lot_no; + return ( + + ); } + case 'template': + // 재공품 등 템플릿 기반 작업일지 → 범용 WorkLogContent + return ; default: return ; } }; - // 양식명으로 문서 제목 결정 - const documentTitle = workLogTemplateName || '작업일지'; + // 양식명으로 문서 제목 결정 (작업지시 공정명 폴백) + const documentTitle = workLogTemplateName + || (order?.processName ? `${order.processName} 작업일지` : '작업일지'); const toolbarExtra = (