187 lines
8.5 KiB
Plaintext
187 lines
8.5 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.entity.work.MPointHisChangeData" %>
|
||
<%request.setAttribute("Change_Delete", MPointHisChangeData.Change_Delete);%>
|
||
<%request.setAttribute("Change_Edit", MPointHisChangeData.Change_Edit);%>
|
||
<%request.setAttribute("Change_Add", MPointHisChangeData.Change_Add);%>
|
||
<%request.setAttribute("Change_Cleaning", MPointHisChangeData.Change_Cleaning);%>
|
||
|
||
<script type="text/javascript">
|
||
var beginTimeStore2 = '';
|
||
var endTimeStore2 = '';
|
||
$(function () {
|
||
//定义locale汉化插件
|
||
beginTimeStore2 = moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm');
|
||
endTimeStore2 = moment().format('YYYY-MM-DD HH:mm');
|
||
var locale = {
|
||
"format": 'YYYY-MM-DD HH:mm',
|
||
"separator": " ~ ",
|
||
"applyLabel": "确定",
|
||
"cancelLabel": "取消",
|
||
"fromLabel": "起始时间",
|
||
"toLabel": "结束时间'",
|
||
"customRangeLabel": "自定义",
|
||
"weekLabel": "W",
|
||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||
"firstDay": 1
|
||
};
|
||
$('#reservationtime2').daterangepicker({
|
||
"timePicker": true,
|
||
"timePicker24Hour": true,
|
||
"linkedCalendars": false,
|
||
"autoUpdateInput": false,
|
||
"timePickerIncrement": 10,
|
||
"locale": locale,
|
||
//汉化按钮部分
|
||
ranges: {
|
||
'今日': [moment().subtract(1, 'days'), moment()],
|
||
'昨日': [moment().subtract(2, 'days'), moment().subtract(1, 'days')],
|
||
'最近7日': [moment().subtract(7, 'days'), moment()],
|
||
'本月': [moment().startOf('month'), moment().endOf('month')],
|
||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||
},
|
||
startDate: beginTimeStore2,
|
||
endDate: endTimeStore2
|
||
}, function (start, end, label) {
|
||
beginTimeStore2 = start.format(this.locale.format);
|
||
endTimeStore2 = end.format(this.locale.format);
|
||
if (!this.startDate) {
|
||
this.element.val('');
|
||
} else {
|
||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||
}
|
||
// doHisChangeDataSearch();
|
||
});
|
||
$('#reservationtime2').val(beginTimeStore2 + locale.separator + endTimeStore2);
|
||
|
||
inHisChangeDataTable();
|
||
})
|
||
|
||
function inHisChangeDataTable() {
|
||
$("#hisChangeDataTable").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/work/mPointHisChangeData/getList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 15, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
mpid: '${param.mpcode}',
|
||
sdt: beginTimeStore2,
|
||
edt: endTimeStore2
|
||
}
|
||
},
|
||
sortName: 'valueTime', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'valuetime', // 返回json数据中的name
|
||
title: '数据时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0, 16)
|
||
}
|
||
},
|
||
{
|
||
field: '_changepeopleName', // 返回json数据中的name
|
||
title: '修改人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},
|
||
{
|
||
field: 'changetime', // 返回json数据中的name
|
||
title: '修改时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0, 16)
|
||
}
|
||
},
|
||
{
|
||
field: 'changedata', // 返回json数据中的name
|
||
title: '修改值', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},
|
||
{
|
||
field: 'olddata', // 返回json数据中的name
|
||
title: '原始值', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},
|
||
{
|
||
field: 'id', // 返回json数据中的name
|
||
title: '类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index) {
|
||
if (value.indexOf('_${Change_Add}') == -1 ? false : true) {
|
||
return "新增";
|
||
} else if (value.indexOf('_${Change_Delete}') == -1 ? false : true) {
|
||
return "删除";
|
||
} else if (value.indexOf('${Change_Cleaning}') == -1 ? false : true) {
|
||
return "清洗";
|
||
} else {
|
||
return "修改";
|
||
}
|
||
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function () { //加载成功时执行
|
||
adjustBootstrapTableView("hisChangeDataTable");
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
}
|
||
|
||
function doHisChangeDataSearch() {
|
||
$("#hisChangeDataTable").bootstrapTable('refresh');
|
||
}
|
||
|
||
</script>
|
||
<div class="modal fade" id="hisChangeDataModal">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">历史修改数据</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal" id="subForm">
|
||
<input type="text" class="form-control pull-left" id="reservationtime2" style="width:270px">
|
||
<div class="input-group-btn pull-left">
|
||
<button type="button" class="btn btn-default" onclick="doHisChangeDataSearch();"><i
|
||
class="fa fa-search"></i> 查询
|
||
</button>
|
||
</div>
|
||
<div class="form-group ">
|
||
<div class="input-group input-group-sm">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<div id="container">
|
||
<table id="hisChangeDataTable"></table>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|