瀏覽代碼

ttn button and form

Alexander Musikhin 2 月之前
父節點
當前提交
56718b9572
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. 10 3
      resources/views/orders/show.blade.php

+ 10 - 3
resources/views/orders/show.blade.php

@@ -276,9 +276,7 @@
                                   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>
+                            <a href="#" class="btn btn-primary btn-sm mb-1" id="ttnBtn">ТТН</a>
                         </div>
                     @endif
                 </div>
@@ -391,6 +389,15 @@
             }
         });
 
+        $('#ttnBtn').on('click', function () {
+            if ($('input.check-maf:checkbox:checked').length > 0) {
+                let myModalTtn = new bootstrap.Modal(document.getElementById("createTtnModal"), {});
+                myModalTtn.show();
+            } else {
+                alert('Нужно выбрать МАФ для ТТН!');
+            }
+        });
+
         $('#createTtn').on('click', function () {
             let ids = Array();
             $('.check-maf').each(function () {