{{-- 절곡 중간검사 DATA 전용 렌더링 React BendingInspectionContent.tsx와 동일한 구조 데이터 소스: work_order_items.options.inspection_data (스냅샷) - 제품 구조, 도면치수, 측정값이 모두 포함된 완전한 스냅샷 - 정책 변경 시에도 저장 시점의 문서 그대로 유지 필요 변수: - $inspectionData: inspection_data 스냅샷 (array|null) - $docData: document_data collection (fallback용) - $document: Document model --}} @php // inspection_data 스냅샷에서 제품 목록 로드 $products = $inspectionData['products'] ?? []; $snapshotJudgment = $inspectionData['judgment'] ?? null; $inadequateContent = $inspectionData['inadequateContent'] ?? ''; // 스냅샷이 없으면 INITIAL_PRODUCTS 하드코딩 fallback (레거시 호환) if (empty($products)) { $products = [ ['id' => 'guide-rail-wall', 'category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '벽면형', 'lengthDesignValue' => '3000', 'widthDesignValue' => 'N/A', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '30', 'measured' => ''], ['point' => '②', 'designValue' => '80', 'measured' => ''], ['point' => '③', 'designValue' => '45', 'measured' => ''], ['point' => '④', 'designValue' => '40', 'measured' => ''], ['point' => '⑤', 'designValue' => '34', 'measured' => ''], ]], ['id' => 'guide-rail-side', 'category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '측면형', 'lengthDesignValue' => '3000', 'widthDesignValue' => 'N/A', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '28', 'measured' => ''], ['point' => '②', 'designValue' => '75', 'measured' => ''], ['point' => '③', 'designValue' => '42', 'measured' => ''], ['point' => '④', 'designValue' => '38', 'measured' => ''], ['point' => '⑤', 'designValue' => '32', 'measured' => ''], ]], ['id' => 'case', 'category' => 'KWE01', 'productName' => '케이스', 'productType' => '500X380', 'lengthDesignValue' => '3000', 'widthDesignValue' => 'N/A', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '380', 'measured' => ''], ['point' => '②', 'designValue' => '50', 'measured' => ''], ['point' => '③', 'designValue' => '240', 'measured' => ''], ['point' => '④', 'designValue' => '50', 'measured' => ''], ]], ['id' => 'bottom-finish', 'category' => 'KWE01', 'productName' => '하단마감재', 'productType' => '60X40', 'lengthDesignValue' => '3000', 'widthDesignValue' => 'N/A', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '60', 'measured' => ''], ['point' => '②', 'designValue' => '64', 'measured' => ''], ]], ['id' => 'bottom-l-bar', 'category' => 'KWE01', 'productName' => '하단L-BAR', 'productType' => '17X60', 'lengthDesignValue' => '3000', 'widthDesignValue' => 'N/A', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '17', 'measured' => ''], ]], ['id' => 'smoke-w50', 'category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W50\n가이드레일용", 'lengthDesignValue' => '3000', 'widthDesignValue' => '', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '50', 'measured' => ''], ['point' => '②', 'designValue' => '12', 'measured' => ''], ]], ['id' => 'smoke-w80', 'category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W80\n케이스용", 'lengthDesignValue' => '3000', 'widthDesignValue' => '', 'bendingStatus' => null, 'lengthMeasured' => '', 'widthMeasured' => '', 'gapPoints' => [ ['point' => '①', 'designValue' => '80', 'measured' => ''], ['point' => '②', 'designValue' => '12', 'measured' => ''], ]], ]; } // 제품 ID → 메타 정보 매핑 (스냅샷에 category/productName/productType가 없을 경우 보완) $productMeta = [ 'guide-rail-wall' => ['category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '벽면형'], 'guide_rail_wall' => ['category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '벽면형'], 'guide-rail-side' => ['category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '측면형'], 'guide_rail_side' => ['category' => 'KWE01', 'productName' => '가이드레일', 'productType' => '측면형'], 'case' => ['category' => 'KWE01', 'productName' => '케이스', 'productType' => '500X380'], 'bottom-finish' => ['category' => 'KWE01', 'productName' => '하단마감재', 'productType' => '60X40'], 'bottom_finish' => ['category' => 'KWE01', 'productName' => '하단마감재', 'productType' => '60X40'], 'bottom-l-bar' => ['category' => 'KWE01', 'productName' => '하단L-BAR', 'productType' => '17X60'], 'bottom_l_bar' => ['category' => 'KWE01', 'productName' => '하단L-BAR', 'productType' => '17X60'], 'smoke-w50' => ['category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W50\n가이드레일용"], 'smoke_w50' => ['category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W50\n가이드레일용"], 'smoke-w80' => ['category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W80\n케이스용"], 'smoke_w80' => ['category' => 'KWE01', 'productName' => '연기차단재', 'productType' => "W80\n케이스용"], ]; // 종합판정 결정 $overallResult = $snapshotJudgment ?? ($docData->where('field_key', 'overall_result')->first()?->field_value ?? ''); $isOverallPass = in_array(strtolower($overallResult), ['pass', 'ok', '적합', '합격']); @endphp
| 분류 | 제품명 | 타입 | 겉모양/ 절곡상태 |
길이 | 너비 | 간격 | 판정 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 도면치수 | 측정값 | 도면치수 | 측정값 | 포인트 | 도면치수 | 측정값 | ||||||||
| {{ $category }} | {{-- 제품명 --}}{{ $productName }} | {{-- 타입 --}}{{ $productType }} | {{-- 겉모양/절곡상태 --}}@if($statusVal === '양호' || strtolower($statusVal ?? '') === 'pass' || strtolower($statusVal ?? '') === 'ok') @elseif($statusVal === '불량' || strtolower($statusVal ?? '') === 'fail' || strtolower($statusVal ?? '') === 'ng') @else - @endif | {{-- 길이 도면치수 --}}{{ $lengthDesign ?: '-' }} | {{-- 길이 측정값 --}}{{ $lengthMeasured ?: '-' }} | {{-- 너비 도면치수 --}}{{ $widthDesign ?: '-' }} | {{-- 너비 측정값 --}}{{ $widthMeasured ?: '-' }} | @endif {{-- 간격 포인트 --}} @if(!empty($gapPoints)) @php $gap = $gapPoints[$gIdx] ?? []; @endphp{{ $gap['point'] ?? '' }} | {{ $gap['designValue'] ?? '' }} | {{ ($gap['measured'] ?? '') ?: '-' }} | @else- | - | - | @endif @if($gIdx === 0) {{-- 판정 --}}@if($judgmentVal === '적') 적 @elseif($judgmentVal === '부') 부 @else - @endif | @endif