feat: [작업자화면] 단계 완료 시 생산일자 자동 저장

- 어떤 단계든 완료 체크 시 생산일자가 비어있으면 오늘 날짜로 자동 저장
- 이미 생산일자가 설정되어 있으면 덮어쓰지 않음
This commit is contained in:
김보곤
2026-03-22 18:42:38 +09:00
parent 09dabd13af
commit db3ebc3f82

View File

@@ -1044,6 +1044,13 @@ export default function WorkerScreen() {
})); }));
toast.success(result.data.is_completed ? `${step.name} 완료` : `${step.name} 완료 취소`); 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) { if (result.data.work_order_status_changed) {
toast.success('모든 공정 단계 완료 — 작업지시가 자동 완료되었습니다.'); toast.success('모든 공정 단계 완료 — 작업지시가 자동 완료되었습니다.');