@php $days = $this->getDays(); $rows = $this->getRows(); $matrix = $this->getMatrix(); $stats = $this->getStats(); $openEvent = $this->getOpenEvent(); @endphp
CRM › Programări › Calendar vizual

Calendar vizual

Ore programate
{{ $stats['scheduled_hours'] }} / {{ $stats['capacity_hours'] }}
săptămâna curentă · {{ $stats['utilization_pct'] }}% capacitate
Fișe deschise
{{ $stats['open_count'] }}
programări active
Confirmate
{{ $stats['confirmed_count'] }} / {{ $stats['total_count'] }}
{{ $stats['confirmation_rate_pct'] }}% rata confirmare
No-show alert
{{ $stats['no_show_alert'] }}
programări neconfirmate < 24h
{{ $this->getWeekLabel() }}
Mod:
Grupare:
@if ($viewMode === 'custom')
De la: Până la:
@endif
Filtru:
⚙ Cum funcționează: Matricea {{ $groupBy === 'post' ? 'Pod' : 'Mecanic' }} × Zile. Drag-and-drop între celule pentru a reprograma. Indicator de încărcare pe fiecare celulă (ore_planificate / capacitate). Click pe celulă goală → programare rapidă. Click pe eveniment → detalii.
@if ($viewMode === 'list') @php $list = $this->getListAppointments(); @endphp
@if (empty($list))
Nicio programare în perioada selectată.
@else @foreach (['Data', 'Ora', 'Subiect', 'Client', 'Telefon', 'Auto', 'Pod', 'Maistru', 'Status'] as $h) @endforeach @foreach ($list as $a) @endforeach
{{ $h }}
{{ $a['date'] }} {{ $a['time'] }} {{ $a['title'] }} {{ $a['client_name'] ?? '—' }} {{ $a['client_phone'] ?? '—' }} {{ $a['vehicle'] }} {{ $a['post_name'] }} {{ $a['master_name'] }} {{ ucfirst($a['status']) }}
@endif
@else
{{ $groupBy === 'post' ? 'Pod / Zi' : 'Mecanic / Zi' }}
@foreach ($days as $day)
{{ $day['name'] }} {{ $day['label'] }}
@endforeach @foreach ($rows as $row)
{{ $row['name'] }} @if ($row['kind'] === 'post') @endif
{{ $row['meta'] }}
@foreach ($days as $day) @php $cell = $matrix[$row['id']][$day['date']] ?? ['events' => [], 'load_hours' => 0, 'capacity' => $row['capacity_hours']]; $loadClass = ''; $cap = $cell['capacity'] ?: 10; $loadRatio = $cap > 0 ? $cell['load_hours'] / $cap : 0; if ($loadRatio >= 0.9) $loadClass = 'full'; elseif ($loadRatio >= 0.5) $loadClass = 'warn'; @endphp
@if (! $day['is_closed']) {{ rtrim(rtrim(number_format($cell['load_hours'], 1), '0'), '.') ?: '0' }}/{{ (int)$cap }} @foreach ($cell['events'] as $e)
{{ $e['client_name'] ?: $e['title'] }}
{{ $e['vehicle'] ?: '—' }}@if($e['plate']) · {{ $e['plate'] }}@endif
{{ $e['time'] }}@if($e['master_initial']) · {{ $e['master_initial'] }}@endif
@endforeach @endif
@endforeach @endforeach
@endif

Legendă

Mecanici
@foreach ($this->getMasterOptions() as $id => $name) @php $u = \App\Models\Tenant\User::find($id); $color = $u?->color ?: '#94a3b8'; $spec = $u?->specialization ?: ''; @endphp
{{ $name }} @if($spec)· {{ $spec }} @endif
@endforeach
Încărcare celulă
0–5h/10 liber/ușor
5–8.5h/10 mediu
≥9h/10 plin
Stare zi
Weekend
Închis (Duminică/sărbătoare)
Astăzi
@if ($openEvent)
{{ $openEvent['title'] ?: $openEvent['client_name'] }}
{{ $openEvent['date'] }} · {{ $openEvent['time'] }} · {{ ucfirst($openEvent['status']) }}
@if ($openEvent['client_name'])
{{ $openEvent['client_name'] }}
@endif @if ($openEvent['client_phone'])
{{ $openEvent['client_phone'] }}
@endif @if ($openEvent['vehicle'])
{{ $openEvent['vehicle'] }}
@endif @if ($openEvent['plate'])
{{ $openEvent['plate'] }}
@endif @if ($openEvent['master_name'])
{{ $openEvent['master_name'] }}
@endif @if ($openEvent['post_name'])
{{ $openEvent['post_name'] }}
@endif
@if ($openEvent['notes'])
{{ $openEvent['notes'] }}
@endif
↗ Editare
@endif
@if ($showNewForm)
Programare nouă
{{ $newAppt['date'] ?? '' }}
@endif
{{-- NEW POST QUICK-ADD MODAL --}} @if ($showNewPostForm)

+ Pod / spațiu nou

Poți adăuga un loc de muncă (cu lift sau fără — ex: curte, atelier electric).

@endif {{-- RENAME POST MODAL --}} @if ($renamingPostId)

✏ Editează pod

Pre-completat automat la programări noi pe acest pod.

@endif