{{ $totalRolls }}
Total Rollos
{{ $conProceso }}
Con Proceso
{{ $sinProceso }}
Sin Proceso
{{ $enProcesoWH }}
En Proceso WH
Rollos {{ $rolls->count() }} rollos
@forelse ($rolls as $roll) @php $whSt = $this->getWhStatus($roll->etiqueta); $lastProc = $roll->processes->sortByDesc('fecha')->sortByDesc('id')->first(); $procCount = $roll->processes->count(); // Time & Action Stage Status Calculations // 1. Yarn (Hilo) $yarnReq = $roll->partida?->yarnRequests; $yarnStatus = 'si-plan'; $yarnText = 'â—‹'; if ($yarnReq && $yarnReq->isNotEmpty()) { if ($yarnReq->every(fn($r) => $r->estado === 'ENTREGADA')) { $yarnStatus = 'si-done'; $yarnText = 'âś“'; } else { $yarnStatus = 'si-run'; $yarnText = 'â—Ź'; } } // 2. Sizing (Engomado) $sizeStatus = 'si-plan'; $sizeText = 'â—‹'; if ($roll->partida) { if ($roll->partida->estado === 'COMPLETADA') { $sizeStatus = 'si-done'; $sizeText = 'âś“'; } elseif ($roll->partida->estado === 'EN_PROCESO') { $sizeStatus = 'si-run'; $sizeText = 'â—Ź'; } } // 3. Beam (Plegado) $beamStatus = 'si-plan'; $beamText = 'â—‹'; if ($roll->partida?->beams && $roll->partida->beams->isNotEmpty()) { if ($roll->partida->beams->every(fn($b) => $b->estado === 'LOADED' || $b->estado === 'DEPLETED')) { $beamStatus = 'si-done'; $beamText = 'âś“'; } else { $beamStatus = 'si-run'; $beamText = 'â—Ź'; } } // 4. Weaving (Tejido) $weavingStatus = 'si-done'; $weavingText = 'âś“'; // 5. QC (Calidad) $qcStatus = 'si-plan'; $qcText = 'â—‹'; if ($roll->calidad_final && $roll->calidad_final !== 'PENDIENTE') { $qcStatus = 'si-done'; $qcText = 'âś“'; } else { $qcStatus = 'si-run'; $qcText = 'â—Ź'; } @endphp @empty @endforelse
Clave ArtĂ­culo Partida Mts Kg QC Estado Ăšltimo Proceso T&A Flow (Hilo, Eng, Pleg, Tej, QC) Acciones
{{ $roll->etiqueta }} {{ $roll->articulo_id ?: '—' }} {{ $roll->partida?->codigo ?: ($roll->partida_id ?: '—') }} {{ number_format($roll->metros, 1) }} {{ $roll->greigeInventory && $roll->greigeInventory->peso_kg ? number_format($roll->greigeInventory->peso_kg, 1) : '—' }} {!! $this->getQcBadge($roll->calidad_final) !!} {!! $this->getStatusLabel($whSt) !!} @if ($lastProc) @php $def = \App\Models\RollProceso::getProcesoDef($lastProc->proceso); @endphp {{ $def ? $def['icon'] : '⚙️' }} {{ $def ? $def['label'] : $lastProc->proceso }} @else — @endif
{{ $yarnText }}
{{ $sizeText }}
{{ $beamText }}
{{ $weavingText }}
{{ $qcText }}
Sin resultados
@if ($selectedEtiqueta && $selectedRoll)
Rollo #{{ $selectedEtiqueta }}
Clave: {{ $selectedRoll->etiqueta }}
Artículo: {{ $selectedRoll->articulo_id ?: '—' }}
Metros: {{ number_format($selectedRoll->metros, 1) }} m
Partida: {{ $selectedRoll->partida?->codigo ?: ($selectedRoll->partida_id ?: '—') }}
@if (session()->has('form_error'))
⚠️ {{ session('form_error') }}
@endif @if (session()->has('form_success'))
âś… {{ session('form_success') }}
@endif
Historial ({{ $selectedRollProcesses->count() }})
@forelse ($selectedRollProcesses as $rec) @php $def = \App\Models\RollProceso::getProcesoDef($rec->proceso); $icon = $def ? $def['icon'] : '⚙️'; $label = $def ? $def['label'] : $rec->proceso; // show up to 2 params as badges $datos = $rec->datos ?: []; $datosKeys = array_slice(array_keys($datos), 0, 2); @endphp
{{ $icon }}
{{ $label }}
{{ $rec->fecha->format('Y-m-d') }} · {{ $rec->operario ?: '—' }}
@if (!empty($datosKeys))
@foreach ($datosKeys as $dk) @php $campoDef = collect($def['campos'] ?? [])->firstWhere('id', $dk); $dkLabel = $campoDef ? $campoDef['label'] : $dk; @endphp {{ $dkLabel }}: {{ $datos[$dk] }} @endforeach
@endif @if ($rec->nota)
"{{ $rec->nota }}"
@endif
@empty

Sin procesos registrados aĂşn.

@endforelse

@if ($selectedRollFlow->isNotEmpty() && !$editingRecordId) @php $doneIds = $selectedRollProcesses->pluck('proceso')->toArray(); $nextStep = $selectedRollFlow->first(fn($s) => !in_array($s['proceso_id'], $doneIds)); @endphp @if ($nextStep) @php $nextDef = \App\Models\RollProceso::getProcesoDef($nextStep['proceso_id']); @endphp @if ($nextDef)
đź’ˇ Siguiente sugerido: {{ $nextDef['icon'] }} {{ $nextDef['label'] }}
@endif @endif @endif
@if ($editingRecordId) @php $editDef = \App\Models\RollProceso::getProcesoDef($newProcesoId); $editLabel = $editDef ? $editDef['icon'] . ' ' . $editDef['label'] : $newProcesoId; @endphp
✏️ Editando: {{ $editLabel }}
@else
Agregar proceso
@endif
@if ($newProcesoId) @php $currentDef = \App\Models\RollProceso::getProcesoDef($newProcesoId); @endphp @if ($currentDef && !empty($currentDef['campos']))
Parámetros del Proceso
@foreach ($currentDef['campos'] as $c)
@if ($c['type'] === 'select') @elseif ($c['type'] === 'textarea') @else @endif
@endforeach
@endif @endif
@if ($editingRecordId) @else @endif
@endif