@extends('layouts.app') @section('titulo', 'Dashboard') @section('contenido')
Próximos 7 días
    @forelse($proximos as $o)
  • {{ $o->codigo }}
    {{ optional($o->equipo)->nombre }}
    {{ $o->fecha_programada?->format('d/m') }}
  • @empty
  • Sin órdenes próximas
  • @endforelse
10 pendientes
    @forelse($pendientes_lista as $o)
  • {{ $o->codigo }} {{ optional($o->equipo)->nombre }}
  • @empty
  • Sin pendientes
  • @endforelse
20 últimas
    @forelse($ultimas as $o)
  • {{ $o->codigo }} {{ $o->fecha_cierre?->format('d/m H:i') }}
  • @empty
  • Sin historial
  • @endforelse
@if(count($proximas_pm) > 0)
Próximas PM por horómetro Registrar lectura →
@foreach($proximas_pm as $p) @php $color = $p->restantes <= 0 ? 'danger' : ($p->restantes < $p->pm * 0.05 ? 'warning' : 'info'); @endphp @endforeach
EquipoÁreaPM Horóm. actualÚltima PM ProgresoEstado
{{ $p->equipo->codigo }}
{{ $p->equipo->nombre }}
{{ optional($p->equipo->area)->nombre }} PM {{ $p->pm }}h {{ number_format($p->horometro_actual, 0) }} h {{ number_format($p->base, 0) }} h
{{ number_format($p->porcentaje,0) }}%
{{ $p->restantes > 0 ? 'Faltan '.number_format($p->restantes,0).' h' : 'Excedido '.number_format(-$p->restantes,0).' h' }}
@endif
Reportes
@php $tarjetas = [ ['Total mes', $kpis['total_mes'], '#0d6efd', 'fa-calendar'], ['Pendientes', $kpis['pendientes'], '#6c757d', 'fa-hourglass-half'], ['En proceso', $kpis['en_proceso'], '#0dcaf0', 'fa-spinner'], ['Ejecutadas', $kpis['ejecutadas'], '#198754', 'fa-circle-check'], ['Vencidas', $kpis['vencidas'], '#dc3545', 'fa-triangle-exclamation'], ['Reprogramadas', $kpis['reprogramadas'], '#ffc107', 'fa-rotate-right'], ['Aprobadas', $kpis['aprobadas'], '#20c997', 'fa-check-double'], ['Críticas', $kpis['criticas'], '#dc3545', 'fa-bolt'], ['Cumplimiento %', $kpis['cumplimiento'].'%', '#0d6efd', 'fa-bullseye'], ['Costo mes ('.($appConfig['moneda_simbolo'] ?? 'S/').')', number_format($kpis['costo_mes'],2), '#6f42c1', 'fa-dollar-sign'], ['Planes activos', $kpis['planes_activos'], '#198754', 'fa-list'], ['Equipos activos', $kpis['equipos_activos'], '#0d6efd', 'fa-gear'], ]; @endphp @foreach($tarjetas as [$titulo, $valor, $color, $icono])
{{ $titulo }}
{{ $valor }}
@endforeach
Órdenes por estado
Órdenes por área
Preventivo vs correctivo
Órdenes diarias del mes
Costo por área
Top 10 responsables
Por prioridad
Top 10 equipos
Tendencia 12 meses (cantidad)
Costo mensual 12 meses
@push('scripts_inline') const _g1 = @json($g_estados); const _g2 = @json($g_areas); const _g3 = @json($g_clase); const _g4 = @json($g_diaria); const _g5 = @json($g_costo_area); const _g6 = @json($g_responsables); const _g7 = @json($g_prioridad); const _g8 = @json($g_equipos); const _g9 = @json($g_mensual); const _g10 = _g9; function chart(id, type, labels, data, colors=null, label='Total') { const el = document.getElementById(id); if (!el) return; const palette = ['#1565C0','#0D47A1','#FFC107','#198754','#dc3545','#6f42c1','#0dcaf0','#fd7e14','#20c997','#6c757d']; return new Chart(el, { type, data: { labels, datasets: [{ label, data, backgroundColor: colors || palette, borderColor: type==='line'?'#1565C0':undefined, borderWidth: type==='line'?2:0, tension: 0.25, fill: type==='line' }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: ['doughnut','pie'].includes(type), position: 'bottom', labels: { boxWidth: 10, font: { size: 10 } } } }, scales: ['doughnut','pie'].includes(type) ? {} : { x: { ticks: { font: { size: 9 }, maxRotation: 45, minRotation: 0 } }, y: { ticks: { font: { size: 9 } }, beginAtZero: true } } } }); } chart('g1','doughnut', _g1.map(x=>x.nombre||'—'), _g1.map(x=>+x.total), _g1.map(x=>x.color||'#999')); chart('g2','bar', _g2.map(x=>x.nombre||'—'), _g2.map(x=>+x.total)); chart('g3','pie', _g3.map(x=>x.clase), _g3.map(x=>+x.total), ['#0d6efd','#dc3545']); chart('g4','line', _g4.map(x=>x.dia), _g4.map(x=>+x.total)); chart('g5','bar', _g5.map(x=>x.nombre), _g5.map(x=>+x.costo)); chart('g6','bar', _g6.map(x=>x.nombre), _g6.map(x=>+x.total)); chart('g7','doughnut', _g7.map(x=>x.nombre||'—'), _g7.map(x=>+x.total), _g7.map(x=>x.color||'#999')); chart('g8','bar', _g8.map(x=>x.nombre), _g8.map(x=>+x.total)); chart('g9','line', _g9.map(x=>x.mes), _g9.map(x=>+x.total)); chart('g10','line', _g10.map(x=>x.mes), _g10.map(x=>+x.costo)); @endpush @endsection