first commit
This commit is contained in:
187
WebRoot/jsp/work/schedulingList.jsp
Normal file
187
WebRoot/jsp/work/schedulingList.jsp
Normal file
@ -0,0 +1,187 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.work.Scheduling" %>
|
||||
<% request.setAttribute("IsTypeSetting_False", Scheduling.IsTypeSetting_False); %>
|
||||
<% request.setAttribute("IsTypeSetting_True", Scheduling.IsTypeSetting_True); %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var patroltype='${param.patroltype}';
|
||||
var date = "${date}";
|
||||
var addFun = function () {
|
||||
$.post(ext.contextPath + '/work/scheduling/add.do', {date: date,grouptype:'${param.grouptype}',patroltype:patroltype},
|
||||
function (data) {
|
||||
$("#addDiv").html("");//清空
|
||||
$("#addDiv").html(data);
|
||||
openModal('schedulingAddModal');
|
||||
});
|
||||
};
|
||||
var editFun = function (id,datetime) {
|
||||
$.post(ext.contextPath + '/work/scheduling/edit.do', { id: id,grouptype:'${param.grouptype}',patroltype:patroltype,datetime:datetime}, function (data) {
|
||||
$("#editDiv").html("");//清空
|
||||
$("#editDiv").html(data);
|
||||
openModal('schedulingEditModal');
|
||||
});
|
||||
};
|
||||
var deletesFun = function () {
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function (index, item) {
|
||||
datas += item.id + ",";
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
} else {
|
||||
swal({
|
||||
text: "您确定要删除这些排班计划吗?",
|
||||
dangerMode: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: "取消",
|
||||
value: null,
|
||||
visible: true,
|
||||
className: "btn btn-default btn-sm",
|
||||
closeModal: true,
|
||||
},
|
||||
confirm: {
|
||||
text: "确定",
|
||||
value: true,
|
||||
visible: true,
|
||||
className: "btn btn-danger btn-sm",
|
||||
closeModal: true
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function(willDelete) {
|
||||
if (willDelete) {
|
||||
$.post(ext.contextPath + '/work/scheduling/deletes.do', { ids: datas }, function (data) {
|
||||
if (data > 0) {
|
||||
$("#table").bootstrapTable('refresh');
|
||||
doReloadCalendar();
|
||||
} else {
|
||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function () {
|
||||
var $table = $("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/work/scheduling/getlist.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
paginationDetailHAlign: ' hidden',//去除分页的显示
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
bizid: unitId,
|
||||
schedulingtype: '${param.grouptype}',
|
||||
date: '${date}',
|
||||
isTypeSetting: '${IsTypeSetting_True}'
|
||||
}
|
||||
},
|
||||
//sortName: 'id', // 要排序的字段
|
||||
//sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: '_groupTimename', // 返回json数据中的name
|
||||
title: '班次', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
},
|
||||
{
|
||||
field: 'stdt', // 返回json数据中的name
|
||||
title: '起始时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,16);
|
||||
}
|
||||
}, {
|
||||
field: 'eddt', // 返回json数据中的name
|
||||
title: '结束时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0,16);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: '_groupDetailName', // 返回json数据中的name
|
||||
title: '值班班组', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
// {
|
||||
// field: '_patrolmodelname', // 返回json数据中的name
|
||||
// title: '模式', // 表格表头显示文字
|
||||
// align: 'center', // 左右居中
|
||||
// valign: 'middle',
|
||||
// },
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
// width: 60, // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var str = '';
|
||||
str += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\',\'' + row.stdt + '\')"><i class="fa fa-edit"></i></button>';
|
||||
str = '<div class="btn-group" >' + str + '</div>';
|
||||
return str;
|
||||
/* return '<i class="fa fa-edit" onclick="editFun()(\'' + row.id + '\')></i>'; */
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="schedulingListModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<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">${date}排班</h4>
|
||||
</div>
|
||||
<div class="modal-body " style="width:100%">
|
||||
<div id="alertDiv"></div>
|
||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||
<%-- <security:authorize buttonUrl="work/scheduling/add.do">--%>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i>新增</button>
|
||||
<%-- </security:authorize>--%>
|
||||
<%-- <security:authorize buttonUrl="work/scheduling/delete.do">--%>
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-warning"></i>删除</button>
|
||||
<%-- </security:authorize>--%>
|
||||
<!-- <button type="button" class="btn btn-default" onclick="editFun();"><i class="fa fa-edit"></i> 编辑</button> -->
|
||||
|
||||
<!--<button type="button" class="btn btn-default" onclick="syncFun();"><i class="fa fa-upload"></i> 同步</button> -->
|
||||
</div>
|
||||
<div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<!--<button type="button" class="btn btn-primary" onclick="doSelect()">确认</button>-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user