first commit
This commit is contained in:
161
WebRoot/jsp/timeefficiency/patrolPlanCancelList.jsp
Normal file
161
WebRoot/jsp/timeefficiency/patrolPlanCancelList.jsp
Normal file
@ -0,0 +1,161 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<% request.setAttribute("PatrolPlan_Weekly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Weekly); %>
|
||||
<% request.setAttribute("PatrolPlan_Daily", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Daily); %>
|
||||
<% request.setAttribute("PatrolPlan_Monthly", com.sipai.entity.timeefficiency.TimeEfficiencyCommStr.PatrolPlan_Monthly); %>
|
||||
|
||||
<% request.setAttribute("Last_Day", com.sipai.entity.timeefficiency.PatrolPlan.Last_Day); %>
|
||||
|
||||
<!-- bootstrap switch -->
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||
charset="utf-8"></script>
|
||||
|
||||
<!-- 拖拽排序-->
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-table/jquery.tablednd.js"
|
||||
charset="utf-8"></script>
|
||||
<script type="text/javascript"
|
||||
src="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js"
|
||||
charset="utf-8"></script>
|
||||
<link rel="stylesheet"
|
||||
href="<%=request.getContextPath()%>/plugins/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css"/>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var getList = function () {
|
||||
//日期格式需对齐,不然会不准
|
||||
$("#table_record").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/timeEfficiency/patrolRecord/getPatrolRecordByDay.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'client', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
patrolDate: '${patrolDate}',
|
||||
type: '${param.type}',
|
||||
unitId: unitId,
|
||||
patrolPlanIds: '${param.patrolPlanIds}'
|
||||
}
|
||||
},
|
||||
responseHandler: function (res) {
|
||||
return res.result
|
||||
},
|
||||
sortName: 'morder', // 要排序的字段
|
||||
sortOrder: 'asc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle'
|
||||
},
|
||||
{
|
||||
field: 'startTime', // 返回json数据中的name
|
||||
title: '开始时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endTime', // 返回json数据中的name
|
||||
title: '结束时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter: function (value, row, index) {
|
||||
if (value != null) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_record");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//撤销任务
|
||||
var doCance = function () {
|
||||
var checkedItems = $("#table_record").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择需要撤回的计划!', 'mainAlertdiv3');
|
||||
} else {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolPlan/doCancel.do', {
|
||||
ids: datas
|
||||
}, function (data) {
|
||||
if (data > 0) {
|
||||
closeModal('subModal')
|
||||
showAlert('s', '成功撤回' + data + '条任务', 'mainAlertdiv');
|
||||
$("#table").bootstrapTable('refresh');
|
||||
} else {
|
||||
showAlert('d', '撤回失败', 'mainAlertdiv3');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
getList();
|
||||
})
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div id="mainAlertdiv3"></div>
|
||||
<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">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body ">
|
||||
<%-- <table id="table_record" data-use-row-attr-func="true"--%>
|
||||
<%-- data-reorderable-rows="true"></table>--%>
|
||||
<table id="table_record"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="doCance()" id="btn_save">撤回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user