fix: [build] 타입 오류 수정 (cancelledCount, lot_no)
- order-management-sales: revertProduction 결과 구조분해로 타입 추론 수정 - WorkerScreen/actions: lot_no 접근 타입 캐스트 추가
This commit is contained in:
@@ -362,17 +362,17 @@ export default function OrderDetailPage() {
|
|||||||
reason: revertReason || undefined,
|
reason: revertReason || undefined,
|
||||||
});
|
});
|
||||||
if (result.success && result.data) {
|
if (result.success && result.data) {
|
||||||
setOrder(result.data.order);
|
const { order: updatedOrder, deletedCounts, cancelledCount } = result.data;
|
||||||
if (result.data.deletedCounts) {
|
setOrder(updatedOrder);
|
||||||
|
if (deletedCounts) {
|
||||||
// force 모드 (개발): 물리 삭제 건수
|
// force 모드 (개발): 물리 삭제 건수
|
||||||
const { deletedCounts } = result.data;
|
|
||||||
toast.success(
|
toast.success(
|
||||||
`생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)`
|
`생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// cancel 모드 (운영): 취소 처리 건수
|
// cancel 모드 (운영): 취소 처리 건수
|
||||||
const msg = result.data.cancelledCount
|
const msg = cancelledCount
|
||||||
? `생산지시가 취소되었습니다. (${result.data.cancelledCount}건 취소)`
|
? `생산지시가 취소되었습니다. (${cancelledCount}건 취소)`
|
||||||
: '생산지시가 되돌려졌습니다.';
|
: '생산지시가 되돌려졌습니다.';
|
||||||
toast.success(msg);
|
toast.success(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ export async function completeWorkOrder(
|
|||||||
});
|
});
|
||||||
if (!result.success) return { success: false, error: result.error };
|
if (!result.success) return { success: false, error: result.error };
|
||||||
// 백엔드에서 생성한 실제 LOT 번호 사용
|
// 백엔드에서 생성한 실제 LOT 번호 사용
|
||||||
const lotNo = result.data?.lot_no || null;
|
const lotNo = (result.data as { lot_no?: string })?.lot_no;
|
||||||
return { success: true, lotNo };
|
return { success: true, lotNo };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user