@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