{{-- ── Stats ─────────────────────────────────────────────────── --}}
⚡
En proceso
{{ $stats['in_progress'] }}
📋
Planificados
{{ $stats['planned'] }}
✅
Completados hoy
{{ $stats['done_today'] }}
⚠️
Con desviación
{{ $stats['deviations'] }}
{{-- ── New execution form ────────────────────────────────────── --}} @if($showForm)
Registrar proceso
@error('form.process_type') {{ $message }} @enderror
@error('form.batch_id') {{ $message }} @enderror
{{-- Parameters --}} @if(count($paramDefs) > 0)
Parámetros del proceso
@foreach($paramDefs as $key => $def)
@if(isset($def['type']) && $def['type'] === 'select') @else @endif @error("paramValues.{$key}") {{ $message }} @enderror
@endforeach
@endif {{-- Deviation --}}
@if($deviationFlag)
⚠️ Descripción de la desviación
@error('devReason') {{ $message }} @enderror
@endif
@endif {{-- ── Filters ──────────────────────────────────────────────── --}}
@if($filterType || $filterStatus !== 'active' || $search) @endif
{{-- ── Main grid: list + detail panel ────────────────────────── --}}
{{-- Execution list --}}
@if($executions->isEmpty())
📋
No hay ejecuciones con estos filtros
Usa el botón «+ Nuevo proceso» para registrar una.
@else
@foreach($executions as $ex) @php $statusClass = strtolower(str_replace('_', '-', $ex->status)); $badgeClass = 'eb-' . strtolower(str_replace('_', '-', $ex->status)); $statusLabel = match($ex->status) { 'IN_PROGRESS' => 'En proceso', 'PLANNED' => 'Planificado', 'DONE' => 'Completado', 'FAILED' => 'Fallido', 'CANCELLED' => 'Cancelado', default => $ex->status, }; $typeLabel = \App\Models\ProcessExecution::PROCESS_TYPES[$ex->process_type] ?? $ex->process_type; $elapsed = $ex->started_at ? $ex->started_at->diffForHumans() : '—'; $duration = ($ex->started_at && $ex->ended_at) ? round($ex->started_at->diffInMinutes($ex->ended_at)) . ' min' : null; @endphp
{{ $typeLabel }}
@if($ex->deviation_flag) ⚠️ DEV @endif {{ $statusLabel }}
@if($ex->batch)
Batch {{ $ex->batch->batch_number }} @if($ex->batch->dyeColor) · {{ $ex->batch->dyeColor->code }} @endif @if($ex->batch->articulo_id) · {{ $ex->batch->articulo_id }} @endif
@else
Sin batch asignado
@endif
@if($ex->started_at) Inicio: {{ $ex->started_at->format('d/m H:i') }} ({{ $elapsed }}) @if($duration) · {{ $duration }} @endif @else Sin iniciar @endif
@if($ex->notes)
{{ Str::limit($ex->notes, 60) }}
@endif {{-- Inline actions for active processes --}} @if(in_array($ex->status, ['PLANNED', 'IN_PROGRESS']))
@if($ex->status === 'IN_PROGRESS') @endif
@endif {{-- Deviation note form --}} @if($showDevForm && $openId === $ex->id)
⚠️ Registrar desviación
@error('devNote')
{{ $message }}
@enderror
@endif
@endforeach
{{ $executions->links() }}
@endif
{{-- Detail panel --}}
@if($openExecution)
{{ \App\Models\ProcessExecution::PROCESS_TYPES[$openExecution->process_type] ?? $openExecution->process_type }} #{{ $openExecution->id }}
{{-- Status --}}
Estado
@php $sLabel = match($openExecution->status) { 'IN_PROGRESS' => 'En proceso', 'PLANNED' => 'Planificado', 'DONE' => 'Completado', 'FAILED' => 'Fallido', 'CANCELLED' => 'Cancelado', default => $openExecution->status, }; $sBg = match($openExecution->status) { 'IN_PROGRESS' => '#fffbeb', 'PLANNED' => '#eff6ff', 'DONE' => '#f0fdf4', 'FAILED' => '#fef2f2', default => '#f1f5f9', }; $sColor = match($openExecution->status) { 'IN_PROGRESS' => '#92400e', 'PLANNED' => '#1e40af', 'DONE' => '#166534', 'FAILED' => '#991b1b', default => '#475569', }; @endphp {{ $sLabel }} @if($openExecution->deviation_flag) ⚠️ Desviación registrada @endif
{{-- Timing --}}
Tiempos
Inicio {{ $openExecution->started_at?->format('d/m/Y H:i') ?? '—' }}
Fin {{ $openExecution->ended_at?->format('d/m/Y H:i') ?? '—' }}
@if($openExecution->started_at && $openExecution->ended_at)
Duración {{ round($openExecution->started_at->diffInMinutes($openExecution->ended_at)) }} min
@elseif($openExecution->started_at)
Transcurrido {{ $openExecution->started_at->diffForHumans() }}
@endif
{{-- Batch --}} @if($openExecution->batch)
Batch
Número {{ $openExecution->batch->batch_number }}
Estado {{ $openExecution->batch->status }}
@if($openExecution->batch->dyeColor)
Color {{ $openExecution->batch->dyeColor->code }}
@endif @if($openExecution->batch->articulo_id)
Artículo {{ $openExecution->batch->articulo_id }}
@endif
@endif {{-- Parameters --}} @if($openExecution->details->count() > 0)
Parámetros registrados
@foreach($openExecution->details as $detail)
{{ $detail->field_key }} {{ $detail->getValue() }}
@endforeach
@endif {{-- Deviation --}} @if($openExecution->deviation_flag && $openExecution->deviation_reason)
Desviación

{{ $openExecution->deviation_reason }}

@endif {{-- Notes --}} @if($openExecution->notes)
Notas

{{ $openExecution->notes }}

@endif {{-- Actions --}} @if(in_array($openExecution->status, ['PLANNED', 'IN_PROGRESS']))
@endif @else
👆
Selecciona una ejecución de la lista para ver su detalle
@endif