99 lines
4.3 KiB
JavaScript
99 lines
4.3 KiB
JavaScript
|
|
/**
|
|||
|
|
* 加载绩效附表
|
|||
|
|
*/
|
|||
|
|
function getMaintenance4EquipmentCard(type, equipmentId) {
|
|||
|
|
$("#table_maintain").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/workorder/workorderDetail/getlist.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
type: type,
|
|||
|
|
equipmentId: equipmentId,
|
|||
|
|
status: '1'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
onClickRow: function (row) {//单击行事件,执行查看功能
|
|||
|
|
viewMaintainFun(row.id);
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
/*{
|
|||
|
|
field: 'number',
|
|||
|
|
title: '序号',
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
width: '5%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var pageSize = $('#table_maintain').bootstrapTable('getOptions').pageSize;//通过表的#id 可以得到每页多少条
|
|||
|
|
var pageNumber = $('#table_maintain').bootstrapTable('getOptions').pageNumber;//通过表的#id 可以得到当前第几页
|
|||
|
|
return pageSize * (pageNumber - 1) + index + 1; //返回每条的序号: 每页条数 * (当前页 - 1 )+ 序号
|
|||
|
|
}
|
|||
|
|
},*/
|
|||
|
|
{
|
|||
|
|
field: 'jobNumber', // 返回json数据中的name
|
|||
|
|
title: '工单号', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '25%',
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'planDate', // 返回json数据中的name
|
|||
|
|
title: '计划时间', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '20%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return value.substring(0, 10);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'schemeResume', // 返回json数据中的name
|
|||
|
|
title: '保养内容', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '25%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' title='" + value + "'>" + value + "</span>";
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'user.caption', // 返回json数据中的name
|
|||
|
|
title: '保养人员', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '15%'
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'repairDate', // 返回json数据中的name
|
|||
|
|
title: '保养时间', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '15%',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
return value.substring(0, 19);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_maintain");
|
|||
|
|
console.info("加载数据成功");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
|