@extends('layouts.app') @section('title', 'Histórico de OS & Importação') @section('page_title', 'Histórico de OS') @section('content') @php $auditLabels = [ 'sem_os' => 'OS não informada', 'sem_cliente' => 'Cliente não informado', 'cliente_nao_vinculado' => 'Cliente sem vínculo cadastral', 'sem_origem' => 'Origem não informada', 'origem_nao_vinculada' => 'Origem sem vínculo cadastral', 'sem_destino' => 'Destino não informado', 'destino_nao_vinculado' => 'Destino sem vínculo cadastral', 'sem_motorista' => 'Motorista não informado', 'motorista_nao_vinculado' => 'Motorista sem vínculo cadastral', 'sem_cavalo' => 'Cavalo não informado', 'cavalo_nao_vinculado' => 'Cavalo sem vínculo cadastral', 'sem_carreta' => 'Carreta não informada', 'carreta_nao_vinculada' => 'Carreta sem vínculo cadastral', ]; $activeAudit = request('auditoria'); $hasFilters = collect(request()->except(['page', 'sort', 'direction', 'per_page'])) ->filter(fn($v) => $v !== null && $v !== '') ->isNotEmpty(); $sortUrl = function (string $column) use ($sort, $dir) { $newDir = $sort === $column && $dir === 'asc' ? 'desc' : 'asc'; return route('admin.historico.index', array_merge(request()->except('page'), [ 'sort' => $column, 'direction' => $newDir, ])); }; $sortMark = fn(string $column) => $sort === $column ? ($dir === 'asc' ? '↑' : '↓') : ''; @endphp
storage/logs/laravel.log.Total no histórico
{{ number_format($total, 0, ',', '.') }}
Importados (XLSX)
{{ number_format($importados, 0, ',', '.') }}
Gerados pelo sistema
{{ number_format($sistema, 0, ',', '.') }}
Indicadores calculados sobre os registros atualmente filtrados.
Registros analisados
{{ number_format($qualidade['total'], 0, ',', '.') }}
{{ $card['label'] }}
{{ $card['data']['percentual_preenchimento'] ?? $card['data']['percentual'] }}%{{ number_format($card['data']['informados'], 0, ',', '.') }} preenchidos de {{ number_format($qualidade['total'], 0, ',', '.') }}
@if($card['type'] === 'link'){{ number_format($card['data']['vinculados'], 0, ',', '.') }} vinculados ao cadastro · {{ $card['data']['percentual_vinculo'] }}%
@else{{ number_format($card['data']['sem_info'], 0, ',', '.') }} sem informação
@endifRota completa
{{ $rotaInformadaPct }}%{{ number_format($qualidade['rota']['informados'], 0, ',', '.') }} com origem + destino
{{ number_format($qualidade['rota']['vinculados'], 0, ',', '.') }} rotas totalmente vinculadas · {{ $rotaVinculoPct }}%
Use os filtros para conferir grupos específicos de registros importados.
Exibindo {{ number_format($registros->firstItem() ?? 0, 0, ',', '.') }}–{{ number_format($registros->lastItem() ?? 0, 0, ',', '.') }} de {{ number_format($registros->total(), 0, ',', '.') }} registros encontrados.
| {{ $label }} {{ $sortMark($col) }} | @endforeachDetalhe | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $h->data_servico?->format('d/m/Y') ?? '—' }} | {{ $h->hora_coleta ?: '—' }} | {{ $h->numero_os ?: '—' }} | {{ $h->cliente_nome ?: '—' }} @if($h->cliente_nome){{ $h->cliente_id ? '✓ vinculado' : '• sem vínculo' }}@endif |
{{ $h->origem_texto ?: '—' }} @if($h->origem_texto){{ $h->origem_id ? '✓ vinculada' : '• sem vínculo' }}@endif |
{{ $h->destino_texto ?: '—' }} @if($h->destino_texto){{ $h->destino_id ? '✓ vinculado' : '• sem vínculo' }}@endif |
{{ $h->tipo_veiculo_solicitado ?: '—' }} | {{ $h->cavalo_placa ?: '—' }} @if($h->cavalo_placa){{ $h->veiculo_id ? '✓ vinculado' : '• sem vínculo' }}@endif |
{{ $h->carreta_placa ?: '—' }} @if($h->carreta_placa){{ $h->carreta_id ? '✓ vinculada' : '• sem vínculo' }}@endif |
{{ $h->motorista_nome ?: '—' }} @if($h->motorista_nome){{ $h->motorista_id ? '✓ vinculado' : '• sem vínculo' }}@endif |
{{ $h->status ?: '—' }} | {{ $h->fonte === 'importacao' ? 'XLSX' : 'Sistema' }} | @php $temPendenciaVinculo = ($h->cliente_nome && !$h->cliente_id) || ($h->origem_texto && !$h->origem_id) || ($h->destino_texto && !$h->destino_id) || ($h->motorista_nome && !$h->motorista_id) || ($h->cavalo_placa && !$h->veiculo_id) || ($h->carreta_placa && !$h->carreta_id); @endphp {{ $temPendenciaVinculo ? 'Vincular' : 'Ver' }} |
| Nenhum registro encontrado com os filtros selecionados. | ||||||||||||