|
|
@@ -276,6 +276,9 @@
|
|
|
class="visually-hidden" id="create-reclamation-form">
|
|
|
@csrf
|
|
|
</form>
|
|
|
+ <button class="btn btn-primary btn-sm mb-1" data-bs-toggle="modal"
|
|
|
+ data-bs-target="#createTtnModal">ТТН
|
|
|
+ </button>
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
@@ -284,6 +287,28 @@
|
|
|
</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">
|
|
|
+ <a href="#" class="btn btn-primary" id="createTtn">Создать ТТН</a>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- Модальное окно переноса -->
|
|
|
<div class="modal fade" id="moveModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
|
@@ -364,9 +389,23 @@
|
|
|
if (ids.length) {
|
|
|
$('#create-reclamation-form').submit();
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
|
|
|
+ $('#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 {
|
|
|
+ alert('Нужно выбрать МАФ для ТТН!');
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
</script>
|
|
|
@endpush
|