// 初始化员工信息列表
function loadpage ( pageNum ) {
var keywords = $("#keywords").val();
$("#tbody").html("");
if ( isNaN(pageNum) ) {
pageNum = 1;
}
$.$.ajax({
type: 'GET',
url: contextPath + "/getaccountList/" + pageNum + "/" + pageSize,
dataType: 'json',
contentType: "application/json;charset='UTF-8'",
data: {
keywords: keywords
},
cache: false
success: function () {
if( data.code == 0 ){
// 系统异常
} else if (data.code == 1) {
// 成功
if ( data.data.size != 0 ) {
$("#tbody").html('');
$.each(data.data.list, function () {
$tr = $("
");$td1 = $("
").text(item.number == null ? "" : item.number);$td2 = $("
").text(item.nickName == null ? "" : item.nickName);$td3 = $("
").text(item.tel == null ? "" : item.tel);$td4 = $("
").text(item.createTime == null ? "" : item.createTime);$td5 = $("
").text(accountRole(item.roleId));$td6 = $("
").text(item.status == 0 ? "正常" : "停用");$td7 = $("
")$tdai2 = $("").addClass('iconfont icon-btn reset-pwd').attr({
"title": "重置密码",
"data-id": item-userId
}).html("�");
$td7.append(choiceStatus(item.userId, item.status, item.nickName)).append($tdai2);
$tr.append($td1).append($td2).append($td3).append($td4).append($td5).append($td6).append($td7);
//$tr.append($td1);
//$tr.append($td2);
//$tr.append($td3);
//$tr.append($td4);
//$tr.append($td5);
//$tr.append($td6);
//$tr.append($td7);
// 追加到tbody中
$("#tbody").append($tr);
});
// 初始化功能事件
initEvent(2);
} else {
// 数据为空
}
// 分页加载
createPageText(data.data);
} else if (data.code == -1) {
// 未登录
index();
}
} // success end
}) // ajax end
}