From 901b2ab3e0e7c592602848cfa256f34c5b0c7bb8 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 11 一月 2024 09:57:01 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/webapp/static/js/user/user.js |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/zy-asrs-wms/src/main/webapp/static/js/user/user.js b/zy-asrs-wms/src/main/webapp/static/js/user/user.js
index 0e06c7e..92c751a 100644
--- a/zy-asrs-wms/src/main/webapp/static/js/user/user.js
+++ b/zy-asrs-wms/src/main/webapp/static/js/user/user.js
@@ -23,14 +23,14 @@
         height: 'full-100',
         cols: [[
             {type: 'checkbox'}
-            // ,{field: 'hostName', align: 'center',title: '鎺堟潈鍟嗘埛', templet: '#hostTpl', width: 140}
+            ,{field: 'hostName', align: 'center',title: '鎺堟潈鍟嗘埛', templet: '#hostTpl', width: 140}
             // ,{field: 'nickname', align: 'center',title: '鐢ㄦ埛鍚�'}
-            ,{field: 'username', align: 'center',title: '鐧诲綍璐︽埛'}
             ,{field: 'mobile', align: 'center',title: '鎵嬫満鍙�'}
+            ,{field: 'username', align: 'center',title: '鐢ㄦ埛鍚�'}
             // ,{field: 'deptName', align: 'center',title: '鎵�灞為儴闂�'}
             ,{field: 'roleName', align: 'center',title: '瑙掕壊'}
             ,{field: 'email', align: 'center',title: '閭'}
-            // ,{field: 'sex$', align: 'center',title: '鎬у埆'}
+            ,{field: 'sex$', align: 'center',title: '鎬у埆'}
             ,{field: 'createTime$', align: 'center',title: '娉ㄥ唽鏃堕棿', hide: true}
             ,{field: 'status$', align: 'center',title: '鐘舵��', templet: '#statusTpl', width: 120, unresize: true}
 
@@ -68,17 +68,18 @@
 
     /* 琛ㄦ牸2澶村伐鍏锋爮鐐瑰嚮浜嬩欢 */
     table.on('toolbar(userTable)', function (obj) {
-        var checkStatus = table.checkStatus(obj.config.id).data;
         if (obj.event === 'add') { // 娣诲姞
             showEditModel()
         } else if (obj.event === 'del') { // 鍒犻櫎
-            if (checkStatus.length === 0) {
+            var checkRows = table.checkStatus('userTable');
+            if (checkRows.data.length === 0) {
                 layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
                 return;
             }
-            del(checkStatus.map(function (d) {
+            var ids = checkRows.data.map(function (d) {
                 return d.id;
-            }));
+            });
+            doDelUser({ids: ids});
         }
     });
 
@@ -102,7 +103,8 @@
                 break;
             // 鍒犻櫎
             case 'del':
-                del([data.id]);
+                var ids = [obj.id];
+                doDelUser({ids: ids});
                 break;
             // 閲嶇疆瀵嗙爜
             case 'resetPwd':
@@ -169,7 +171,7 @@
 
 
     /* 鍒犻櫎璁㈠崟 */
-    function del(ids) {
+    function doDelUser(obj) {
         layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
             skin: 'layui-layer-admin',
             shade: .1
@@ -179,7 +181,7 @@
             $.ajax({
                 url: baseUrl+"/user/delete/auth",
                 headers: {'token': localStorage.getItem('token')},
-                data: {ids: ids},
+                data: {ids: obj.ids},
                 method: 'POST',
                 success: function (res) {
                     layer.close(loadIndex);

--
Gitblit v1.9.1