| | |
| | | <div class="layui-col-xs3 layui-inline" style="width: 23%;"> |
| | | <div id="treeUser" lay-filter="treeUser" class="demo-tree demo-tree-box" style="height: 580px; overflow: scroll;"></div> |
| | | </div> |
| | | <div class="layui-col-xs9 layui-inline"> |
| | | <div class="layui-col-xs9 layui-inline" style="width: 74%;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">代码</label> |
| | |
| | | , laydate = layui.laydate |
| | | , util = layui.util |
| | | , tree = layui.tree |
| | | var sWhere = " where HStopFlag=0 and HUSEORGID = " + sessionStorage["OrganizationID"] + " "; |
| | | var sWhere = " where HStopFlag=0 and HEndFlag<>'1' and HUSEORGID = " + sessionStorage["OrganizationID"] + " "; //树型 |
| | | var sWhere1 = " where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + sessionStorage["OrganizationID"] + " "; //列表 |
| | | |
| | | tree.render({ |
| | | elem: '#treeUser', |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/PublicPageMethod/UserList', |
| | | type: "GET", |
| | | data: { "sWhere": SeachFilter(sWhere) }, |
| | | data: { "sWhere": SeachFilter(sWhere1) }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/PublicPageMethod/UserList', |
| | | type: "GET", |
| | | data: { "sWhere": SeachFilter(sWhere) }, |
| | | data: { "sWhere": SeachFilter(sWhere1) }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | |
| | | layer.alert("接口请求失败!", { icon: 5 }); |
| | | } |
| | | }); |
| | | sWhere = "";//调用接口后清空sWhere缓存 |
| | | sWhere1 = "";//调用接口后清空sWhere缓存 |
| | | }); |
| | | |
| | | //以上是layui模块 |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_MaintenanceMode/UserLoadTree', |
| | | type: "GET", |
| | | data: { "sWhere": SeachFilter(sWhere) }, |
| | | data: { "sWhere": sWhere }, |
| | | async: false, |
| | | success: function (result) { |
| | | var data = result.data; |
| | |
| | | return treeData; |
| | | } |
| | | |
| | | function SeachFilter(sWhere) |
| | | function SeachFilter(sWhere1) |
| | | { |
| | | var HNumber = $("#HNumber").val(); |
| | | var HName = $("#HName").val(); |
| | | sWhere1 = " where 1=1 "; |
| | | if (HNumber) { |
| | | sWhere += " and HNumber like '%" + HNumber + "%'"; |
| | | sWhere1 += " and HNumber like '%" + HNumber + "%'"; |
| | | } |
| | | if (HName) { |
| | | sWhere += " and HName like '%" + HName + "%'"; |
| | | sWhere1 += " and HName like '%" + HName + "%'"; |
| | | } |
| | | return sWhere; |
| | | return sWhere1; |
| | | } |
| | | |
| | | </script> |