Deploy Ladill Queue / deploy (push) Successful in 1m19s
Transfer between queues requires Pro (console UI, API, and plans copy). Branches & team now sits after Organization on the settings page.
133 lines
7.2 KiB
PHP
133 lines
7.2 KiB
PHP
<x-app-layout title="Staff console · {{ $counter->name }}">
|
|
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
<div>
|
|
<a href="{{ route('qms.counters.show', $counter) }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">← {{ $counter->name }}</a>
|
|
<h1 class="mt-2 text-xl font-semibold text-slate-900">Staff console</h1>
|
|
<p class="mt-1 text-sm text-slate-500">{{ $counter->branch?->name }}</p>
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<x-counter-status :status="$counter->status" />
|
|
<div class="btn-group">
|
|
<form method="POST" action="{{ route('qms.console.action', $counter) }}">@csrf<input type="hidden" name="action" value="available"><button class="btn-secondary text-sm">Mark available</button></form>
|
|
<form method="POST" action="{{ route('qms.console.action', $counter) }}">@csrf<input type="hidden" name="action" value="offline"><button class="btn-secondary text-sm">Go offline</button></form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if (session('success'))
|
|
<p class="mt-4 rounded-lg bg-emerald-50 px-3 py-2 text-sm text-emerald-800">{{ session('success') }}</p>
|
|
@endif
|
|
@if (session('error'))
|
|
<p class="mt-4 rounded-lg bg-rose-50 px-3 py-2 text-sm text-rose-800">{{ session('error') }}</p>
|
|
@endif
|
|
|
|
@if ($currentTicket)
|
|
<section class="mt-6 overflow-hidden rounded-2xl border border-indigo-200 bg-gradient-to-br from-indigo-50 via-white to-white shadow-sm">
|
|
<div class="border-b border-indigo-100 px-6 py-4">
|
|
<p class="text-xs font-semibold uppercase tracking-wider text-indigo-600">Current customer</p>
|
|
</div>
|
|
<div class="px-6 py-5">
|
|
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
<div>
|
|
<p class="text-5xl font-bold tracking-tight text-slate-900">{{ $currentTicket->ticket_number }}</p>
|
|
<p class="mt-2 text-sm text-slate-600">{{ $currentTicket->serviceQueue?->name }}</p>
|
|
<p class="mt-1 text-base font-medium text-slate-800">{{ $currentTicket->customer_name ?: 'Walk-in customer' }}</p>
|
|
</div>
|
|
<x-ticket-status :status="$currentTicket->status" class="text-sm" />
|
|
</div>
|
|
|
|
<div class="mt-6 grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
|
@foreach ([
|
|
'recall' => ['Recall', 'btn-secondary'],
|
|
'start' => ['Start serving', 'btn-primary'],
|
|
'hold' => ['Hold', 'btn-secondary'],
|
|
'skip' => ['Skip', 'btn-secondary'],
|
|
'complete' => ['Complete', 'btn-primary'],
|
|
'no_show' => ['No show', 'btn-secondary'],
|
|
] as $action => [$label, $btnClass])
|
|
<form method="POST" action="{{ route('qms.console.action', $counter) }}">
|
|
@csrf
|
|
<input type="hidden" name="action" value="{{ $action }}">
|
|
<input type="hidden" name="ticket_id" value="{{ $currentTicket->id }}">
|
|
<button type="submit" class="{{ $btnClass }} w-full text-sm">{{ $label }}</button>
|
|
</form>
|
|
@endforeach
|
|
</div>
|
|
|
|
@php
|
|
$handoffQueues = $allQueues->where('id', '!=', $currentTicket->service_queue_id)->values();
|
|
@endphp
|
|
@if ($canTransfer && $handoffQueues->isNotEmpty())
|
|
<form method="POST" action="{{ route('qms.console.action', $counter) }}" class="mt-4 border-t border-indigo-100 pt-4">
|
|
@csrf
|
|
<input type="hidden" name="action" value="transfer">
|
|
<input type="hidden" name="ticket_id" value="{{ $currentTicket->id }}">
|
|
<div class="mb-3">
|
|
<p class="text-sm font-medium text-slate-800">Hand off to another queue</p>
|
|
<p class="mt-1 text-xs text-slate-500">Sends this customer to the next service while keeping ticket <span class="font-mono font-semibold text-slate-700">{{ $currentTicket->ticket_number }}</span>.</p>
|
|
</div>
|
|
<div class="flex flex-wrap items-end gap-2">
|
|
<div class="min-w-[12rem] flex-1">
|
|
<label class="block text-xs font-medium text-slate-500">Next queue</label>
|
|
<select name="to_queue_id" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
@foreach ($handoffQueues as $q)
|
|
<option value="{{ $q->id }}">{{ $q->name }} ({{ $q->prefix }})</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="min-w-[12rem] flex-1">
|
|
<label class="block text-xs font-medium text-slate-500">Reason (optional)</label>
|
|
<input type="text" name="reason" placeholder="e.g. Lab tests needed" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
|
</div>
|
|
<button type="submit" class="btn-primary text-sm">Hand off</button>
|
|
</div>
|
|
</form>
|
|
@elseif (! $canTransfer)
|
|
<div class="mt-4 border-t border-indigo-100 pt-4">
|
|
<p class="text-sm font-medium text-slate-800">
|
|
Hand off to another queue
|
|
<span class="ml-2 rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-700">Pro</span>
|
|
</p>
|
|
<p class="mt-1 text-xs text-slate-500">Pass customers between services while keeping their ticket number. Available on Queue Pro.</p>
|
|
<a href="{{ route('qms.pro.index') }}" class="mt-3 inline-flex text-sm font-medium text-indigo-600 hover:text-indigo-800">Upgrade to Pro →</a>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</section>
|
|
@else
|
|
<section class="mt-6 rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-6 py-10 text-center">
|
|
<p class="text-sm font-medium text-slate-700">No active customer</p>
|
|
<p class="mt-1 text-sm text-slate-500">Call the next waiting ticket from a queue below.</p>
|
|
</section>
|
|
@endif
|
|
|
|
<div class="mt-6 grid gap-4 lg:grid-cols-2">
|
|
@foreach ($queues as $queue)
|
|
<section class="rounded-2xl border border-slate-200 bg-white shadow-sm">
|
|
<div class="flex items-center justify-between border-b border-slate-100 px-5 py-4">
|
|
<div>
|
|
<h2 class="font-semibold text-slate-900">{{ $queue->name }}</h2>
|
|
<p class="text-xs text-slate-500">{{ count($waitingByQueue[$queue->id] ?? []) }} waiting</p>
|
|
</div>
|
|
<form method="POST" action="{{ route('qms.console.action', $counter) }}">
|
|
@csrf
|
|
<input type="hidden" name="action" value="call_next">
|
|
<input type="hidden" name="queue_id" value="{{ $queue->id }}">
|
|
<button type="submit" class="btn-primary text-sm">Call next</button>
|
|
</form>
|
|
</div>
|
|
<ul class="divide-y divide-slate-50 px-2 py-2">
|
|
@forelse ($waitingByQueue[$queue->id] ?? [] as $ticket)
|
|
<li class="flex items-center justify-between rounded-lg px-3 py-2.5 text-sm hover:bg-slate-50">
|
|
<span class="font-mono text-base font-semibold text-slate-900">{{ $ticket->ticket_number }}</span>
|
|
<span class="text-slate-500">{{ $ticket->customer_name ?? 'Walk-in' }}</span>
|
|
</li>
|
|
@empty
|
|
<li class="px-3 py-6 text-center text-sm text-slate-500">Queue is empty</li>
|
|
@endforelse
|
|
</ul>
|
|
</section>
|
|
@endforeach
|
|
</div>
|
|
</x-app-layout>
|