From 1b865a2506b228b4b0b034bac97658072213a26b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期一, 11 七月 2022 11:08:35 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/basSte/basSte.js |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/static/js/basSte/basSte.js b/src/main/webapp/static/js/basSte/basSte.js
index f84e678..9b621ed 100644
--- a/src/main/webapp/static/js/basSte/basSte.js
+++ b/src/main/webapp/static/js/basSte/basSte.js
@@ -1,4 +1,5 @@
 var pageCurr;
+var tableData;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).use(['table','laydate', 'form', 'admin'], function(){
@@ -23,8 +24,8 @@
         cols: [[
             {type: 'checkbox'}
             ,{field: 'steNo', align: 'center',title: '绌挎杞﹀彿'}
-            ,{field: 'inEnable', align: 'center',title: '鍙叆'}
-            ,{field: 'outEnable', align: 'center',title: '鍙嚭'}
+            ,{field: 'inEnable', align: 'center',title: '鍙叆', templet: '#inEnableTpl'}
+            ,{field: 'outEnable', align: 'center',title: '鍙嚭', templet: '#outEnableTpl'}
             ,{field: 'steSts', align: 'center',title: '浣滀笟鎬�'}
             ,{field: 'wrkNo', align: 'center',title: '浠诲姟鍙�'}
             ,{field: 'crnNo', align: 'center',title: '鍫嗗灈鏈哄彿'}
@@ -65,6 +66,7 @@
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
             }
+            tableData = table.cache.basSte;
             pageCurr=curr;
             limit();
         }
@@ -84,6 +86,24 @@
         });
     });
 
+    form.on('switch(inEnableSwitch)', function (obj) {
+        let index  = obj.othis.parents('tr').attr("data-index");
+        let data = tableData[index];
+        data[this.name] = obj.elem.checked?'Y':'N';
+        http.post(baseUrl+"/basSte/update/auth", {steNo: data.steNo, inEnable: data[this.name]}, function (res) {
+            layer.msg(res.msg, {icon: 1});
+        })
+    })
+
+    form.on('switch(outEnableSwitch)', function (obj) {
+        let index  = obj.othis.parents('tr').attr("data-index");
+        let data = tableData[index];
+        data[this.name] = obj.elem.checked?'Y':'N';
+        http.post(baseUrl+"/basSte/update/auth", {steNo: data.steNo, outEnable: data[this.name]}, function (res) {
+            layer.msg(res.msg, {icon: 1});
+        })
+    })
+
     // 鐩戝惉澶村伐鍏锋爮浜嬩欢
     table.on('toolbar(basSte)', function (obj) {
         var checkStatus = table.checkStatus(obj.config.id).data;

--
Gitblit v1.9.1