From fb956dcec6d4ae9417913ab828d3897c87cdf996 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 01 十一月 2022 10:32:03 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/entity/BasSte.java |    7 +++++++
 src/main/webapp/views/basSte/basSte.html     |    4 ++++
 src/main/webapp/static/js/basSte/basSte.js   |   11 ++++++++++-
 src/main/resources/mapper/BasSteMapper.xml   |    1 +
 4 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/BasSte.java b/src/main/java/com/zy/asrs/entity/BasSte.java
index cd557b1..e5425e6 100644
--- a/src/main/java/com/zy/asrs/entity/BasSte.java
+++ b/src/main/java/com/zy/asrs/entity/BasSte.java
@@ -126,6 +126,13 @@
     private String pakMk;
 
     /**
+     * 鑷姩鍏呯數
+     */
+    @ApiModelProperty(value= "鑷姩鍏呯數")
+    @TableField("auto_charge")
+    private String autoCharge;
+
+    /**
      * 鏈�浣庣數閲�
      */
     @ApiModelProperty(value= "鏈�浣庣數閲�")
diff --git a/src/main/resources/mapper/BasSteMapper.xml b/src/main/resources/mapper/BasSteMapper.xml
index faad74e..2d23912 100644
--- a/src/main/resources/mapper/BasSteMapper.xml
+++ b/src/main/resources/mapper/BasSteMapper.xml
@@ -19,6 +19,7 @@
         <result column="idle_loc" property="idleLoc" />
         <result column="ste_err" property="steErr" />
         <result column="pak_mk" property="pakMk" />
+        <result column="auto_charge" property="autoCharge" />
         <result column="charge_line" property="chargeLine" />
         <result column="status" property="status" />
         <result column="create_by" property="createBy" />
diff --git a/src/main/webapp/static/js/basSte/basSte.js b/src/main/webapp/static/js/basSte/basSte.js
index 9239199..45397a8 100644
--- a/src/main/webapp/static/js/basSte/basSte.js
+++ b/src/main/webapp/static/js/basSte/basSte.js
@@ -39,7 +39,7 @@
             ,{field: 'idleLoc', align: 'center',title: '鏆傚瓨搴撲綅'}
             ,{field: 'steErr', align: 'center',title: '閿欒鐮�'}
             ,{field: 'chargeLine', align: 'center',title: '鏈�浣庣數閲�%'}
-            ,{field: 'pakMk', align: 'center',title: '鏍囪', hide: true}
+            ,{field: 'autoCharge', align: 'center',title: '鑷姩鍏呯數', templet: '#autoChargeTpl'}
             // ,{field: 'status$', align: 'center',title: '鐘舵��'}
             // ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
             // ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
@@ -106,6 +106,15 @@
         })
     })
 
+    form.on('switch(autoChargeSwitch)', 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, autoCharge: 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;
diff --git a/src/main/webapp/views/basSte/basSte.html b/src/main/webapp/views/basSte/basSte.html
index 0a97472..c3bc82a 100644
--- a/src/main/webapp/views/basSte/basSte.html
+++ b/src/main/webapp/views/basSte/basSte.html
@@ -68,6 +68,10 @@
     <input type="checkbox" name="outEnable" value="{{d.outEnable}}" lay-skin="switch" lay-text="鎵撳紑|鍏抽棴" lay-filter="outEnableSwitch" {{ d.outEnable === 'Y' ? 'checked' : '' }}>
 </script>
 
+<script type="text/html" id="autoChargeTpl">
+    <input type="checkbox" name="autoCharge" value="{{d.autoCharge}}" lay-skin="switch" lay-text="鎵撳紑|鍏抽棴" lay-filter="autoChargeSwitch" {{ d.autoCharge === 'Y' ? 'checked' : '' }}>
+</script>
+
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>

--
Gitblit v1.9.1