|
@@ -18,6 +18,8 @@
|
|
|
@if(hasRole('admin,manager'))
|
|
@if(hasRole('admin,manager'))
|
|
|
<a href="{{ route('order.edit', ['order' => $order, 'previous_url' => $previous_url]) }}"
|
|
<a href="{{ route('order.edit', ['order' => $order, 'previous_url' => $previous_url]) }}"
|
|
|
class="btn btn-sm mb-1 btn-primary">Редактировать</a>
|
|
class="btn btn-sm mb-1 btn-primary">Редактировать</a>
|
|
|
|
|
+ @endif
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
<a href="#" class="btn btn-sm btn-primary mb-1" onclick="$('#export-order').submit()">Экспорт МАФ</a>
|
|
<a href="#" class="btn btn-sm btn-primary mb-1" onclick="$('#export-order').submit()">Экспорт МАФ</a>
|
|
|
<form class="d-none" method="post" action="{{ route('order.export-one', $order) }}" id="export-order">
|
|
<form class="d-none" method="post" action="{{ route('order.export-one', $order) }}" id="export-order">
|
|
|
@csrf
|
|
@csrf
|
|
@@ -307,7 +309,7 @@
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- @if(hasRole('admin,manager'))
|
|
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
<a href="{{ route('order.get-maf', $order) }}"
|
|
<a href="{{ route('order.get-maf', $order) }}"
|
|
|
class="btn btn-primary btn-sm mb-1 @disabled($order->ready_to_mount == 'Нет' )">Привязать
|
|
class="btn btn-primary btn-sm mb-1 @disabled($order->ready_to_mount == 'Нет' )">Привязать
|
|
|
все МАФы</a>
|
|
все МАФы</a>
|
|
@@ -319,6 +321,8 @@
|
|
|
data-bs-target="#moveModal">Перенести МАФы
|
|
data-bs-target="#moveModal">Перенести МАФы
|
|
|
</button>
|
|
</button>
|
|
|
<br class="d-md-none">
|
|
<br class="d-md-none">
|
|
|
|
|
+ @endif
|
|
|
|
|
+ @if(hasRole('admin,manager'))
|
|
|
<button class="btn btn-sm mb-1 btn-warning" id="create-reclamation-button">Создать
|
|
<button class="btn btn-sm mb-1 btn-warning" id="create-reclamation-button">Создать
|
|
|
рекламацию
|
|
рекламацию
|
|
|
</button>
|
|
</button>
|
|
@@ -327,7 +331,8 @@
|
|
|
@csrf
|
|
@csrf
|
|
|
</form>
|
|
</form>
|
|
|
<br class="d-md-none">
|
|
<br class="d-md-none">
|
|
|
-
|
|
|
|
|
|
|
+ @endif
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
<a href="#" class="btn btn-primary btn-sm mb-1" id="ttnBtn">ТН</a>
|
|
<a href="#" class="btn btn-primary btn-sm mb-1" id="ttnBtn">ТН</a>
|
|
|
@endif
|
|
@endif
|
|
|
<br class="d-md-none">
|
|
<br class="d-md-none">
|
|
@@ -343,80 +348,82 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- Модальное окно графика -->
|
|
|
|
|
- <div class="modal fade" id="copySchedule" 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('schedule.create-from-order') }}" method="post" id="scheduleCreateForm">
|
|
|
|
|
- @csrf
|
|
|
|
|
- <div>
|
|
|
|
|
- <input type="hidden" name="order_id" value="{{ $order->id }}">
|
|
|
|
|
- <textarea name="comment" placeholder="Комментарий для графика" class="form-control mb-3"></textarea>
|
|
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
|
|
+ <!-- Модальное окно графика -->
|
|
|
|
|
+ <div class="modal fade" id="copySchedule" 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('schedule.create-from-order') }}" method="post" id="scheduleCreateForm">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <input type="hidden" name="order_id" value="{{ $order->id }}">
|
|
|
|
|
+ <textarea name="comment" placeholder="Комментарий для графика" class="form-control mb-3"></textarea>
|
|
|
|
|
|
|
|
- <input type="checkbox" checked="checked" id="sendNotifications" name="send_notifications" class="form-check-inline">
|
|
|
|
|
- <label for="sendNotifications" class="form-check-label mb-2">Уведомить менеджера и бригадира</label><br>
|
|
|
|
|
|
|
+ <input type="checkbox" checked="checked" id="sendNotifications" name="send_notifications" class="form-check-inline">
|
|
|
|
|
+ <label for="sendNotifications" class="form-check-label mb-2">Уведомить менеджера и бригадира</label><br>
|
|
|
|
|
|
|
|
- <input type="checkbox" id="deleteOldRecords" name="delete_old_records" class="form-check-inline">
|
|
|
|
|
- <label for="deleteOldRecords" class="form-check-label mb-2">Удалить старые записи в графике для этой площадки?</label><br>
|
|
|
|
|
|
|
+ <input type="checkbox" id="deleteOldRecords" name="delete_old_records" class="form-check-inline">
|
|
|
|
|
+ <label for="deleteOldRecords" class="form-check-label mb-2">Удалить старые записи в графике для этой площадки?</label><br>
|
|
|
|
|
|
|
|
- <button type="submit" class="btn btn-primary btn-sm">Обновить график</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
|
|
+ <button type="submit" class="btn btn-primary btn-sm">Обновить график</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <!-- Модальное окно ТН -->
|
|
|
|
|
- <div class="modal fade" id="createTtnModal" 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.create-ttn') }}" method="post" id="ttnForm">
|
|
|
|
|
- @csrf
|
|
|
|
|
- <div>
|
|
|
|
|
- <input type="text" class="form-control mb-2" name="order_number" placeholder="Номер заказа">
|
|
|
|
|
- <input type="date" class="form-control mb-2" name="order_date" placeholder="Дата заказа" value="{{ date('Y-m-d') }}">
|
|
|
|
|
- <input type="number" class="form-control mb-2" name="order_sum" placeholder="Сумма заказа" value="0">
|
|
|
|
|
- <button href="#" class="btn btn-primary" id="createTtn">Создать ТН</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
|
|
+ <!-- Модальное окно ТН -->
|
|
|
|
|
+ <div class="modal fade" id="createTtnModal" 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.create-ttn') }}" method="post" id="ttnForm">
|
|
|
|
|
+ @csrf
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <input type="text" class="form-control mb-2" name="order_number" placeholder="Номер заказа">
|
|
|
|
|
+ <input type="date" class="form-control mb-2" name="order_date" placeholder="Дата заказа" value="{{ date('Y-m-d') }}">
|
|
|
|
|
+ <input type="number" class="form-control mb-2" name="order_sum" placeholder="Сумма заказа" value="0">
|
|
|
|
|
+ <button href="#" class="btn btn-primary" id="createTtn">Создать ТН</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</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" size="20" multiple
|
|
|
|
|
- required></select>
|
|
|
|
|
- <a href="#" class="btn btn-primary" id="moveMaf">Перенести</a>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
|
|
+ <!-- Модальное окно переноса -->
|
|
|
|
|
+ <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" size="20" multiple
|
|
|
|
|
+ required></select>
|
|
|
|
|
+ <a href="#" class="btn btn-primary" id="moveMaf">Перенести</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
@if($errors->any())
|
|
@if($errors->any())
|
|
|
@dump($errors)
|
|
@dump($errors)
|
|
@@ -431,44 +438,48 @@
|
|
|
window.open('https://t.me/{{ $order->tg_group_link }}', '_blank');
|
|
window.open('https://t.me/{{ $order->tg_group_link }}', '_blank');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // 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>');
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- }).trigger('keyup');
|
|
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
|
|
+ // 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>');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }).trigger('keyup');
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#check-all-maf').on('change', function () {
|
|
$('#check-all-maf').on('change', function () {
|
|
|
$('input:checkbox.check-maf').not(this).prop('checked', this.checked);
|
|
$('input:checkbox.check-maf').not(this).prop('checked', this.checked);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // move maf
|
|
|
|
|
- $('#moveMaf').on('click', function () {
|
|
|
|
|
- let ids = Array();
|
|
|
|
|
- $('.check-maf').each(function () {
|
|
|
|
|
- if ($(this).prop('checked')) {
|
|
|
|
|
- ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
|
|
+ // move maf
|
|
|
|
|
+ $('#moveMaf').on('click', function () {
|
|
|
|
|
+ let ids = Array();
|
|
|
|
|
+ $('.check-maf').each(function () {
|
|
|
|
|
+ if ($(this).prop('checked')) {
|
|
|
|
|
+ ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $.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 () {
|
|
|
|
|
+ location.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- $.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 () {
|
|
|
|
|
- location.reload();
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
$('#create-reclamation-button').on('click', function () {
|
|
$('#create-reclamation-button').on('click', function () {
|
|
|
let ids = Array();
|
|
let ids = Array();
|
|
@@ -486,44 +497,46 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $('#createScheduleButton').on('click', function () {
|
|
|
|
|
- let ids = Array();
|
|
|
|
|
- $('.check-maf').each(function () {
|
|
|
|
|
- if ($(this).prop('checked')) {
|
|
|
|
|
- ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
- $('#scheduleCreateForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @if(hasRole('admin'))
|
|
|
|
|
+ $('#createScheduleButton').on('click', function () {
|
|
|
|
|
+ let ids = Array();
|
|
|
|
|
+ $('.check-maf').each(function () {
|
|
|
|
|
+ if ($(this).prop('checked')) {
|
|
|
|
|
+ ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
+ $('#scheduleCreateForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ let myModalSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
|
|
+ myModalSchedule.show();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- let myModalSchedule = new bootstrap.Modal(document.getElementById("copySchedule"), {});
|
|
|
|
|
- myModalSchedule.show();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ $('#ttnBtn').on('click', function () {
|
|
|
|
|
+ if ($('input.check-maf:checkbox:checked').length > 0) {
|
|
|
|
|
|
|
|
- $('#ttnBtn').on('click', function () {
|
|
|
|
|
- if ($('input.check-maf:checkbox:checked').length > 0) {
|
|
|
|
|
-
|
|
|
|
|
- let myModalTtn = new bootstrap.Modal(document.getElementById("createTtnModal"), {});
|
|
|
|
|
- myModalTtn.show();
|
|
|
|
|
- } else {
|
|
|
|
|
- customAlert('Нужно выбрать МАФ для ТН!');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- $('#createTtn').on('click', function () {
|
|
|
|
|
- let ids = Array();
|
|
|
|
|
- $('.check-maf').each(function () {
|
|
|
|
|
- if ($(this).prop('checked')) {
|
|
|
|
|
- ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
- $('#ttnForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
|
|
|
|
|
|
|
+ let myModalTtn = new bootstrap.Modal(document.getElementById("createTtnModal"), {});
|
|
|
|
|
+ myModalTtn.show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ customAlert('Нужно выбрать МАФ для ТН!');
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if (ids.length) {
|
|
|
|
|
- $('#ttnForm').submit();
|
|
|
|
|
- } else {
|
|
|
|
|
- customAlert('Нужно выбрать МАФ для ТН!');
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ $('#createTtn').on('click', function () {
|
|
|
|
|
+ let ids = Array();
|
|
|
|
|
+ $('.check-maf').each(function () {
|
|
|
|
|
+ if ($(this).prop('checked')) {
|
|
|
|
|
+ ids.push($(this).attr('data-maf-id'));
|
|
|
|
|
+ $('#ttnForm').append('<input type="hidden" name="skus[]" value="' + $(this).attr('data-maf-id') + '">');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (ids.length) {
|
|
|
|
|
+ $('#ttnForm').submit();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ customAlert('Нужно выбрать МАФ для ТН!');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ @endif
|
|
|
|
|
|
|
|
$('.update-once').on('change', function () {
|
|
$('.update-once').on('change', function () {
|
|
|
let v = $(this).val();
|
|
let v = $(this).val();
|