{{-- Roll list ── --}}
{{ $rolls->total() }}
Total
{{ $rolls->where('status','IN_PROCESS')->count() }}
En proceso
{{ $rolls->where('status','WAREHOUSE')->count() }}
Bodega
@forelse($rolls as $roll) @empty @endforelse
CódigoArtículoMetrosKgEstado
{{ $roll->display_code }} @if($roll->parent_roll_id)
← {{ $roll->parent?->display_code }}
@endif
{{ $roll->article_id ?: '—' }} {{ $roll->current_length_m ? number_format($roll->current_length_m,1) : '—' }} {{ $roll->current_weight_kg ? number_format($roll->current_weight_kg,2) : '—' }} {{ $roll->status_label }}
Sin rollos. Crea el primero.
{{ $rolls->links() }}
{{-- Roll detail ── --}} @if($selectedRoll)
{{-- Header --}}
{{ $selectedRoll->display_code }}
{{ $selectedRoll->article_id ?: '—' }} @if($selectedRoll->parent) · ← {{ $selectedRoll->parent->display_code }}@endif @if($selectedRoll->rework_generation_warning) {{ $selectedRoll->rework_generation_warning }} @endif
{{ $selectedRoll->status_label }} @if($selectedRoll->current_length_m){{ number_format($selectedRoll->current_length_m,1) }} m@endif @if($selectedRoll->current_weight_kg){{ number_format($selectedRoll->current_weight_kg,2) }} kg@endif
@if(!$selectedRoll->isTerminal()) @endif
{{-- Tabs --}}
@foreach(['history'=>'📋 Historial','lineage'=>'🌳 Genealogía'] as $tab=>$lbl) @endforeach
{{-- History tab --}} @if($activeTab === 'history')
@forelse($history as $exec) @php $dotClass = match($exec->status) { 'DONE' => $exec->process_type === 'SPLIT' ? 'split' : ($exec->process_type === 'MERGE' ? 'merge' : ($exec->process_type === 'SCRAP' ? 'scrap' : 'done')), 'FAILED' => 'failed', default => '' }; @endphp
{{ ProcessExecution::PROCESS_TYPES[$exec->process_type] ?? $exec->process_type }} {{ $exec->started_at?->format('d/m/Y H:i') ?? '—' }}
{{ $exec->status }} @if($exec->deviation_flag)⚠ Desviación@endif @if($exec->waste_length_m)Desperdicio: {{ $exec->waste_length_m }}m@endif @if($exec->shrinkage_pct)Encogimiento: {{ $exec->shrinkage_pct }}%@endif
@if($exec->deviation_reason)
{{ $exec->deviation_reason }}
@endif
@empty

Sin historial de procesos.

@endforelse
{{-- Lineage tab --}} @elseif($activeTab === 'lineage') @php $ancestors = $selectedRoll->ancestors(); $descendants = $selectedRoll->descendants(); @endphp @if($ancestors->isNotEmpty())
Ancestros
@foreach($ancestors as $r)
{{ $r->display_code }} {{ $r->status_label }} profundidad: {{ $r->depth }} @if($r->current_length_m){{ number_format($r->current_length_m,1) }}m@endif
@endforeach @endif @if($descendants->isNotEmpty())
Descendientes
@foreach($descendants as $r)
{{ $r->display_code }} {{ $r->status_label }} @if($r->current_length_m){{ number_format($r->current_length_m,1) }}m@endif
@endforeach @endif @if($ancestors->isEmpty() && $descendants->isEmpty())

Sin ancestros ni descendientes. Este es un rollo original.

@endif @endif
@endif
{{-- ── Create Roll Modal ── --}} @if($showCreateModal) @endif {{-- ── Split Modal ── --}} @if($showSplitModal && $selectedRoll) @endif {{-- ── Merge Modal ── --}} @if($showMergeModal) @endif {{-- ── Process Modal ── --}} @if($showProcessModal) @endif {{-- ── Scrap Modal ── --}} @if($showScrapModal) @endif