From 5a150aa2c975060b036336ad7f90be24ee6ad83f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 16 九月 2022 15:26:05 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/cstmr/cstmr.js |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index 70fd30e..f0c6e81 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -1,5 +1,6 @@
 var pageCurr;
 var pageCount = 0;
+var treeCond;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).extend({
@@ -16,8 +17,11 @@
     var tree = layui.tree;
     var dropdown = layui.dropdown;
 
+    $('#organization').text(localStorage.getItem('nickname'));
+
+    // 閮ㄩ棬浜哄憳 绛涢��
     dropdown.render({
-        elem: '#slrassa'
+        elem: '#organization'
         ,content: ['<div id="organizationTree" style="height: calc(100vh - 525px);border: none"></div>'].join('')
         ,style: 'width: 370px; height: 500px; padding: 0 15px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);'
         ,ready: function(){
@@ -25,9 +29,25 @@
         }
     });
 
+    // 鏁版嵁鍚屾
+    dropdown.render({
+        elem: '#data-btn'
+        ,align: 'center' //灞呬腑瀵归綈锛�2.6.8 鏂板锛�
+        ,style: 'width: 50px;'
+        ,data: [{
+            title: 'menu item test 111'
+            ,id: 100
+        },{
+            title: 'menu item test 222'
+            ,id: 101
+        },{
+            title: 'menu item test 333'
+            ,id: 102
+        }]
+    });
+
     // 鏍戝舰鍥�
     var organizationTree;
-    var selObj;
     window.loadTree = function(condition){
         var loadIndex = layer.load(2);
         $.ajax({
@@ -46,10 +66,14 @@
                         onlyIconControl: true,
                         data: res.data,
                         click: function (obj) {
-                            console.log(obj)
-                            selObj = obj;
+                            treeCond = {
+                                key: obj.data.key,
+                                val: obj.data.id
+                            }
+                            $('#organization').text(obj.data.title);
                             $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click');
                             $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click');
+                            clearFormVal($('#search-box'));
                             tableIns.reload({
                                 where: {[obj.data.key]: obj.data.id},
                                 page: {curr: 1}
@@ -87,9 +111,9 @@
             ,{field: 'addr', align: 'left',title: '璇︾粏鍦板潃', templet:function(d){return emptyShow(d.addr)}}
             ,{field: 'tel', align: 'left',title: '鐢佃瘽', templet:function(d){return emptyShow(d.tel)}}
             ,{field: 'remarks', align: 'left',title: '澶囨敞', templet:function(d){return emptyShow(d.remarks)}}
-            ,{field: 'createTime$', align: 'left',title: '娣诲姞鏃堕棿'}
-            ,{field: 'userId$', align: 'left',title: '娣诲姞浜哄憳'}
             ,{field: 'cstmrType$', align: 'left',title: '瀹㈡埛绫诲埆'}
+            ,{field: 'userId$', align: 'left',title: '娣诲姞浜哄憳'}
+            ,{field: 'createTime$', align: 'left',title: '娣诲姞鏃堕棿'}
             ,{field: 'deptId$', align: 'left',title: '鎵�灞為儴闂�', hide: true}
             ,{field: 'simple', align: 'left',title: '瀹㈡埛绠�绉�', hide: true}
             ,{field: 'rela', align: 'left',title: '瀹㈡埛鍏崇郴', hide: true}
@@ -263,6 +287,7 @@
     // 鎼滅储
     form.on('submit(search)', function (data) {
         pageCurr = 1;
+        pageCount = 0;
         tableReload();
     });
 
@@ -297,8 +322,7 @@
             itemHeight: '250px',
             filterable: true,
             onChange: function (values, data) {
-                // console.log(values);
-                // console.log(data);
+                // console.log(values);console.log(data);
             }
         });
     }
@@ -316,6 +340,9 @@
         $.each($('#search-box [name]').serializeArray(), function() {
             searchData[this.name] = this.value;
         });
+        if (treeCond) {
+            searchData[treeCond.key] = treeCond.val;
+        }
         tableIns.reload({
             where: searchData,
             page: {curr: pageCurr}

--
Gitblit v1.9.1