76 lines
4.4 KiB
PHP
76 lines
4.4 KiB
PHP
<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>
|