| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- @extends('layouts.app')
- @section('content')
- <div class="row mb-3">
- <div class="col-6">
- <h3>Заказы МАФ</h3>
- </div>
- <div class="col-6 text-end">
- <button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#addModal">
- Добавить
- </button>
- </div>
- </div>
- @include('partials.table', [
- 'id' => $id,
- 'header' => $header,
- 'strings' => $maf_orders,
- 'routeName' => 'maf_order.show',
- ])
- @include('partials.pagination', ['items' => $maf_orders])
- <!-- Модальное окно добавления-->
- <div class="modal fade" id="addModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="addModalLabel">Добавить заказ МАФ</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('maf_order.store') }}" method="post">
- @csrf
- <div id="select_maf_form">
- <input type="text" class="form-control mb-2" placeholder="Поиск номенклатуры" id="search_maf">
- <select id="select_maf" class="form-select mb-3" multiple></select>
- </div>
- <div style="display:none;" id="sku_form">
- <a href="#" onclick="$('#sku_form').slideUp(); $('#select_maf_form').slideDown()">назад</a>
- <input type="hidden" id="product_id" name="product_id" value="">
- @include('partials.input', ['name' => 'product_name', 'title' => 'МАФ', 'disabled' => true])
- @include('partials.input', ['name' => 'order_number', 'title' => 'Номер заказа', 'required' => false])
- @include('partials.input', ['name' => 'quantity', 'title' => 'Количество', 'required' => true, 'min' => 1])
- @include('partials.submit', ['name' => 'Добавить'])
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- @if($errors->count())
- @dump($errors)
- @endif
- @endsection
- @push('scripts')
- <script type="module">
- $('#select_maf').on('change', function () {
- $('#product_id').val($(this).val());
- $('#product_name').val($('#select_maf option:selected').text()).slideDown();
- $('#select_maf_form').slideUp();
- $('#sku_form').slideDown();
- });
- </script>
- @endpush
|