{{-- ── LEFT: Plans list ─────────────────────────────────── --}}
Planes de Mantenimiento Preventivo
@foreach(['' => 'Todos', 'overdue' => '🔴 Vencidos', 'due_soon' => '🟡 Próximos', 'ok' => '🟢 OK'] as $val => $lbl) @endforeach
@forelse($plans as $plan) @empty @endforelse
Equipo Plan Tipo Frecuencia Último PM Próximo Días Estado
{{ $plan->equipment->name ?? '—' }} {{ $plan->type }} c/{{ $plan->frequency_value }} {{ $frequencies[$plan->frequency_type]['label'] ?? $plan->frequency_type }} {{ $plan->last_performed?->format('d/m/Y') ?? '—' }} {{ $plan->next_due?->format('d/m/Y') ?? '—' }} {{ $plan->days_until_due !== null ? ($plan->days_until_due < 0 ? abs($plan->days_until_due).'d venc.' : $plan->days_until_due.'d') : '—' }} @if(!$plan->active) Inactivo @elseif($plan->is_overdue) Vencido @elseif($plan->days_until_due !== null && $plan->days_until_due <= 7) Próximo @else OK @endif
Sin planes de mantenimiento.
{{-- ── RIGHT: Plan detail (parts + checklist) ──────────── --}} @if($openPlan)
{{ $openPlan->name }}
{{-- Repuestos --}}
Repuestos
@if($showPartAdd)
@error('addPartId') {{ $message }} @enderror
@error('addPartQty') {{ $message }} @enderror
@endif @if($openPlan->spareParts->isEmpty())

Sin repuestos.

@else @foreach($openPlan->spareParts as $sp) @endforeach
Repuesto Cant.
{{ $sp->name }} {{ $sp->pivot->quantity }} {{ $sp->unit }}
@endif
{{-- Checklist --}} @if($openPlan->checklist)
Checklist
    @foreach($openPlan->checklist as $item)
  • ☐ {{ $item['task'] }}
  • @endforeach
@endif {{-- Details --}}
Hrs estimadas
{{ $openPlan->estimated_hours }}h
Costo est.
${{ number_format($openPlan->estimated_cost,2) }}
@endif
{{-- ── Plan form modal ──────────────────────────────────── --}} @if($showForm) @endif