netgescon-day0/resources/views/filament/pages/fornitore/lavorazioni-operative.blade.php

112 lines
8.3 KiB
PHP

<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->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-3">
<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('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 amministratore</div>
<div class="mt-1 text-2xl font-semibold">{{ $totals['ticket_amministratore'] }}</div>
<div class="mt-2 text-sm text-gray-600">Interventi gia transitati dalla gestione ticket.</div>
</button>
<button type="button" wire:click="setScope('interne')" class="rounded-xl border p-4 text-left {{ $scope === 'interne' ? 'border-primary-500 bg-primary-50' : 'bg-white' }}">
<div class="text-xs uppercase tracking-wide text-gray-500">Interne</div>
<div class="mt-1 text-2xl font-semibold">{{ $totals['interne'] }}</div>
<div class="mt-2 text-sm text-gray-600">Spazio riservato alle lavorazioni interne del manutentore.</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">Origine</th>
<th class="px-4 py-3 text-left font-medium text-gray-600">Ticket</th>
<th class="px-4 py-3 text-left font-medium text-gray-600">Contatto</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">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>
<td class="px-4 py-3 align-top">
<span class="inline-flex rounded-full bg-sky-100 px-2 py-1 text-xs font-medium text-sky-700">{{ $row['origine'] }}</span>
</td>
<td class="px-4 py-3 align-top">
<div class="font-medium">#{{ $row['ticket_id'] }} - {{ $row['titolo'] }}</div>
<div class="text-xs text-gray-500">{{ $row['stabile'] }} · ingresso {{ $row['ingresso'] }}</div>
</td>
<td class="px-4 py-3 align-top">
<div>{{ $row['contatto'] }}</div>
<div class="text-xs text-gray-500">{{ $row['telefono'] !== '' ? $row['telefono'] : 'Telefono non disponibile' }}</div>
</td>
<td class="px-4 py-3 align-top">
<div>{{ $row['problema'] }}</div>
<div class="text-xs text-gray-500">Apparato: {{ $row['apparato'] }}</div>
</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 bg-gray-100 px-2 py-1 text-xs font-medium 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">
<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>
</td>
</tr>
@empty
<tr>
<td colspan="8" 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>
</x-filament-panels::page>