|
|
@@ -100,7 +100,7 @@
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<div>
|
|
|
- <button class="btn btn-primary btn-sm ">Перенести МАФы</button>
|
|
|
+ <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#moveModal">Перенести МАФы</button>
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
@@ -109,16 +109,55 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+ <!-- Модальное окно переноса -->
|
|
|
+ <div class="modal fade" id="moveModal" 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('order.move-maf') }}" method="post">
|
|
|
+ @csrf
|
|
|
+ <div id="select_maf_form">
|
|
|
+ <input type="text" class="form-control mb-2" placeholder="Поиск площадки" id="search_order">
|
|
|
+ <select id="select_order" name="new_order_id" class="form-select mb-3" multiple required></select>
|
|
|
+ <a href="#" class="btn btn-primary" id="moveMaf">Перенести</a>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
@endsection
|
|
|
|
|
|
+
|
|
|
@push('scripts')
|
|
|
<script type="module">
|
|
|
+ // select order
|
|
|
+ $('#search_order').on('keyup', function () {
|
|
|
+ // search products on backend
|
|
|
+ $.get('{{ route('order.search') }}?s=' + $(this).val(),
|
|
|
+ function (data) {
|
|
|
+ $('#select_order').children().remove()
|
|
|
+ $.each(data, function (id, name) {
|
|
|
+ $('#select_order').append('<option value=\'' + id + '\'>' + name + '</option>');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
|
|
|
$('#check-all-maf').on('change', function () {
|
|
|
$('input:checkbox.check-maf').not(this).prop('checked', this.checked);
|
|
|
});
|
|
|
|
|
|
- $('.revert-maf').on('click', function () {
|
|
|
+ // move maf
|
|
|
+ $('#moveMaf').on('click', function () {
|
|
|
let ids = Array();
|
|
|
$('.check-maf').each(function () {
|
|
|
if ($(this).prop('checked')) {
|
|
|
@@ -126,10 +165,11 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- $.post('{{ route('order.revert-maf', $order) }}',
|
|
|
+ $.post('{{ route('order.move-maf') }}',
|
|
|
{
|
|
|
'_token': $('meta[name=csrf-token]').attr('content'),
|
|
|
ids: JSON.stringify(ids),
|
|
|
+ 'new_order_id': $('#select_order').find(":selected").val()
|
|
|
},
|
|
|
function () {
|
|
|
// console.log(data);
|