|
@@ -1,16 +1,20 @@
|
|
|
@extends('layouts.app')
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
@section('content')
|
|
|
|
|
+
|
|
|
<div class="px-3">
|
|
<div class="px-3">
|
|
|
- <div class="col-xxl-6 offset-xxl-2">
|
|
|
|
|
- <form action="{{ route('order.store') }}" method="post">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <form class="row" action="{{ route('order.store') }}" method="post">
|
|
|
|
|
+ <div class="col-xxl-6">
|
|
|
|
|
+ <h4>Общая информация об объекте</h4>
|
|
|
|
|
+
|
|
|
@csrf
|
|
@csrf
|
|
|
|
|
|
|
|
@if(isset($order))
|
|
@if(isset($order))
|
|
|
<input type="hidden" name="id" value="{{ $order->id }}">
|
|
<input type="hidden" name="id" value="{{ $order->id }}">
|
|
|
@endif
|
|
@endif
|
|
|
|
|
|
|
|
- @include('partials.select', ['name' => 'district_id', 'title' => 'Округ', 'options' => $districts, 'value' => $order?->$district_id ?? old('district_id'), 'first_empty' => true, 'required' => true])
|
|
|
|
|
|
|
+ @include('partials.select', ['name' => 'district_id', 'title' => 'Округ', 'options' => $districts, 'value' => $order?->district_id ?? old('district_id'), 'first_empty' => true, 'required' => true])
|
|
|
|
|
|
|
|
@include('partials.select', ['name' => 'area_id', 'title' => 'Район', 'options' => $areas, 'value' => $order?->area_id ?? old('area_id'), 'required' => true, 'first_empty' => true])
|
|
@include('partials.select', ['name' => 'area_id', 'title' => 'Район', 'options' => $areas, 'value' => $order?->area_id ?? old('area_id'), 'required' => true, 'first_empty' => true])
|
|
|
|
|
|
|
@@ -36,9 +40,19 @@
|
|
|
|
|
|
|
|
@include('partials.input', ['name' => 'tg_group_link', 'title' => 'Ссылка на группу в ТГ', 'value' => $order->tg_group_link ?? old('tg_group_link')])
|
|
@include('partials.input', ['name' => 'tg_group_link', 'title' => 'Ссылка на группу в ТГ', 'value' => $order->tg_group_link ?? old('tg_group_link')])
|
|
|
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-xxl-6">
|
|
|
|
|
+ <h4>МАФ</h4>
|
|
|
|
|
+
|
|
|
|
|
+ @include('partials.input', ['name' => 'search_maf', 'title' => 'Поиск МАФ', 'value' => '', 'placeholder' => 'Артикул или номер номенклатуры', 'datalist' => []])
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-12 text-end">
|
|
|
@include('partials.submit')
|
|
@include('partials.submit')
|
|
|
- </form>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
@if($errors->any())
|
|
@if($errors->any())
|
|
@@ -49,11 +63,26 @@
|
|
|
|
|
|
|
|
@push('scripts')
|
|
@push('scripts')
|
|
|
<script type="module">
|
|
<script type="module">
|
|
|
|
|
+ $('#search_maf').on('keyup', function () {
|
|
|
|
|
+ // search products on backend
|
|
|
|
|
+ $.get('{{ route('product.search') }}?s=' + $(this).val(),
|
|
|
|
|
+ function (data) {
|
|
|
|
|
+ $('#dl-search_maf').children().remove();
|
|
|
|
|
+ $.each(data, function (id, name) {
|
|
|
|
|
+ $('#dl-search_maf').append('<option value=\'' + name + '\'>' + id + '</option>');
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$('#district_id').on('change', function () {
|
|
$('#district_id').on('change', function () {
|
|
|
// load areas of selected district
|
|
// load areas of selected district
|
|
|
console.log($(this).val());
|
|
console.log($(this).val());
|
|
|
|
|
|
|
|
- $.get('{{ route('area.ajax-get-areas-by-district') }}/'+$(this).val(),
|
|
|
|
|
|
|
+ $.get('{{ route('area.ajax-get-areas-by-district') }}/' + $(this).val(),
|
|
|
function (data) {
|
|
function (data) {
|
|
|
$('#area_id').children().remove();
|
|
$('#area_id').children().remove();
|
|
|
$.each(data, function (id, name) {
|
|
$.each(data, function (id, name) {
|