| | |
| | | , 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: '#treeCustomer', |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/PublicPageMethod/CustomerList', |
| | | 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/CustomerList', |
| | | 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/CustomerLoadTree', |
| | | 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(); |
| | | 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> |