/** * 综合查询 * */ $(function() { $('.tool_bars').authorizeButton(); //省市二级联动 helper.getDropList.getProLocation($('#sc_province'), $('#sc_city')); //工单来源 helper.getDropList.getlistDropByDic($('#sc_source'), 'GDLY'); //工单类型 helper.getDropList.getlistDropByDic($('#sc_type'), 'GDLX'); laydate.render({ elem: '#sc_times', range: '~', theme: '#249fea', }); initTable(); //搜索 $("#sc_btns").click(function() { initTable(); }); }); function initTable() { //先销毁表格 $('#table_all').bootstrapTable('destroy'); //初始化表格,动态从服务器加载数据 $('#table_all').bootstrapTable({ method: "get", //使用get请求到服务器获取数据 url: huayi.config.callcenter_url + "callcenterapi/api/BusOrder/getlistbypage", //获取数据的Servlet地址 contentType: "application/x-www-form-urlencoded", striped: true, //表格显示条纹 pagination: true, //启动分页 pageSize: 10, //每页显示的记录数 pageNumber: 1, //当前第几页 pageList: [10, 20, 50, 100], //记录数可选列表 search: false, //是否启用查询 showColumns: false, //显示下拉框勾选要显示的列 showRefresh: false, //显示刷新按钮 sidePagination: "server", //表示服务端请求 //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder //设置为limit可以获取limit, offset, search, sort, order queryParamsType: "undefined", queryParams: function queryParams(params) { //设置查询参数 var param = { pageindex: params.pageNumber, //int 页码 pagesize: params.pageSize, //int 条数 ordercode: $('#sc_ordercode').val(), // 否 string 模糊查询(工单编号) phone: $('#sc_tel').val(), // 否 string 模糊查询(号码) province: $('#sc_province').val(), // 否 string 省code citycode: $('#sc_city').val(), // 否 string 市code sourceid: $('#sc_source').val(), // 否 string 来源id typeid: $('#sc_type').val(), // 否 string 类型id stime: $('#sc_times').val() && $('#sc_times').val().split(' ~ ')[0], //开始时间 etime: $('#sc_times').val() && $('#sc_times').val().split(' ~ ')[1], //结束时间 //key 否 string 模糊查询(工单标题内容) }; return param; }, responseHandler: function(res) { return { "total": res.data && res.data.total, //总页数 "rows": res.data && res.data.rows //数据 }; }, onLoadSuccess: function(res) { //加载成功时执行 //layer.msg("加载成功"); $('.tool_downs').authorizeOperateButton(); }, onLoadError: function() { //加载失败时执行 //layer.msg("加载数据失败", { time: 1500, icon: 2 }); } }); } //格式化操作 function formatterOperate(val, row) { return '
'; } //格式化地址 function formatterAddress(val, row) { var locations = ''; var address = ''; if(val){ locations = val + row.cityname; } if(row.address){ address = row.address; } return locations + address; } //格式化内容 function formatterContent(val, row) { if(val) { var codeContent = decodeURIComponent(val); codeContent = helper.filter.delHtmlTag(codeContent); codeContent = $.trim(codeContent); var cc = codeContent.length > 20 ? codeContent.substr(0, 20) + '...' : codeContent; return '