feat: [문서] 모든 문서 저장 경로에 rendered_html 스냅샷 캡처 추가

- InspectionReportModal: readOnly 모드에서도 콘텐츠 로드 후 자동 캡처
- ImportInspectionInputModal: 수입검사 저장 시 폼 HTML 캡처 전송
- ReceivingManagement/actions: saveInspectionData에 rendered_html 파라미터 추가
This commit is contained in:
2026-03-06 20:04:11 +09:00
parent a1fb0d4f9b
commit 31f523c88f
3 changed files with 27 additions and 3 deletions

View File

@@ -469,6 +469,21 @@ export function InspectionReportModal({
}
};
// readOnly 모드에서도 콘텐츠 렌더 후 rendered_html 자동 캡처 (MNG 출력용)
useEffect(() => {
if (!open || !order || isLoading || !readOnly || !workOrderId) return;
// 렌더링 완료 후 캡처
const timer = setTimeout(() => {
const html = contentWrapperRef.current?.innerHTML;
if (html && html.length > 100) {
saveInspectionDocument(workOrderId, { rendered_html: html }).catch(() => {
// 자동 캡처 실패는 무시 (template 미연결 시 404 가능)
});
}
}, 500);
return () => clearTimeout(timer);
}, [open, order, isLoading, readOnly, workOrderId]);
// 결재 상신 가능 여부: 저장된 DRAFT 문서가 있을 때
const canSubmitForApproval = savedDocumentId != null && savedDocumentStatus === 'DRAFT';