@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
List {{ $title_menu }}
{{-- alert --}} @include('components.alert')

{{-- BAGIAN KIRI: TOMBOL TAMBAH (jika ada) --}}
{{-- BAGIAN TENGAH: FILTER STATUS (BUTTON GROUP - sama seperti Matching Result) --}}
@php $currentStatusFilter = request('status', $status_filter ?? null); @endphp
Status Matching:
{{-- BAGIAN KANAN: SEARCH BAR --}}
{{-- 3. CONTENT (LIST CARD) --}}
{{-- Alert if Empty --}} @if ($table_detail->isEmpty())
No data found.
@else {{-- Loop through Grouped Data --}} @foreach ($table_detail as $reqNo => $group) @php $req = $group['request_info']; @endphp
{{-- CARD HEADER (Request Info) --}}
{{ $req->request_no }} {{-- Target Test Lab Info --}} @php $targetLab = $group['target_test_lab'] ?? null; @endphp
Target: L* {{ $targetLab && $targetLab->L !== null ? number_format($targetLab->L, 2) : '0' }} a* {{ $targetLab && $targetLab->a !== null ? number_format($targetLab->a, 2) : '0' }} b* {{ $targetLab && $targetLab->b !== null ? number_format($targetLab->b, 2) : '0' }} C* {{ $targetLab && $targetLab->C !== null ? number_format($targetLab->C, 2) : '0' }} h {{ $targetLab && $targetLab->h !== null ? number_format($targetLab->h, 2) : '0' }}
{{ $req->customer_name }}  |  {{ $req->customer_color_code ?? '-' }}
@if ($authorize->add == '1') @endif
@foreach ($group['suppliers'] as $supplierName => $samples) @php $rowCount = $samples->count(); @endphp @foreach ($samples as $index => $row) {{-- 1. SUPPLIER COLUMN (Rowspan) --}} @if ($index === 0) @endif {{-- 2. SAMPLE CODE --}} {{-- 3. DOSAGE --}} {{-- 4. DELTA VALUES (Tampilan Baru: Grid Rapi) --}} {{-- 6. ACTION COLUMN --}} @endforeach {{-- Separator Antar Supplier --}} @if (!$loop->last) @endif @endforeach
Supplier Code Dosage Delta Status Action
{{ $row->supplier_to ?? $row->supplier_name }}
{{-- 1. BADGE KODE (Biru) --}} @if ($row->code) {{ $row->code }} @else - @endif {{-- 2. BOX REMARK (Abu-abu) --}} @if (!empty($row->lab_remark))
{{-- Icon --}} {{-- Text --}} {{ $row->lab_remark }}
@endif
{{ $row->dosage }}%
{{-- Kolom Kiri: L & a --}}
ΔL* {{ $row->tl_delta_L !== null ? number_format($row->tl_delta_L, 2) : '-' }}
Δa* {{ $row->tl_delta_a !== null ? number_format($row->tl_delta_a, 2) : '-' }}
{{-- Kolom Kanan: b & E --}}
Δb* {{ $row->tl_delta_b !== null ? number_format($row->tl_delta_b, 2) : '-' }}
ΔE* {{-- Highlight Merah jika Delta E > 1 --}} {{ $row->tl_delta_E !== null ? number_format($row->tl_delta_E, 2) : '-' }}
@php // 1. Tentukan Warna Tombol $currentStatus = $row->lab_status; if ( empty($currentStatus) && $row->has_lab_data > 0 ) { $currentStatus = 'entry'; } $btnClass = match ( $currentStatus ) { 'accepted' => 'btn-outline-success', 'rejected' => 'btn-outline-danger', default => 'btn-outline-secondary', }; $labelStatus = match ( $currentStatus ) { 'accepted' => 'ACC', 'rejected' => 'REJ', default => 'ENTRY', }; // Ambil remark saat ini untuk dikirim ke modal $currentRemark = $row->lab_remark ?? ''; @endphp @if ($row->has_lab_data > 0 && $authorize->edit == '1') {{-- TOMBOL PEMICU MODAL --}} @endif @if ($authorize->add == '1') @endif
@endforeach @endif {{-- 4. PAGINATION --}}
{{-- MODAL TARGET SAMPLE --}}
{{-- ======================================================= --}} {{-- MODAL UPDATE STATUS (YANG TADI HILANG WRAPPERNYA) --}} {{-- ======================================================= --}} {{-- ======================================================= --}} {{-- LOADING OVERLAY --}} {{-- check flag js on dmenu --}} @if ($jsmenu == '1') @if (view()->exists("js.{$dmenu}")) @push('addjs') {{-- file js in folder (resources/views/js) --}} @include('js.' . $dmenu); @endpush @else @push('addjs') @endpush @endif @endif @endsection @push('js') @endpush