var example = null; var pers = null; var submitBatchNo = localStorage.getItem("submitBatchNo"); layui.use(['layer'], function () { var layer = layui.layer; var form = layui.form; pers = checkPermission(); init(); $("#searchBt").click(function () { example.ajax.reload(); }); }); function init() { example = $('#dt-table').DataTable({ "sort": false, "searching": false, "processing": true, //加载数据时显示进度状态 "serverSide": true, "pagingType": "full_numbers", //首页|尾页 "language": { "url": contentPath + "/js/plugin/datatables/Chinese.lang" }, "ajax": { "url": ctxPath + "/uploadPayroll/getPersonDetails", "type": "post", "data": function (d) { d.keyWord = $("#keyword").val(); d.submitBatchNo = submitBatchNo; }, "error": function (xhr, textStatus, errorThrown) { var msg = xhr.responseText; console.log(msg); var response = JSON.parse(msg); var code = response.code; var message = response.message; if (code == 400) { layer.msg(message); } else if (code == 401) { localStorage.removeItem("token"); layer.msg("token过期,请先登录", {shift: -1, time: 1000}, function () { location.href = ctxPath + '/login.html'; }); } else if (code == 403) { console.log("未授权:" + message); layer.msg('未授权'); } else if (code == 500) { console.log('系统错误:' + message); } } }, "drawCallback": function() { // alert( '表格重绘了' ); var thisDataTable = $('#dt-table').DataTable(); $(".pagination").append("