From 40534498b3c808d9741b2ece72a0ab745db2defd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 28 Feb 2026 14:37:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[equipment]=20=EC=A0=90=EA=B2=80?= =?UTF-8?q?=ED=91=9C=20=ED=8C=90=EC=A0=95=EB=9E=80=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=ED=95=A9=EA=B2=A9/=EB=B6=88=ED=95=A9=EA=B2=A9=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 일일점검: 주말 제외, 전체 셀 good/repaired → 합격 - 기타 주기: 전체 열 good/repaired → 합격 - 공백 또는 X(bad) 존재 시 불합격 표시 --- .../partials/inspection-grid.blade.php | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/resources/views/equipment/partials/inspection-grid.blade.php b/resources/views/equipment/partials/inspection-grid.blade.php index 8e6134f4..0ec53a17 100644 --- a/resources/views/equipment/partials/inspection-grid.blade.php +++ b/resources/views/equipment/partials/inspection-grid.blade.php @@ -39,6 +39,27 @@ $rowCount = $templates->count(); @endphp + @php + // 자동 판정 계산: 주말(daily) 제외, 모든 셀이 good/repaired면 합격 + $totalChecks = 0; + $passedChecks = 0; + foreach ($templates as $tmpl) { + foreach ($labels as $ci => $lbl) { + if ($isDaily && \App\Enums\InspectionCycle::isWeekend($period, $ci)) { + continue; + } + $totalChecks++; + $cd = \App\Enums\InspectionCycle::resolveCheckDate($cycle, $period, $ci); + $k = $tmpl->id . '_' . $cd; + $d = isset($details[$k]) ? $details[$k]->first() : null; + if ($d && in_array($d->result, ['good', 'repaired'])) { + $passedChecks++; + } + } + } + $autoJudgment = $totalChecks > 0 ? ($passedChecks === $totalChecks ? 'pass' : 'fail') : null; + @endphp + @foreach($templates as $idx => $tmpl) @if($idx === 0) @@ -78,10 +99,10 @@ @if($idx === 0) - @if($inspection && $inspection->overall_judgment) - - {{ $inspection->judgment_label }} - + @if($autoJudgment === 'pass') + 합격 + @elseif($autoJudgment === 'fail') + 불합격 @else - @endif