Fix queue handoff so tickets keep their number across services.
Deploy Ladill Queue / deploy (push) Successful in 40s
Deploy Ladill Queue / deploy (push) Successful in 40s
Handoff now frees the counter, ends the service session, and requeues the same ticket for the next department — critical for hospital flows like doctor → lab. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,6 +14,13 @@
|
||||
</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">
|
||||
@@ -47,26 +54,33 @@
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@if ($allQueues->count() > 1)
|
||||
<form method="POST" action="{{ route('qms.console.action', $counter) }}" class="mt-4 flex flex-wrap items-end gap-2 border-t border-indigo-100 pt-4">
|
||||
@php
|
||||
$handoffQueues = $allQueues->where('id', '!=', $currentTicket->service_queue_id)->values();
|
||||
@endphp
|
||||
@if ($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="min-w-[12rem] flex-1">
|
||||
<label class="block text-xs font-medium text-slate-500">Transfer to queue</label>
|
||||
<select name="to_queue_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
@foreach ($allQueues as $q)
|
||||
@if ($q->id !== $currentTicket->service_queue_id)
|
||||
<option value="{{ $q->id }}">{{ $q->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
<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="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. Specialist required" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<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>
|
||||
<button type="submit" class="btn-secondary text-sm">Transfer ticket</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user