@extends('layouts.app') @section('content') @php $suppressedCount = (int) ($rowTotals['suppressed'] ?? 0); $processedRows = (int) $import->processed_rows; $totalRows = (int) $import->total_rows; $progress = $import->processedPercentage(); $canRun = in_array($import->status, ['pending', 'processing', 'failed'], true); @endphp
Detalle operativo

{{ $import->source_name ?: 'Import sin nombre' }}

Esta vista ya permite revisar mapping, progreso y resultados por fila, y también disparar el siguiente lote desde Laravel.

Estado {{ $import->status }}
Tipo {{ $import->import_type }}
Progreso {{ $processedRows }}{{ $totalRows > 0 ? '/' : '' }}{{ $totalRows > 0 ? $totalRows : '' }}
Lista {{ $import->list?->name ?: '-' }}

Resumen del import

Configuración almacenada, resultados acumulados y acceso al procesamiento por tandas.

Volver a imports Nuevo import @if ($import->list) Abrir lista @endif
Creados {{ number_format((int) $import->created_rows) }}
Actualizados {{ number_format((int) $import->updated_rows) }}
Suprimidos {{ number_format($suppressedCount) }}
Saltados {{ number_format((int) $import->skipped_rows) }}

Avance del procesamiento

@if ($import->status === 'completed') Import terminado. @elseif ($import->status === 'failed') El import quedó en error. Puedes reintentar; Laravel continuará desde la fila pendiente. @else Procesa el archivo por tandas y actualiza el progreso sin recargar la pantalla. @endif

{{ $import->status }}
{{ $progress }}% completado @if ($totalRows > 0) {{ number_format($import->remainingRows()) }} filas pendientes @else Total contando en background @endif Última actualización: {{ optional($import->updated_at)->format('Y-m-d H:i:s') ?: '-' }}
@if ($canRun)
@csrf
@endif
Usuario {{ $import->user?->email ?: 'Sin usuario asociado' }}
Stored path {{ $import->stored_path ?: 'Sin archivo persistido' }}
Delimitador y header {{ $import->delimiter_char }} | {{ $import->has_header ? 'Con encabezados' : 'Sin encabezados' }}
@if ($import->import_type === 'suppression')
Alcance y motivo de supresiones {{ $import->suppression_scope ?: 'organization' }} | {{ $import->suppression_reason ?: '-' }}
@endif
@if (!empty($import->mapping_json))

Mapping guardado

@foreach ($import->mapping_json as $column) @continue(($column['target'] ?? '') === 'ignore') {{ $column['header'] ?? ('columna ' . ($column['index'] ?? '?')) }} -> @if (($column['target'] ?? '') === 'custom') {{ \App\Support\ImportSupport::placeholderForKey((string) ($column['field_key'] ?? '')) }} @else {{ \App\Support\ImportSupport::placeholderForKey((string) ($column['target'] ?? 'ignore')) }} @endif @endforeach
@endif

Filas procesadas

Detalle granular de filas ya registradas por el import.

Todos {{ number_format((int) $rowTotals->sum()) }} @foreach (['created', 'updated', 'suppressed', 'skipped'] as $statusOption) {{ $statusOption }} {{ number_format((int) ($rowTotals[$statusOption] ?? 0)) }} @endforeach
@forelse ($rows as $row) @empty @endforelse
Fila Email Estado Mensaje Fecha
#{{ $row->row_index }} {{ $row->email ?: '-' }} {{ $row->status }} {{ $row->message ?: '-' }} {{ optional($row->created_at)->format('Y-m-d H:i:s') }}
No hay filas registradas para este filtro.
{{ $rows->links() }}
@endsection @push('scripts') @endpush