Initial commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<x-app-layout :active="'wells.index'" title="SoftSPM 2 - Nowa studnia">
|
||||
<div class="max-w-3xl space-y-stack-gap">
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('wells.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
|
||||
<h1 class="font-headline-lg text-headline-lg text-on-surface">Nowa studnia</h1>
|
||||
</div>
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">
|
||||
{{ $errors->first() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('wells.store') }}"
|
||||
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
|
||||
@csrf
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<x-well-field name="name" label="Nazwa studni" :value="old('name')" required class="sm:col-span-2" />
|
||||
|
||||
<x-well-select name="water_intake_id" label="Ujęcie / bariera" :options="$waterIntakes" :selected="old('water_intake_id')" required placeholder="- wybierz -" />
|
||||
<x-well-select name="category_id" label="Kategoria" :options="$categories" :selected="old('category_id', 19)" required />
|
||||
|
||||
<x-well-field name="diameter" label="Średnica rurociągu" :value="old('diameter')" />
|
||||
<x-well-field name="depth" label="Głębokość studni" :value="old('depth')" />
|
||||
<x-well-field name="supply" label="Głębokość zasypu" :value="old('supply')" />
|
||||
<x-well-select name="status_id" label="Status" :options="$statuses" :selected="old('status_id')" required placeholder="- wybierz -" />
|
||||
|
||||
<x-well-field name="latitude" label="Szerokość geograficzna" :value="old('latitude')" />
|
||||
<x-well-field name="longitude" label="Długość geograficzna" :value="old('longitude')" />
|
||||
|
||||
<x-well-field name="available_date" label="Data oddania" type="date" :value="old('available_date')" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 pt-2">
|
||||
<button type="submit"
|
||||
class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">
|
||||
Zapisz
|
||||
</button>
|
||||
<a href="{{ route('wells.index') }}"
|
||||
class="px-5 py-2.5 rounded font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">
|
||||
Anuluj
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,75 @@
|
||||
<x-app-layout :active="'wells.index'" title="SoftSPM 2 - Edycja studni">
|
||||
@php
|
||||
// Data/godzina zabudowy z ostatniej wymiany agregatu (jak site301E).
|
||||
$dateVal = $well->wle_date_from ? substr($well->wle_date_from, 0, 10) : ($well->available_date ?? '');
|
||||
$timeVal = $well->wle_date_from ? substr($well->wle_date_from, 11, 5) : '';
|
||||
@endphp
|
||||
|
||||
<div class="max-w-3xl space-y-stack-gap">
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('wells.index') }}" class="font-body-sm text-body-sm text-on-surface-variant hover:text-primary">← Wróć</a>
|
||||
<h1 class="font-headline-lg text-headline-lg text-on-surface">Edycja: {{ $well->name }}</h1>
|
||||
</div>
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="status-chip-alert px-3 py-2 rounded-lg font-body-sm text-body-sm">
|
||||
{{ $errors->first() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('wells.update', $well->drs_id) }}"
|
||||
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding space-y-4">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type="hidden" name="well_id" value="{{ $well->well_id }}">
|
||||
<input type="hidden" name="wle_id" value="{{ $well->wle_id }}">
|
||||
|
||||
{{-- Zabudowany agregat (tylko do odczytu) --}}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<x-well-field name="_pump_name" label="Pompa" :value="$well->pump_name" readonly />
|
||||
<x-well-field name="_pump_no" label="Nr pompy" :value="$well->pump_no" readonly />
|
||||
<x-well-field name="_engine_name" label="Silnik" :value="$well->engine_name" readonly />
|
||||
<x-well-field name="_engine_no" label="Nr silnika" :value="$well->engine_no" readonly />
|
||||
</div>
|
||||
|
||||
<hr class="border-outline-variant/40">
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<x-well-field name="name" label="Nazwa studni" :value="$well->name" required class="sm:col-span-2" />
|
||||
|
||||
<x-well-select name="water_intake_id" label="Ujęcie / bariera" :options="$waterIntakes" :selected="$well->water_intake_id" required />
|
||||
<x-well-select name="category_id" label="Kategoria" :options="$categories" :selected="$well->category_id" required />
|
||||
<x-well-select name="status_id" label="Status" :options="$statuses" :selected="$well->status_id" required />
|
||||
|
||||
<x-well-field name="available_date" label="Data zabudowy" type="date" :value="$dateVal" />
|
||||
<x-well-field name="build_time" label="Godzina zabudowy" type="time" :value="$timeVal" />
|
||||
|
||||
<x-well-field name="latitude" label="Szerokość geograficzna" :value="$well->latitude" />
|
||||
<x-well-field name="longitude" label="Długość geograficzna" :value="$well->longitude" />
|
||||
|
||||
<x-well-select name="sys_type" label="Typ systemu" :options="$sysTypes" :selected="$well->sys_type" :value-is-label="true" placeholder="- wybierz -" />
|
||||
<x-well-select name="status_desc" label="Opis stanu" :options="$statusDescs" :selected="$well->status_desc" :value-is-label="true" placeholder="- wybierz -" />
|
||||
|
||||
<x-well-field name="pp_scope" label="Zakres ciśnienia p_p [m]" :value="$well->pp_scope" />
|
||||
<x-well-field name="hh_scope" label="Zakres sondy H_H [m]" :value="$well->hh_scope" />
|
||||
</div>
|
||||
|
||||
<p class="font-body-sm text-body-sm text-on-surface-variant">
|
||||
Uwaga: zakresy p<sub>p</sub>/H<sub>H</sub> są aktualizowane automatycznie po przypisaniu sondy SGP.
|
||||
Edytuj ręcznie tylko gdy wartość jest pusta.
|
||||
</p>
|
||||
|
||||
<div class="flex items-center gap-2 pt-2">
|
||||
<button type="submit"
|
||||
class="bg-primary text-on-primary px-6 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">
|
||||
Zapisz zmiany
|
||||
</button>
|
||||
<a href="{{ route('wells.index') }}"
|
||||
class="px-5 py-2.5 rounded font-title-sm text-title-sm text-on-surface-variant hover:bg-surface-container transition-all">
|
||||
Anuluj
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,109 @@
|
||||
<x-app-layout :active="'wells.index'" title="SoftSPM 2 - Studnie">
|
||||
<div class="space-y-stack-gap">
|
||||
|
||||
{{-- Komunikat sukcesu --}}
|
||||
@if (session('status'))
|
||||
<div class="status-chip-ok px-3 py-2 rounded-lg font-body-sm text-body-sm">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Nagłówek --}}
|
||||
<div class="flex items-end justify-between">
|
||||
<div>
|
||||
<h1 class="font-headline-lg text-headline-lg text-on-surface">Studnie</h1>
|
||||
<p class="font-body-sm text-body-sm text-on-surface-variant mt-1">
|
||||
Oddział: <span class="font-data-label">{{ $department ?? '-' }}</span>
|
||||
· Wyników: <span class="font-data-label">{{ $wells->total() }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="{{ route('wells.create') }}"
|
||||
class="bg-primary text-on-primary px-5 py-2.5 rounded-full font-title-sm text-title-sm hover:bg-primary-container transition-all active:scale-95 shadow-card">
|
||||
Dodaj studnię
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- Wyszukiwarka (GET - filtry komponują się z paginacją) --}}
|
||||
<form method="GET" action="{{ route('wells.index') }}"
|
||||
class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card p-card-inner-padding">
|
||||
<div class="flex flex-wrap items-end gap-4">
|
||||
<div class="space-y-1">
|
||||
<label for="q" class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">Studnia</label>
|
||||
<input id="q" name="q" type="text" value="{{ $search }}"
|
||||
placeholder="nazwa studni"
|
||||
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-data-label text-on-surface">
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<label for="status" class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">Status</label>
|
||||
<select id="status" name="status"
|
||||
class="bg-surface-container-low border border-outline-variant px-3 py-2 rounded focus:ring-1 focus:ring-primary focus:border-primary font-data-label text-on-surface">
|
||||
@foreach ($statusOptions as $id => $label)
|
||||
<option value="{{ $id }}" {{ (int) $status === (int) $id ? 'selected' : '' }}>{{ $label }}</option>
|
||||
@endforeach
|
||||
<option value="{{ $statusAll }}" {{ (int) $status === $statusAll ? 'selected' : '' }}>Wszystkie</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="bg-secondary text-on-secondary px-5 py-2.5 rounded-full font-title-sm text-title-sm hover:opacity-90 transition-all active:scale-95">
|
||||
Szukaj
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{-- Tabela --}}
|
||||
<div class="bg-surface-container-lowest border border-outline-variant/40 rounded-lg shadow-card overflow-hidden">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-secondary/10 border-b border-outline-variant/40">
|
||||
<tr class="font-data-label text-data-label text-on-surface-variant uppercase tracking-wider">
|
||||
<th class="px-4 py-3 w-12">Lp.</th>
|
||||
<x-sortable-th column="name">Nazwa</x-sortable-th>
|
||||
<x-sortable-th column="bariera">Bariera</x-sortable-th>
|
||||
<x-sortable-th column="pump">Pompa</x-sortable-th>
|
||||
<x-sortable-th column="pump_no">Nr pompy</x-sortable-th>
|
||||
<x-sortable-th column="engine">Silnik</x-sortable-th>
|
||||
<x-sortable-th column="engine_no">Nr silnika</x-sortable-th>
|
||||
<x-sortable-th column="type">Typ</x-sortable-th>
|
||||
<th class="px-4 py-3 text-center">Stan</th>
|
||||
<th class="px-4 py-3 text-right">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-outline-variant/30 font-body-md text-body-md">
|
||||
@forelse ($wells as $well)
|
||||
<tr class="hover:bg-surface-container transition-colors">
|
||||
<td class="px-4 py-3 font-data-label text-on-surface-variant">{{ $wells->firstItem() + $loop->index }}.</td>
|
||||
<td class="px-4 py-3 font-semibold text-on-surface">{{ $well->well_name }}</td>
|
||||
<td class="px-4 py-3">{{ $well->bariera }}</td>
|
||||
<td class="px-4 py-3">{{ $well->pump_name }}</td>
|
||||
<td class="px-4 py-3 font-data-label">{{ $well->pump_no }}</td>
|
||||
<td class="px-4 py-3">{{ $well->engine_name }}</td>
|
||||
<td class="px-4 py-3 font-data-label">{{ $well->engine_no }}</td>
|
||||
<td class="px-4 py-3">{{ $well->sys_type }}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($well->onoff === 'ON')
|
||||
<span class="status-chip status-chip-ok">ON</span>
|
||||
@else
|
||||
<span class="status-chip bg-surface-container-high text-on-surface-variant">OFF</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('wells.edit', $well->drs_id) }}"
|
||||
class="font-body-sm text-body-sm text-secondary hover:underline">Edytuj</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="10" class="px-4 py-8 text-center font-body-md text-body-md text-on-surface-variant">
|
||||
Brak studni dla wybranych kryteriów.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- Paginacja --}}
|
||||
<div>
|
||||
{{ $wells->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user