netgescon-day0/resources/views/filament/pages/supporto/ticket-mobile.blade.php

165 lines
11 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 gap-2">
<a href="{{ $this->getDashboardFilamentUrl() }}" class="inline-flex items-center rounded-md bg-gray-900 px-3 py-1.5 text-xs font-medium text-white hover:bg-gray-700">Dashboard Filament</a>
<a href="{{ $this->getRubricaFilamentUrl() }}" 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">Rubrica Unica Filament</a>
<a href="{{ $this->getTicketArchivioUrl() }}" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-500">Archivio Ticket Completo</a>
</div>
<div class="mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4">
<div class="rounded-lg border bg-gray-50 px-3 py-2 text-xs">Aperti: <span class="font-semibold">{{ $ticketCounters['open'] ?? 0 }}</span></div>
<div class="rounded-lg border bg-gray-50 px-3 py-2 text-xs">Urgenti: <span class="font-semibold">{{ $ticketCounters['urgent'] ?? 0 }}</span></div>
<div class="rounded-lg border bg-gray-50 px-3 py-2 text-xs">Chiusi: <span class="font-semibold">{{ $ticketCounters['closed'] ?? 0 }}</span></div>
<div class="rounded-lg border bg-gray-50 px-3 py-2 text-xs">Totali: <span class="font-semibold">{{ $ticketCounters['all'] ?? 0 }}</span></div>
</div>
</div>
<div class="rounded-xl border bg-white p-4">
<div class="text-sm font-semibold">Workflow Ticket Chiaro</div>
<div class="mt-1 text-xs text-gray-500">Percorso operativo consigliato per evitare passaggi persi.</div>
<div class="mt-3 grid gap-3 md:grid-cols-3">
<div class="rounded-lg border border-emerald-200 bg-emerald-50 p-3">
<div class="text-xs font-semibold text-emerald-900">1) Apertura rapida</div>
<div class="mt-1 text-xs text-emerald-800">Seleziona chiamante, compila titolo e descrizione, poi crea il ticket.</div>
</div>
<div class="rounded-lg border border-amber-200 bg-amber-50 p-3">
<div class="text-xs font-semibold text-amber-900">2) Assegnazione e intervento</div>
<div class="mt-1 text-xs text-amber-800">Apri l'archivio ticket, assegna fornitore e registra gli interventi.</div>
</div>
<div class="rounded-lg border border-slate-200 bg-slate-50 p-3">
<div class="text-xs font-semibold text-slate-900">3) Verifica e chiusura</div>
<div class="mt-1 text-xs text-slate-700">Verifica esito/fattura, segna risolto e chiudi definitivamente.</div>
</div>
</div>
<div class="mt-3">
<a href="{{ \App\Filament\Pages\Supporto\TicketGestione::getUrl(panel: 'admin-filament') }}" class="inline-flex items-center rounded-md bg-indigo-700 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-600">Apri blade dedicata Gestione Ticket</a>
</div>
</div>
<div class="rounded-xl border bg-white p-4">
<div class="text-sm font-semibold">Ricerca chiamante</div>
<div class="mt-2 text-xs text-gray-500">Ricerca per telefono, nome, cognome, ragione sociale o email e seleziona il contatto con un click.</div>
<input type="text" wire:model.live.debounce.300ms="callerSearch" placeholder="Es. +39 333 1234567 oppure Mario Rossi" class="mt-3 w-full rounded-lg border-gray-300 text-sm" />
@if($selectedCallerId)
<div class="mt-2 text-xs text-emerald-700">Contatto selezionato: #{{ $selectedCallerId }}</div>
@endif
@if($callerMatches->count() > 0)
<div class="mt-3 space-y-2">
@foreach($callerMatches as $match)
@php($stabileLabel = $this->getCallerStabileLabel((int) $match->id))
<button type="button" wire:click="selezionaCaller({{ (int) $match->id }})" class="w-full rounded-lg border p-3 text-left {{ (int) $selectedCallerId === (int) $match->id ? 'border-emerald-400 bg-emerald-50 ring-1 ring-emerald-200' : 'bg-white hover:bg-gray-50' }}">
<div class="text-sm font-medium">{{ $match->nome_completo ?: ($match->ragione_sociale ?: 'Contatto') }}</div>
<div class="text-xs text-gray-600">{{ $match->categoria ?: 'altro' }} @if($match->email) · {{ $match->email }} @endif</div>
@if($match->tipo_utenza_call)
<div class="text-xs text-indigo-700">Profilo: {{ $match->tipo_utenza_call }}</div>
@endif
@if($match->riferimento_stabile)
<div class="text-xs text-indigo-700">Rif. stabile: {{ $match->riferimento_stabile }}</div>
@endif
@if($match->riferimento_unita)
<div class="text-xs text-indigo-700">Rif. unità: {{ $match->riferimento_unita }}</div>
@endif
@if($stabileLabel)
<div class="text-xs text-emerald-700">Stabile: {{ $stabileLabel }}</div>
@endif
<div class="mt-1 text-xs text-gray-700">
{{ $match->telefono_cellulare ?: $match->telefono_ufficio ?: $match->telefono_casa ?: 'Telefono non valorizzato' }}
</div>
@if($match->note_segreteria)
<div class="mt-1 text-xs text-gray-500">{{ $match->note_segreteria }}</div>
@endif
</button>
@endforeach
</div>
@elseif(filled($callerSearch))
<div class="mt-3 text-xs text-gray-500">Nessun contatto trovato con questa ricerca.</div>
@endif
<div class="mt-4 rounded-lg border border-dashed p-3">
<div class="text-sm font-semibold">Nuovo ticket rapido</div>
<div class="mt-1 text-xs text-gray-500">Dopo aver selezionato il chiamante, compila e crea il ticket.</div>
<div class="mt-3 grid gap-3 md:grid-cols-2">
<label class="block text-sm md:col-span-2">
<span class="mb-1 block font-medium">Titolo</span>
<input type="text" wire:model.defer="newTicketTitolo" class="w-full rounded-lg border-gray-300" placeholder="Es. Guasto ascensore scala B" />
</label>
<label class="block text-sm">
<span class="mb-1 block font-medium">Priorita</span>
<select wire:model.defer="newTicketPriorita" class="w-full rounded-lg border-gray-300">
<option value="Bassa">Bassa</option>
<option value="Media">Media</option>
<option value="Alta">Alta</option>
<option value="Urgente">Urgente</option>
</select>
</label>
<label class="block text-sm">
<span class="mb-1 block font-medium">Categoria ticket</span>
<select wire:model.defer="newTicketCategoriaId" class="w-full rounded-lg border-gray-300">
<option value="">Seleziona categoria</option>
@foreach($categorieTicketOptions as $cat)
<option value="{{ (int) $cat['id'] }}">{{ $cat['nome'] }}</option>
@endforeach
</select>
</label>
<label class="block text-sm md:col-span-2">
<span class="mb-1 block font-medium">Tipo intervento preimpostato</span>
<select wire:model.defer="newTicketTipoIntervento" class="w-full rounded-lg border-gray-300">
@foreach($interventiPreimpostati as $code => $label)
<option value="{{ $code }}">{{ $label }}</option>
@endforeach
</select>
</label>
<label class="block text-sm">
<span class="mb-1 block font-medium">Luogo intervento</span>
<input type="text" wire:model.defer="newTicketLuogo" class="w-full rounded-lg border-gray-300" placeholder="Es. Scala B - Piano 2" />
</label>
<label class="block text-sm md:col-span-2">
<span class="mb-1 block font-medium">Descrizione</span>
<textarea rows="3" wire:model.defer="newTicketDescrizione" class="w-full rounded-lg border-gray-300" placeholder="Descrivi il problema..." ></textarea>
</label>
<label class="block text-sm md:col-span-2">
<span class="mb-1 block font-medium">Nota foto/documentazione (opzionale)</span>
<textarea rows="2" wire:model.defer="newTicketFotoNote" class="w-full rounded-lg border-gray-300" placeholder="Es. perdita visibile sotto il lavello, foto allegata" ></textarea>
</label>
<label class="block text-sm md:col-span-2">
<span class="mb-1 block font-medium">Foto o documenti</span>
<input
type="file"
wire:model="newTicketAttachments"
multiple
accept="image/*,.pdf,.doc,.docx,.xls,.xlsx,.txt"
capture="environment"
class="w-full rounded-lg border-gray-300 text-sm"
/>
<div class="mt-1 text-xs text-gray-500">Puoi allegare fino a 8 file (max 10MB ciascuno). Da smartphone puoi scattare una foto direttamente.</div>
</label>
</div>
<div class="mt-3">
<x-filament::button wire:click="creaTicketRapido">Crea ticket</x-filament::button>
</div>
</div>
</div>
<div class="rounded-xl border bg-white p-4">
<div class="text-sm font-semibold">Gestione operativa separata</div>
<div class="mt-1 text-xs text-gray-500">Per lavorazione, presa in carico, risoluzione e chiusura usa la pagina dedicata.</div>
<div class="mt-3">
<a href="{{ \App\Filament\Pages\Supporto\TicketGestione::getUrl(panel: 'admin-filament') }}" class="inline-flex items-center rounded-md bg-indigo-700 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-600">Vai a Gestione Ticket</a>
</div>
</div>
<div class="text-xs text-gray-500">
Suggerimento: aggiungi questa pagina ai preferiti del browser sul telefono per usarla come webapp rapida.
</div>
</div>
</x-filament-panels::page>