Commit a127b7f2 by liuyongshuai

修改查询的bug

parent a579aecd
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
layui.use('table', function () { layui.use('table', function () {
var table = layui.table; var table = layui.table;
//方法级渲染 //方法级渲染
table.render({ var tableIns = table.render({
id: "id", id: "id",
elem: '#userTable', elem: '#userTable',
limit: 50,//默认采用10 limit: 50,//默认采用10
...@@ -350,35 +350,39 @@ ...@@ -350,35 +350,39 @@
}, },
height: 319 height: 319
}); });
var $ = layui.$, active = { $('.queryUserList').on('click', function () {
reload: function () { //这里以搜索为例
var username = cheNull($('#username').val()); var username = cheNull($('#username').val());
var trueName = cheNull($('#trueName').val()); var trueName = cheNull($('#trueName').val());
var openFlag = cheNull($('#openFlag').val()); var openFlag = cheNull($('#openFlag').val());
var policemanid = cheNull($('#policemanid').val()); var policemanid = cheNull($('#policemanid').val());
var unitcode = cheNull($('#unitcode').val()); var unitcode = cheNull($('#unitcode').val());
var roleName = cheNull($('#roleName').val()); var roleName = cheNull($('#roleName').val());
table.reload('testReload', { tableIns.reload({
where: { where: {
username: username, username: username,
trueName: trueName, trueName: trueName,
openFlag: openFlag, openFlag:openFlag,
policemanid: policemanid, policemanid:policemanid,
unitcode: unitcode, unitcode:unitcode,
roleName: roleName roleName:roleName
}, },
page: { page: {
curr: 1 //重新从第 1 页开始 curr: 1 //重新从第 1 页开始
}, },
done: function (res, curr, count) { done: function(res, curr, count){
this.where = {}; console.log("进入2层")
console.log(unitcode+";"+roleName);
this.where={
username: username,
trueName: trueName,
openFlag:openFlag,
policemanid:policemanid,
unitcode:unitcode,
roleName:roleName
};
} }
}); });
}
};
$('.queryUserList').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
}); });
}); });
function cheNull(str) { function cheNull(str) {
......
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
layui.use('table', function(){ layui.use('table', function(){
var table = layui.table; var table = layui.table;
//方法级渲染 //方法级渲染
table.render({ var tableIns = table.render({
id:"id", id:"id",
elem: '#userTable', elem: '#userTable',
limit: 50 ,//默认采用10 limit: 50 ,//默认采用10
...@@ -254,16 +254,15 @@ ...@@ -254,16 +254,15 @@
height: 480 height: 480
}); });
$('.queryUserList').on('click', function(){
var $ = layui.$, active = { //这里以搜索为例
reload: function(){
var username = cheNull($('#username').val()); var username = cheNull($('#username').val());
var trueName = cheNull($('#trueName').val()); var trueName = cheNull($('#trueName').val());
var openFlag = cheNull($('#openFlag').val()); var openFlag = cheNull($('#openFlag').val());
var policemanid = cheNull($('#policemanid').val()); var policemanid = cheNull($('#policemanid').val());
var unitcode = cheNull($('#unitcode').val()); var unitcode = cheNull($('#unitcode').val());
var roleName = cheNull($('#roleName').val()); var roleName = cheNull($('#roleName').val());
table.reload('testReload', { tableIns.reload({
where: { where: {
username: username, username: username,
trueName: trueName, trueName: trueName,
...@@ -276,15 +275,18 @@ ...@@ -276,15 +275,18 @@
curr: 1 //重新从第 1 页开始 curr: 1 //重新从第 1 页开始
}, },
done: function(res, curr, count){ done: function(res, curr, count){
this.where={}; console.log("进入2层")
console.log(unitcode+";"+roleName);
this.where={
username: username,
trueName: trueName,
openFlag:openFlag,
policemanid:policemanid,
unitcode:unitcode,
roleName:roleName
};
} }
}); });
}
};
$('.queryUserList').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
}); });
}); });
function cheNull(str) { function cheNull(str) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment