230 lines
18 KiB
PHP
Executable File
230 lines
18 KiB
PHP
Executable File
<x-filament-panels::page>
|
|
<div class="space-y-4">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
<div>
|
|
<div class="text-lg font-semibold">Lavorazioni operative fornitore</div>
|
|
<div class="text-sm text-gray-600">
|
|
@if($this->fornitoreLabel)
|
|
Elenco unico operativo per {{ $this->fornitoreLabel }}.
|
|
@else
|
|
Seleziona un fornitore dalla gestione ticket per aprire questa vista.
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2">
|
|
<a href="{{ $this->getTicketsUrl() }}" class="inline-flex items-center rounded-md bg-gray-800 px-3 py-1.5 text-xs font-medium text-white hover:bg-gray-700">Ticket operativi</a>
|
|
<a href="{{ $this->getCollaboratoriUrl() }}" class="inline-flex items-center rounded-md bg-white px-3 py-1.5 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50">Collaboratori</a>
|
|
<a href="{{ $this->getRubricaUrl() }}" class="inline-flex items-center rounded-md bg-white px-3 py-1.5 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50">Rubrica clienti</a>
|
|
<a href="{{ $this->getImpostazioniUrl() }}" class="inline-flex items-center rounded-md bg-white px-3 py-1.5 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50">Impostazioni</a>
|
|
<a href="{{ $this->getProdottiUrl() }}" class="inline-flex items-center rounded-md bg-white px-3 py-1.5 text-xs font-medium text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50">Prodotti</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if($this->missingAdminContext)
|
|
<div class="rounded-xl border border-amber-300 bg-amber-50 p-4 text-sm text-amber-800">
|
|
Questa vista per amministratori richiede un fornitore selezionato.
|
|
</div>
|
|
@else
|
|
<div class="rounded-xl border border-sky-200 bg-sky-50 p-4 text-sm text-sky-900">
|
|
Prima base rilasciata: questa pagina unifica gia le lavorazioni arrivate dai ticket amministratore.
|
|
Le lavorazioni interne e i lavori ricorrenti verranno agganciati qui nello stesso elenco operativo.
|
|
</div>
|
|
|
|
<div class="grid gap-4 md:grid-cols-4">
|
|
<button type="button" wire:click="setScope('tutte')" class="rounded-xl border p-4 text-left {{ $scope === 'tutte' ? 'border-primary-500 bg-primary-50' : 'bg-white' }}">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Tutte</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $totals['tutte'] }}</div>
|
|
<div class="mt-2 text-sm text-gray-600">Vista unica di tutte le lavorazioni disponibili.</div>
|
|
</button>
|
|
<button type="button" wire:click="setScope('aperte')" class="rounded-xl border p-4 text-left {{ $scope === 'aperte' ? 'border-primary-500 bg-primary-50' : 'bg-white' }}">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Aperte</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $totals['aperte'] }}</div>
|
|
<div class="mt-2 text-sm text-gray-600">Schede in ingresso, lavorazione o verifica.</div>
|
|
</button>
|
|
<button type="button" wire:click="setScope('chiuse')" class="rounded-xl border p-4 text-left {{ $scope === 'chiuse' ? 'border-primary-500 bg-primary-50' : 'bg-white' }}">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Chiuse</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $totals['chiuse'] }}</div>
|
|
<div class="mt-2 text-sm text-gray-600">Riparate, riconsegnate o chiuse contabilmente.</div>
|
|
</button>
|
|
<button type="button" wire:click="setScope('ticket_amministratore')" class="rounded-xl border p-4 text-left {{ $scope === 'ticket_amministratore' ? 'border-primary-500 bg-primary-50' : 'bg-white' }}">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Da ticket</div>
|
|
<div class="mt-1 text-2xl font-semibold">{{ $totals['ticket_amministratore'] }}</div>
|
|
<div class="mt-2 text-sm text-gray-600">Solo interventi transitati dal reparto amministratore.</div>
|
|
</button>
|
|
</div>
|
|
|
|
@if($scope === 'interne')
|
|
<div class="rounded-xl border border-dashed bg-white p-6 text-sm text-gray-600">
|
|
Nessuna lavorazione interna ancora modellata nel database corrente.
|
|
Il prossimo step e aggiungere qui inserimento, elenco e storico delle lavorazioni non nate da ticket amministratore.
|
|
</div>
|
|
@else
|
|
<div class="rounded-xl border bg-white p-0">
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 text-sm">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Num.</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Ingresso</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Cliente</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Tel</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Problema</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Marca</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Modello</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Seriale</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Cod. prod</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Origine</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Operatore</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Stato</th>
|
|
<th class="px-4 py-3 text-left font-medium text-gray-600">Aggiornato</th>
|
|
<th class="px-4 py-3"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100 bg-white">
|
|
@forelse($rows as $row)
|
|
<tr class="{{ $row['row_class'] ?? '' }}">
|
|
<td class="px-4 py-3 align-top">
|
|
<div class="font-medium">{{ $row['numero'] ?? ($row['ticket_id'] ? ('#' . $row['ticket_id']) : '-') }}</div>
|
|
<div class="text-[11px] text-gray-500">{{ $row['row_type'] === 'tecnorepair' ? 'TR' : 'TK' }}</div>
|
|
</td>
|
|
<td class="px-4 py-3 align-top">
|
|
<div class="font-medium">{{ $row['ingresso'] }}</div>
|
|
<div class="text-xs text-gray-500">{{ $row['stabile'] }}</div>
|
|
</td>
|
|
<td class="px-4 py-3 align-top">
|
|
<div>{{ $row['cliente'] ?? $row['contatto'] }}</div>
|
|
</td>
|
|
<td class="px-4 py-3 align-top text-gray-700">{{ $row['telefono'] !== '' ? $row['telefono'] : '-' }}</td>
|
|
<td class="px-4 py-3 align-top">
|
|
<div>{{ $row['difetto'] ?? $row['problema'] }}</div>
|
|
<div class="text-xs text-gray-500">{{ $row['titolo'] }}</div>
|
|
</td>
|
|
<td class="px-4 py-3 align-top text-gray-700">{{ $row['brand'] ?? '-' }}</td>
|
|
<td class="px-4 py-3 align-top text-gray-700">{{ $row['modello'] ?? $row['apparato'] }}</td>
|
|
<td class="px-4 py-3 align-top text-gray-700">{{ $row['seriale'] ?? '-' }}</td>
|
|
<td class="px-4 py-3 align-top text-gray-700">{{ $row['cod_prodotto'] ?? '-' }}</td>
|
|
<td class="px-4 py-3 align-top">
|
|
<span class="inline-flex rounded-full px-2 py-1 text-xs font-medium {{ $row['badge_class'] ?? 'bg-sky-100 text-sky-700' }}">{{ $row['origine'] }}</span>
|
|
</td>
|
|
<td class="px-4 py-3 align-top">{{ $row['operatore'] }}</td>
|
|
<td class="px-4 py-3 align-top">
|
|
<span class="inline-flex rounded-full px-2 py-1 text-xs font-medium {{ $row['badge_class'] ?? 'bg-gray-100 text-gray-700' }}">{{ $row['stato'] }}</span>
|
|
</td>
|
|
<td class="px-4 py-3 align-top text-gray-600">{{ $row['updated_at'] }}</td>
|
|
<td class="px-4 py-3 text-right align-top">
|
|
<div class="flex justify-end gap-2">
|
|
<button type="button" wire:click="openRowDetail('{{ $row['row_type'] ?? 'ticket' }}', {{ (int) $row['id'] }})" class="inline-flex items-center rounded-md bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-200">Dettaglio</button>
|
|
@if($row['url'])
|
|
<a href="{{ $row['url'] }}" class="inline-flex items-center rounded-md bg-primary-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-primary-500">Apri scheda</a>
|
|
@endif
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="14" class="px-4 py-10 text-center text-sm text-gray-500">Nessuna lavorazione disponibile per questo filtro.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
@if($detailModal)
|
|
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4">
|
|
<div class="max-h-[92vh] w-full max-w-4xl overflow-hidden rounded-xl bg-white shadow-2xl">
|
|
<div class="flex items-start justify-between gap-4 border-b px-4 py-3">
|
|
<div>
|
|
<div class="text-sm font-semibold">{{ $detailModal['title'] }}</div>
|
|
<div class="text-xs text-gray-500">Stato {{ $detailModal['status'] }} · aggiornato {{ $detailModal['updated_at'] }}</div>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
@if(($detailModal['url'] ?? '') !== '')
|
|
<a href="{{ $detailModal['url'] }}" class="rounded-md bg-slate-100 px-2 py-1 text-xs hover:bg-slate-200">Apri scheda completa</a>
|
|
@endif
|
|
<button type="button" wire:click="closeDetailModal" class="rounded-md bg-gray-100 px-2 py-1 text-xs hover:bg-gray-200">Chiudi</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="max-h-[calc(92vh-64px)] overflow-auto p-4">
|
|
<div class="grid gap-4 xl:grid-cols-3">
|
|
<div class="space-y-4 xl:col-span-2">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="grid gap-3 text-sm md:grid-cols-2">
|
|
<div>
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Cliente</div>
|
|
<div class="mt-1">{{ $detailModal['customer'] !== '' ? $detailModal['customer'] : '-' }}</div>
|
|
</div>
|
|
<div>
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Telefono</div>
|
|
<div class="mt-1">{{ $detailModal['phone'] !== '' ? $detailModal['phone'] : '-' }}</div>
|
|
</div>
|
|
<div>
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Email</div>
|
|
<div class="mt-1">{{ $detailModal['email'] !== '' ? $detailModal['email'] : '-' }}</div>
|
|
</div>
|
|
<div>
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Operatore</div>
|
|
<div class="mt-1">{{ $detailModal['operator'] !== '' ? $detailModal['operator'] : '-' }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-sm font-semibold">Campi lavorazione</div>
|
|
<div class="mt-4 grid gap-3 md:grid-cols-3">
|
|
<div class="rounded-lg bg-gray-50 p-3 text-sm">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">DifettoSegnalato</div>
|
|
<div class="mt-1 whitespace-pre-wrap text-gray-800">{{ $detailModal['difetto_segnalato'] !== '' ? $detailModal['difetto_segnalato'] : '-' }}</div>
|
|
</div>
|
|
<div class="rounded-lg bg-gray-50 p-3 text-sm">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">NoteInterne</div>
|
|
<div class="mt-1 whitespace-pre-wrap text-gray-800">{{ $detailModal['note_interne'] !== '' ? $detailModal['note_interne'] : '-' }}</div>
|
|
</div>
|
|
<div class="rounded-lg bg-gray-50 p-3 text-sm">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">NoteStampa</div>
|
|
<div class="mt-1 whitespace-pre-wrap text-gray-800">{{ $detailModal['note_stampa'] !== '' ? $detailModal['note_stampa'] : '-' }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(($detailModal['communications'] ?? '') !== '' || ($detailModal['repair_description'] ?? '') !== '')
|
|
<div class="mt-4 grid gap-3 md:grid-cols-2">
|
|
<div class="rounded-lg border p-3 text-sm">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Comunicazioni</div>
|
|
<div class="mt-1 whitespace-pre-wrap text-gray-800">{{ $detailModal['communications'] !== '' ? $detailModal['communications'] : '-' }}</div>
|
|
</div>
|
|
<div class="rounded-lg border p-3 text-sm">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">Descrizione riparazione</div>
|
|
<div class="mt-1 whitespace-pre-wrap text-gray-800">{{ $detailModal['repair_description'] !== '' ? $detailModal['repair_description'] : '-' }}</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-4">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="text-sm font-semibold">Campi base TApparecchi</div>
|
|
<div class="mt-3 space-y-2 text-sm">
|
|
@forelse($detailModal['apparecchio_fields'] as $label => $value)
|
|
<div class="rounded-lg bg-gray-50 p-3">
|
|
<div class="text-xs uppercase tracking-wide text-gray-500">{{ $label }}</div>
|
|
<div class="mt-1 break-words text-gray-800">{{ $value !== '' ? $value : '-' }}</div>
|
|
</div>
|
|
@empty
|
|
<div class="text-sm text-gray-500">Nessun campo apparecchio disponibile.</div>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</x-filament-panels::page> |