{{-- ── Header ────────────────────────────────────────────────── --}}
QC — Pruebas Físicas
GSM · Ancho · Elongación · Resistencia al Lavado
→ 4 Puntos → Color ΔE → Six Sigma
{{-- ── Flash message ─────────────────────────────────────────── --}} @if($flashMsg)
{{ $flashType === 'success' ? '✅' : ($flashType === 'warning' ? '⚠️' : '❌') }} {{ $flashMsg }}
@endif {{-- ── Roll search ───────────────────────────────────────────── --}}
@if($selectedEtiqueta) @endif
@if($notFoundMsg)
❌ {{ $notFoundMsg }}
@endif {{-- ── No roll selected ─────────────────────────────────────── --}} @if(!$selectedEtiqueta)
🧵
Ingrese la etiqueta de un rollo
Escanee o escriba la etiqueta y presione Cargar rollo para iniciar la prueba física.
@else @php $results = $this->computeResults(); @endphp {{-- ── Two-column layout: info card + form ────────────────────── --}}
{{-- ── Left: Roll info card ──────────────────────────────── --}}
Rollo
{{ $selectedEtiqueta }}
@if($division)
{{ $division->article?->id ?? '—' }} @if($division->article?->fiber_desc)
{{ Str::limit($division->article->fiber_desc, 40) }} @endif
Metros {{ number_format($division->metros, 1) }} m
@if($division->article?->gsm_target)
GSM objetivo {{ $division->article->gsm_target }} g/m²
@endif @if($division->article?->width_target)
Ancho objetivo {{ $division->article->width_target }}"
@endif
Calidad actual {{ $division->calidad_final ?? 'PEND' }}
@endif {{-- Links to other QC modules for same roll --}}
Otros QC para este rollo:
{{-- ── History (compact in sidebar on wide screens) ── --}} @if($history->count() > 0)
Historial
@foreach($history as $h)
{{ $h->fecha?->format('d/m/Y') }} @php $oc = match($h->overall_result) { 'APPROVED' => '#10b981', 'CONDITIONAL' => '#f59e0b', 'REJECTED' => '#ef4444', default => '#94a3b8', }; @endphp {{ $h->overall_result }}
{{ $h->stage }} · {{ $h->inspector }} @if($h->gsm) | GSM {{ $h->gsm }} @endif @if($h->width_in) | {{ $h->width_in }}" @endif
@endforeach
@endif
{{-- ── Right: Test form ──────────────────────────────────── --}}
{{-- Overall result bar (reactive) --}} @php $overallClass = match($results['overall']) { 'APPROVED' => 'overall-approved', 'CONDITIONAL' => 'overall-conditional', 'REJECTED' => 'overall-rejected', default => 'overall-pending', }; $overallIcon = match($results['overall']) { 'APPROVED' => '✅', 'CONDITIONAL' => '⚠️', 'REJECTED' => '❌', default => '⏳', }; $overallText = match($results['overall']) { 'APPROVED' => 'Aprobado', 'CONDITIONAL' => 'Condicional — requiere revisión', 'REJECTED' => 'Rechazado — fuera de especificación', default => 'Pendiente — ingrese valores', }; @endphp
{{ $overallIcon }}
{{ $overallText }}
Resultado se actualiza automáticamente mientras ingresa valores
{{-- Meta row: stage, date, inspector --}}
📋 Datos de la prueba
{{-- ── GSM ──────────────────────────────────────────── --}}
⚖️ Gramaje (GSM) @if($results['gsm']) {{ $results['gsm'] }} @endif
@if($division?->article?->gsm_target) Artículo: {{ $division->article->gsm_target }} @endif
@if($gsm !== '' && $gsm_target !== '' && (float)$gsm_target > 0) @php $dev = round(((float)$gsm - (float)$gsm_target) / (float)$gsm_target * 100, 1); @endphp Desviación: {{ $dev > 0 ? '+' : '' }}{{ $dev }}% @endif
{{-- ── Width ─────────────────────────────────────────── --}}
📏 Ancho @if($results['width']) {{ $results['width'] }} @endif
@if($division?->article?->width_target) Artículo: {{ $division->article->width_target }}" @endif
@if($width_in !== '' && $width_target_in !== '') @php $wdev = round((float)$width_in - (float)$width_target_in, 2); @endphp Diferencia: {{ $wdev > 0 ? '+' : '' }}{{ $wdev }}" @endif
{{-- ── Stretch ─────────────────────────────────────────── --}}
🔀 Elongación / Estiramiento @if($results['stretch']) {{ $results['stretch'] }} @else (registro sin objetivo = solo datos) @endif
PASS: diferencia ≤ ±2% vs. objetivo. Sin objetivo → solo registro de datos.
{{-- ── Wash Resistance ─────────────────────────────────── --}}
🫧 Resistencia al Lavado (ISO 105) @if($results['wash']) {{ $results['wash'] }} @endif
{{-- Star / numeric rating --}}
Calificación (1 = muy deficiente → 5 = excelente)
@for($s = 1; $s <= 5; $s++) ★ @endfor @if($wash_resistance > 0) {{ $wash_resistance }} — {{ \App\Models\PhysicalTest::WASH_LABELS[$wash_resistance] }} @else Haga clic para calificar @endif
PASS ≥ 4 | MARGINAL = 3 | FAIL ≤ 2
{{-- Dimensional change after wash --}}
{{-- ── Notes & Save ────────────────────────────────────── --}}
📝 Observaciones
{{-- ── History table (full width, below on narrow screens) ─── --}} @if($history->count() > 0)
Historial — {{ $selectedEtiqueta }}
@foreach($history as $h) @endforeach
Fecha Etapa Inspector GSM Ancho" Elong. Urd. Elong. Tra. ISO Lav. Enc. Urd. Enc. Tra. Resultado
{{ $h->fecha?->format('d/m/Y') }} {{ $h->stage }} {{ $h->inspector }} @if($h->gsm !== null) {{ $h->gsm }} @if($h->gsm_target) /{{ $h->gsm_target }} @endif @if($h->gsm_result) {{ $h->gsm_result }} @endif @else — @endif @if($h->width_in !== null) {{ $h->width_in }}" @if($h->width_result) {{ $h->width_result }} @endif @else — @endif {{ $h->stretch_warp_pct !== null ? $h->stretch_warp_pct.'%' : '—' }} {{ $h->stretch_weft_pct !== null ? $h->stretch_weft_pct.'%' : '—' }} @if($h->wash_resistance) @for($s=1;$s<=5;$s++)★@endfor @else — @endif {{ $h->wash_shrink_warp_pct !== null ? $h->wash_shrink_warp_pct.'%' : '—' }} {{ $h->wash_shrink_weft_pct !== null ? $h->wash_shrink_weft_pct.'%' : '—' }} @php $oc = match($h->overall_result) { 'APPROVED' => 'rb-pass', 'CONDITIONAL' => 'rb-marginal', 'REJECTED' => 'rb-fail', default => 'rb-pending', }; @endphp {{ $h->overall_result }}
@endif @endif {{-- /selectedEtiqueta --}}