first&last

This commit is contained in:
sbb45
2026-03-20 15:47:17 +05:00
commit d6441abdd2
230 changed files with 20367 additions and 0 deletions
@@ -0,0 +1,11 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card lg:col-span-1"><div class="card-body">
<h2 class="text-lg font-semibold mb-3">{{ $editingId ? 'Редактировать отдел' : 'Новый отдел' }}</h2>
<div class="space-y-3">
<div><label class="text-sm font-medium">Название</label><input wire:model.defer="name" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<div><label class="text-sm font-medium">Описание</label><textarea wire:model.defer="description" rows="3" class="mt-1 w-full rounded-xl border border-slate-300 px-3 py-2"></textarea></div>
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div>
</div></div>
<div class="card lg:col-span-2"><div class="card-body"><table class="min-w-full text-sm"><thead><tr><th class="text-left py-2">Название</th><th class="text-left py-2">Описание</th><th></th></tr></thead><tbody>@foreach($items as $item)<tr class="border-t border-slate-100"><td class="py-2">{{ $item->name }}</td><td class="py-2">{{ $item->description }}</td><td class="py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td></tr>@endforeach</tbody></table></div></div>
</div>
@@ -0,0 +1,9 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card"><div class="card-body space-y-3">
<h2 class="text-lg font-semibold">{{ $editingId ? 'Редактировать категорию' : 'Новая категория' }}</h2>
<input wire:model.defer="name" placeholder="Название" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<textarea wire:model.defer="description" rows="3" placeholder="Описание" class="w-full rounded-xl border border-slate-300 px-3 py-2"></textarea>
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div></div>
<div class="card lg:col-span-2"><div class="card-body"><table class="min-w-full text-sm"><thead><tr><th class="text-left py-2">Название</th><th class="text-left py-2">Описание</th><th></th></tr></thead><tbody>@foreach($items as $item)<tr class="border-t border-slate-100"><td class="py-2">{{ $item->name }}</td><td class="py-2">{{ $item->description }}</td><td class="py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td></tr>@endforeach</tbody></table></div></div>
</div>
@@ -0,0 +1,36 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card"><div class="card-body space-y-3">
<h2 class="text-lg font-semibold">{{ $editingId ? 'Редактировать оборудование' : 'Новое оборудование' }}</h2>
<input wire:model.defer="name" placeholder="Название" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="serialNumber" placeholder="Серийный номер" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="inventoryNumber" placeholder="Инвентарный номер" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<select wire:model.defer="categoryId" class="w-full rounded-xl border border-slate-300 px-3 py-2"><option value="">Категория</option>@foreach($categories as $c)<option value="{{ $c->id }}">{{ $c->name }}</option>@endforeach</select>
<select wire:model.defer="clientId" class="w-full rounded-xl border border-slate-300 px-3 py-2"><option value="">Клиент</option>@foreach($clients as $c)<option value="{{ $c->id }}">{{ $c->name }}</option>@endforeach</select>
<div class="grid gap-2 md:grid-cols-2"><input wire:model.defer="purchaseDate" type="date" class="w-full rounded-xl border border-slate-300 px-3 py-2"><input wire:model.defer="warrantyUntil" type="date" class="w-full rounded-xl border border-slate-300 px-3 py-2"></div>
<select wire:model.defer="condition" class="w-full rounded-xl border border-slate-300 px-3 py-2"><option value="good">Хорошее</option><option value="fair">Удовлетворительное</option><option value="poor">Плохое</option></select>
<textarea wire:model.defer="notes" rows="3" placeholder="Примечания" class="w-full rounded-xl border border-slate-300 px-3 py-2"></textarea>
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div></div>
<div class="card lg:col-span-2 overflow-hidden">
<table class="min-w-full text-sm">
<thead class="bg-slate-50"><tr><th class="px-3 py-2 text-left">Название</th><th class="px-3 py-2 text-left">Категория</th><th class="px-3 py-2 text-left">Клиент</th><th class="px-3 py-2 text-left">Гарантия</th><th></th></tr></thead>
<tbody>
@foreach($items as $item)
@php
$expired = $item->warranty_until && $item->warranty_until->isPast();
$expiring = $item->warranty_until && !$expired && $item->warranty_until->lte(now()->addDays(30));
@endphp
<tr class="border-t border-slate-100">
<td class="px-3 py-2"><p class="font-medium">{{ $item->name }}</p><p class="text-xs text-slate-500">{{ $item->inventory_number }}</p></td>
<td class="px-3 py-2">{{ $item->category?->name }}</td>
<td class="px-3 py-2">{{ $item->client?->name ?? '—' }}</td>
<td class="px-3 py-2 {{ $expired ? 'text-rose-600' : ($expiring ? 'text-amber-600' : '') }}">{{ $item->warranty_until?->format('d.m.Y') ?? '—' }}</td>
<td class="px-3 py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td>
</tr>
@endforeach
</tbody>
</table>
<div class="p-4">{{ $items->links() }}</div>
</div>
</div>
@@ -0,0 +1,10 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card"><div class="card-body space-y-3">
<h2 class="text-lg font-semibold">{{ $editingId ? 'Редактировать приоритет' : 'Новый приоритет' }}</h2>
<input wire:model.defer="name" placeholder="Название" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="colorHex" type="color" class="w-full rounded-xl border border-slate-300 px-3 py-2 h-10">
<input wire:model.defer="level" type="number" min="1" max="4" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div></div>
<div class="card lg:col-span-2"><div class="card-body"><table class="min-w-full text-sm"><thead><tr><th class="text-left py-2">Название</th><th class="text-left py-2">Цвет</th><th class="text-left py-2">Уровень</th><th></th></tr></thead><tbody>@foreach($items as $item)<tr class="border-t border-slate-100"><td class="py-2">{{ $item->name }}</td><td class="py-2"><span class="inline-block h-4 w-8 rounded" style="background-color: {{ $item->color_hex }}"></span></td><td class="py-2">{{ $item->level }}</td><td class="py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td></tr>@endforeach</tbody></table></div></div>
</div>
@@ -0,0 +1,10 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card"><div class="card-body space-y-3">
<h2 class="text-lg font-semibold">{{ $editingId ? 'Редактировать тип' : 'Новый тип' }}</h2>
<input wire:model.defer="name" placeholder="Название" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="slaHours" type="number" min="1" placeholder="SLA часов" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<textarea wire:model.defer="description" rows="3" placeholder="Описание" class="w-full rounded-xl border border-slate-300 px-3 py-2"></textarea>
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div></div>
<div class="card lg:col-span-2"><div class="card-body"><table class="min-w-full text-sm"><thead><tr><th class="text-left py-2">Название</th><th class="text-left py-2">SLA</th><th class="text-left py-2">Описание</th><th></th></tr></thead><tbody>@foreach($items as $item)<tr class="border-t border-slate-100"><td class="py-2">{{ $item->name }}</td><td class="py-2">{{ $item->sla_hours }} ч</td><td class="py-2">{{ $item->description }}</td><td class="py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td></tr>@endforeach</tbody></table></div></div>
</div>
@@ -0,0 +1,12 @@
<div class="grid gap-4 lg:grid-cols-3">
<div class="card"><div class="card-body space-y-3">
<h2 class="text-lg font-semibold">{{ $editingId ? 'Редактировать статус' : 'Новый статус' }}</h2>
<input wire:model.defer="name" placeholder="Название" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="slug" placeholder="Slug" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<input wire:model.defer="colorHex" type="color" class="w-full rounded-xl border border-slate-300 px-3 py-2 h-10">
<input wire:model.defer="sortOrder" type="number" min="1" class="w-full rounded-xl border border-slate-300 px-3 py-2">
<label class="inline-flex items-center gap-2"><input wire:model.defer="isFinal" type="checkbox" class="rounded"> <span class="text-sm">Финальный</span></label>
<button wire:click="save" class="rounded-xl bg-slate-900 text-white px-3 py-2 text-sm">Сохранить</button>
</div></div>
<div class="card lg:col-span-2"><div class="card-body"><table class="min-w-full text-sm"><thead><tr><th class="text-left py-2">Название</th><th class="text-left py-2">Slug</th><th class="text-left py-2">Порядок</th><th class="text-left py-2">Финальный</th><th></th></tr></thead><tbody>@foreach($items as $item)<tr class="border-t border-slate-100"><td class="py-2">{{ $item->name }}</td><td class="py-2">{{ $item->slug }}</td><td class="py-2">{{ $item->sort_order }}</td><td class="py-2">{{ $item->is_final ? 'Да' : 'Нет' }}</td><td class="py-2 text-right"><button wire:click="edit({{ $item->id }})" class="text-xs mr-2">Изм.</button><button wire:click="delete({{ $item->id }})" class="text-xs text-rose-600">Удалить</button></td></tr>@endforeach</tbody></table></div></div>
</div>