|
|
@@ -0,0 +1,58 @@
|
|
|
+@extends('layouts.app')
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <div class="px-3">
|
|
|
+ <div class="col-xxl-6 offset-xxl-2">
|
|
|
+ <form action="{{ route('order.store') }}" method="post">
|
|
|
+ @csrf
|
|
|
+
|
|
|
+ @if(isset($order))
|
|
|
+ <input type="hidden" name="id" value="{{ $order->id }}">
|
|
|
+ @endif
|
|
|
+
|
|
|
+ @include('partials.select', ['name' => 'district_id', 'title' => 'Округ', 'options' => $districts, 'value' => $order?->$district_id ?? null, 'first_empty' => true, 'required' => true])
|
|
|
+
|
|
|
+ @include('partials.select', ['name' => 'area_id', 'title' => 'Район', 'options' => [] /* $areas */, 'value' => $order?->area_id ?? null, 'required' => true])
|
|
|
+
|
|
|
+ @include('partials.input', ['name' => 'object_address', 'title' => 'Адрес объекта', 'value' => $order->object_address ?? '', 'required' => true])
|
|
|
+
|
|
|
+ @include('partials.select', ['name' => 'object_type', 'title' => 'Тип объекта', 'options' => $objectTypes, 'value' => $order->object_type ?? null, 'required' => true, 'first_empty' => true])
|
|
|
+
|
|
|
+ @include('partials.input', ['name' => 'contract_date', 'title' => 'Дата договора', 'type' => 'date', 'value' => $order->contract_date ?? ''])
|
|
|
+
|
|
|
+ @include('partials.input', ['name' => 'contract_number', 'title' => 'Номер договора', 'value' => $order->contract_number ?? ''])
|
|
|
+
|
|
|
+ @include('partials.textarea', ['name' => 'comment', 'title' => 'Комментарий', 'value' => $order->comment ?? ''])
|
|
|
+
|
|
|
+ @include('partials.input', ['name' => 'installation_date', 'title' => 'Дата выхода на монтаж', 'type' => 'date', 'value' => $order->installation_date ?? ''])
|
|
|
+
|
|
|
+ @include('partials.select', ['name' => 'brigadier', 'title' => 'Бригадир', 'options' => $brigadiers, 'value' => $order->brigadier ?? ''])
|
|
|
+
|
|
|
+ @include('partials.input', ['name' => 'tg_group_name', 'title' => 'Группа в ТГ', 'value' => $order->tg_group_name ?? ''])
|
|
|
+
|
|
|
+ @include('partials.submit')
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+@endsection
|
|
|
+
|
|
|
+@push('scripts')
|
|
|
+ <script type="module">
|
|
|
+ $('#district_id').on('change', function () {
|
|
|
+ // load areas of selected district
|
|
|
+ console.log($(this).val());
|
|
|
+
|
|
|
+ $.get('{{ route('area.ajax-get-areas-by-district') }}/'+$(this).val(),
|
|
|
+ function (data) {
|
|
|
+ $('#area_id').children().remove();
|
|
|
+ $.each(data, function (id, name) {
|
|
|
+ $('#area_id').append('<option value=\'' + id + '\'>' + name + '</option>');
|
|
|
+ });
|
|
|
+ console.log(data);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+@endpush
|