diff --git a/src/components/production/WorkerScreen/index.tsx b/src/components/production/WorkerScreen/index.tsx index 705527fd..2c28c50d 100644 --- a/src/components/production/WorkerScreen/index.tsx +++ b/src/components/production/WorkerScreen/index.tsx @@ -1044,6 +1044,13 @@ export default function WorkerScreen() { })); toast.success(result.data.is_completed ? `${step.name} 완료` : `${step.name} 완료 취소`); + // 단계 완료 시 생산일자가 비어있으면 오늘로 자동 저장 + if (result.data.is_completed && !productionDate) { + const today = new Date().toISOString().slice(0, 10); + setProductionDate(today); + updateWorkOrderInfo(orderId, { scheduled_date: today }); + } + // 모든 단계 완료 시 작업지시 자동 완료 → 생산일자 저장 + 목록 새로고침 if (result.data.work_order_status_changed) { toast.success('모든 공정 단계 완료 — 작업지시가 자동 완료되었습니다.');