From 4c6bda1623d51605e9595d526bc00da07c11863b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 09 四月 2021 19:02:07 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/order/order.js |   45 +++++++++++++++++++++++++++------------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index 485af69..a5d4861 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -147,7 +147,7 @@
         page: true,
         limit: 16,
         limits: [16, 30, 50, 100, 200, 500],
-        toolbar: '#toolbar',
+        toolbar: '#orderToolbar',
         height: 'full-100',
         cols: [[
             {type: 'checkbox'}
@@ -202,6 +202,7 @@
         response: {
             statusCode: 200
         },
+        size: 'lg',
         done: function(res, curr, count) {
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
@@ -229,7 +230,9 @@
         if (obj.event === 'edit') { // 淇敼
             showEditModel2(obj.data);
         } else if (obj.event === 'del') { // 鍒犻櫎
-            doDel2(obj);
+            var ids = [];
+            ids.push(obj.id)
+            doDelOrder({ids: ids});
         }
     });
 
@@ -238,15 +241,15 @@
         if (obj.event === 'add') { // 娣诲姞
             showEditModel2();
         } else if (obj.event === 'del') { // 鍒犻櫎
-            var checkRows = table.checkStatus('dictDataTable');
+            var checkRows = table.checkStatus('orderTable');
             if (checkRows.data.length === 0) {
                 layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
                 return;
             }
             var ids = checkRows.data.map(function (d) {
-                return d.dictDataId;
+                return d.id;
             });
-            doDel2({ids: ids});
+            doDelOrder({ids: ids});
         }
     });
 
@@ -279,26 +282,32 @@
         });
     }
 
-    /* 鍒犻櫎2 */
-    function doDel2(obj) {
+    /* 鍒犻櫎璁㈠崟 */
+    function doDelOrder(obj) {
         layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
             skin: 'layui-layer-admin',
             shade: .1
         }, function (i) {
             layer.close(i);
             var loadIndex = layer.load(2);
-            $.get('../../json/ok.json', {
-                id: obj.data ? obj.data.dictDataId : '',
-                ids: obj.ids ? obj.ids.join(',') : ''
-            }, function (res) {
-                layer.close(loadIndex);
-                if (200 === res.code) {
-                    layer.msg(res.msg, {icon: 1});
-                    insTb2.reload({page: {curr: 1}});
-                } else {
-                    layer.msg(res.msg, {icon: 2});
+            $.ajax({
+                url: baseUrl+"/orders/delete/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data: {ids: obj.ids},
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200){
+                        layer.msg(res.msg, {icon: 1});
+                        $(".layui-laypage-btn")[0].click();
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    }else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
                 }
-            }, 'json');
+            })
+
         });
     }
 

--
Gitblit v1.9.1