@extends($layout) @section('content') @php $m = $master ?? []; $masterBom = $m['bom'] ?? []; $masterColumns = $m['columns'] ?? []; $masterItems = $m['items'] ?? []; $imageColumns = $m['imageColumns'] ?? []; $fileColumns = $m['fileColumns'] ?? []; $refId = (int)($ref['id'] ?? 0); $typeNames = ['bom'=>'BOM','process'=>'工艺文件','tooling'=>'工具清单']; $typeName = $typeNames[$masterBom['type'] ?? 'bom'] ?? 'BOM'; @endphp
引用视图 — {{ $typeName }}(全局数据只读,可追加项目级列)
| {{ $label }} | @endforeach @foreach ($masterColumns as $col){{ $col['label'] ?: $col['key'] }} | @endforeach @foreach ($refColumns as $col){{ $col['label'] ?: $col['key'] }} × | @endforeach||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $item[$key] ?? '' }} | @endforeach @foreach ($masterColumns as $col)
@if (in_array($col['key'], $imageColumns, true))
@php $attach = json_decode((string)($item[$col['key']] ?? ''), true); @endphp
@if (is_array($attach))
@foreach ($attach as $a)
@endforeach @endif @else {{ $item[$col['key']] ?? '' }} @endif |
@endforeach
@foreach ($refColumns as $col)
@php
$cid = (int)$col['id'];
$val = $refValues[(int)$item['id']][$cid] ?? '';
@endphp
@endforeach | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 暂无明细 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||