From 2efa12f4d0d52e555b4cdab1e9a258587ddcfe92 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期一, 12 九月 2022 16:32:40 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/cstmr/cstmr.js |  125 ++++++++++++++---------------------------
 1 files changed, 42 insertions(+), 83 deletions(-)

diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index 90696ef..c872b33 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -1,13 +1,16 @@
 var pageCurr;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin'], function(){
+}).extend({
+    dropdown: 'dropdown/dropdown',
+}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown', 'element'], function(){
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
     var admin = layui.admin;
+    var xmSelect = layui.xmSelect;
 
     // 鏁版嵁娓叉煋
     tableIns = table.render({
@@ -17,36 +20,37 @@
         page: true,
         limit: 15,
         limits: [15, 30, 50, 100, 200, 500],
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
+        cellMinWidth: 100,
         height: 'full-120',
+        // size: 'sm',
+        skin: 'line',
         cols: [[
             {type: 'checkbox'}
             // ,{field: 'id', align: 'center',title: 'ID'}
             // ,{field: 'hostId$', align: 'center',title: '鎵�灞炲晢鎴�'}
-            ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�', hide: true}
-            ,{field: 'userId$', align: 'center',title: '鎵�灞炰汉鍛�'}
-            ,{field: 'cstmrType$', align: 'center',title: '瀹㈡埛绫诲埆'}
-            ,{field: 'uuid', align: 'center',title: '瀹㈡埛浠e彿'}
             ,{field: 'name', align: 'center',title: '瀹㈡埛鍚嶇О'}
-            ,{field: 'simple', align: 'center',title: '瀹㈡埛绠�绉�', hide: true}
-            ,{field: 'rela', align: 'center',title: '瀹㈡埛鍏崇郴'}
+            ,{field: 'uuid', align: 'center',title: '瀹㈡埛浠e彿'}
+            ,{field: 'addr', align: 'center',title: '璇︾粏鍦板潃'}
             ,{field: 'tel', align: 'center',title: '鐢佃瘽'}
-            ,{field: 'contacts', align: 'center',title: '瀹㈡埛鑱旂郴浜�'}
-            ,{field: 'remarks', align: 'center',title: '澶囨敞', hide: true}
-            ,{field: 'director$', align: 'center',title: '璐熻矗浜�'}
+            ,{field: 'remarks', align: 'center',title: '澶囨敞'}
+            ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
+            ,{field: 'userId$', align: 'center',title: '娣诲姞浜哄憳'}
+            ,{field: 'cstmrType$', align: 'center',title: '瀹㈡埛绫诲埆'}
+            ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�', hide: true}
+            ,{field: 'simple', align: 'center',title: '瀹㈡埛绠�绉�', hide: true}
+            ,{field: 'rela', align: 'center',title: '瀹㈡埛鍏崇郴', hide: true}
+            ,{field: 'contacts', align: 'center',title: '瀹㈡埛鑱旂郴浜�', hide: true}
+            ,{field: 'director$', align: 'center',title: '璐熻矗浜�', hide: true}
             ,{field: 'province', align: 'center',title: '鐪�', hide: true}
             ,{field: 'city', align: 'center',title: '甯�', hide: true}
             ,{field: 'district', align: 'center',title: '鍘�', hide: true}
             ,{field: 'town', align: 'center',title: '闀�', hide: true}
-            ,{field: 'addr', align: 'center',title: '璇︾粏鍦板潃'}
-            ,{field: 'type$', align: 'center',title: '鍖哄垎'}
+            ,{field: 'type$', align: 'center',title: '鍖哄垎', hide: true}
             ,{field: 'files', align: 'center',title: '闄勪欢', hide: true}
             ,{field: 'status$', align: 'center',title: '鐘舵��', hide: true}
-            ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳', hide: true}
-            ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿', hide: true}
-            ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
-            ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
+            // ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳', hide: true}
+            ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳', hide: true}
+            ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿', hide: true}
             ,{field: 'memo', align: 'center',title: '娉ㄩ噴', hide: true}
 
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
@@ -75,6 +79,24 @@
         }
     });
 
+    // 娣诲姞
+    $("#cstmrAddBtn").click(function () {
+        showEditModel();
+    });
+
+    // 鍒犻櫎
+    form.on('submit(cstmrDel)', function (data) {
+        let checkStatus = layui.table.checkStatus('cstmr').data;
+        if (checkStatus.length === 0) {
+            layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+            return;
+        }
+        del(checkStatus.map(function (d) {
+            return d.id;
+        }));
+    });
+
+
     // 鐩戝惉鎺掑簭浜嬩欢
     table.on('sort(cstmr)', function (obj) {
         var searchData = {};
@@ -89,62 +111,6 @@
         });
     });
 
-    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
-    table.on('toolbar(cstmr)', function (obj) {
-        var checkStatus = table.checkStatus(obj.config.id).data;
-        switch(obj.event) {
-            case 'addData':
-                showEditModel();
-                break;
-            case 'deleteData':
-               if (checkStatus.length === 0) {
-                   layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
-                   return;
-               }
-               del(checkStatus.map(function (d) {
-                   return d.id;
-               }));
-               break;
-            case 'exportData':
-                admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
-                    var titles=[];
-                    var fields=[];
-                    obj.config.cols[0].map(function (col) {
-                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
-                            titles.push(col.title);
-                            fields.push(col.field);
-                        }
-                    });
-                    var exportData = {};
-                    $.each($('#search-box [name]').serializeArray(), function() {
-                        exportData[this.name] = this.value;
-                    });
-                    var param = {
-                        'cstmr': exportData,
-                        'fields': fields
-                    };
-                    $.ajax({
-                        url: baseUrl+"/cstmr/export/auth",
-                        headers: {'token': localStorage.getItem('token')},
-                        data: JSON.stringify(param),
-                        dataType:'json',
-                        contentType:'application/json;charset=UTF-8',
-                        method: 'POST',
-                        success: function (res) {
-                            layer.closeAll();
-                            if (res.code === 200) {
-                                table.exportFile(titles,res.data,'xls');
-                            } else if (res.code === 403) {
-                                top.location.href = baseUrl+"/";
-                            } else {
-                                layer.msg(res.msg, {icon: 2})
-                            }
-                        }
-                    });
-                });
-                break;
-        }
-    });
 
     // 鐩戝惉琛屽伐鍏蜂簨浠�
     table.on('tool(cstmr)', function(obj){
@@ -163,8 +129,8 @@
     function showEditModel(mData) {
         admin.open({
             type: 1,
-            area: '600px',
-            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+            area: '1500px',
+            title: (mData ? '淇敼' : '娣诲姞') + '鐢叉柟鍗曚綅',
             content: $('#editDialog').html(),
             success: function (layero, dIndex) {
                 layDateRender(mData);
@@ -228,13 +194,6 @@
     // 鎼滅储
     form.on('submit(search)', function (data) {
         pageCurr = 1;
-        tableReload(false);
-    });
-
-    // 閲嶇疆
-    form.on('submit(reset)', function (data) {
-        pageCurr = 1;
-        clearFormVal($('#search-box'));
         tableReload(false);
     });
 

--
Gitblit v1.9.1