فهرست منبع

20250207 优化调整

贾小兵 2 ماه پیش
والد
کامیت
b27219c4f5
1فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 11 2
      public/assets/js/backend/student/collection.js

+ 11 - 2
public/assets/js/backend/student/collection.js

@@ -141,6 +141,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
             $(document).on('click', '.btn-replace', function () {
                 console.log($(".other_replace").val());
+                if($(".other_replace").val()=='[{"fault_id":"","request_status":"0"}]'){
+                    Layer.alert('请先填写更换件');
+                    return false;
+                }
                 $.ajax({
                     url: "student/collection/replace/ids/"+Config.ids,
                     type: 'post',
@@ -150,8 +154,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     },
                     success: function (data) {
                         if(data.code==1){
-                            Layer.alert(data.msg);
-                            window.location.reload();
+                            Layer.alert(data.msg, {
+                                btn: ['确定'], // 或者直接使用默认的确定按钮
+                                yes: function(index, layero){
+                                    // 刷新页面
+                                    window.location.reload();
+                                }
+                            });
                         }
                         if(data.code==0){
                             Layer.alert(data.msg);