236 lines
8.9 KiB
Plaintext
236 lines
8.9 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<style type="text/css">
|
||
/*.select2-container .select2-selection--single{
|
||
height:34px;
|
||
line-height: 34px;
|
||
}
|
||
.select2-selection__arrow{
|
||
margin-top:3px;
|
||
}
|
||
|
||
.swal-modal{
|
||
z-index: -11111;
|
||
} */
|
||
</style>
|
||
<script type="text/javascript">
|
||
var showMenu4SelectFun_func = function() {
|
||
$.post(ext.contextPath + '/user/showMenu4Select.do', {formId:"subForm_func",hiddenId:"pid",textId:"_pname"} , function(data) {
|
||
$("#menu4SelectDiv_func").html(data);
|
||
openModal('menu4SelectModal');
|
||
});
|
||
};
|
||
function dosave_func() {
|
||
$("#subForm_func").bootstrapValidator('validate');//提交验证
|
||
// if ($("#subForm_func").form('validate')) {
|
||
$.post(ext.contextPath + "/command/emergencyConfigure/saveFunc.do", $("#subForm_func").serialize(), function(result) {
|
||
if (result.res == 1) {
|
||
$("#table").bootstrapTable('refresh');
|
||
closeModal('powerModal');
|
||
}else{
|
||
showAlert('d','保存失败','alertDiv_func');
|
||
}
|
||
},'json');
|
||
// }
|
||
}
|
||
|
||
function doadd(id) {
|
||
$.post(ext.contextPath + '/command/emergencyConfigureWorkOrder/doadd.do', {id:"${id}"} , function(data) {
|
||
$("#powerDiv1").html(data);
|
||
openModal('powerModal1')
|
||
});
|
||
};
|
||
|
||
function doedit_work(id) {
|
||
$.post(ext.contextPath + '/command/emergencyConfigureWorkOrder/doworkedit.do', {id:id}, function(data) {
|
||
$("#powerDiv2").html(data);
|
||
openModal('powerModal2')
|
||
});
|
||
};
|
||
|
||
// function doworkdel() {
|
||
// 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 + '/command/emergencyConfigureWorkOrder/doworkdelete.do', $("#subForm_func").serialize(), function(data) {
|
||
// if(data.res>0){
|
||
// $("#table3").bootstrapTable('refresh');
|
||
// }else{
|
||
// showAlert('d','删除失败','alertDiv_del');
|
||
// }
|
||
// },'json');
|
||
|
||
// }
|
||
// });
|
||
// }
|
||
|
||
function doworkdel(id){
|
||
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
||
$.post(ext.contextPath + '/command/emergencyConfigureWorkOrder/doworkdelete.do', {id:id}, function(data) {
|
||
if(data.res>0){
|
||
$("#table3").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','alertDiv_del');
|
||
}
|
||
},'json');
|
||
|
||
}
|
||
|
||
}
|
||
|
||
$(function() {
|
||
//var active=$("#active").select2();
|
||
$("#active_func").select2({minimumResultsForSearch: -1}).val("启用").trigger("change");
|
||
});
|
||
|
||
|
||
//提交验收判断
|
||
$("#subForm_func").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
personliablename: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '子流程负责人'
|
||
}
|
||
}
|
||
},
|
||
rank: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '流程图层级'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
|
||
$(function() {
|
||
|
||
$("#table3").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/command/emergencyConfigureWorkOrder/getListData.do?id=${id}', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 50, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order // 排序规则
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'workcontent', // 返回json数据中的name
|
||
title: '工作内容', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
/*formatter: function(value,row,index){
|
||
return row.pname;
|
||
},*/
|
||
},
|
||
{
|
||
field: '_workreceiveuser', // 返回json数据中的name
|
||
title: '任务接收人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 90, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
return '<div class="btn-group">'+
|
||
'<security:authorize buttonUrl="command/emergencyConfigureWorkOrder/edit.do">'+
|
||
'<button class="btn btn-default btn-sm" onclick="doedit_work(\'' + row.id + '\')"><i class="fa fa-edit"></i></button>'+
|
||
'</security:authorize>'+
|
||
'<security:authorize buttonUrl="command/emergencyConfigureWorkOrder/delete.do">'+
|
||
'<button class="btn btn-default btn-sm" onclick="doworkdel(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></button>'+
|
||
'</security:authorize>'+
|
||
'</div>';
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(row){ //加载成功时执行
|
||
$(".bs-checkbox").css({'text-align':'center','vertical-align':'middle'})
|
||
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
/*关闭modal,执行方法*/
|
||
$("#powerModal").on('click.dismiss.bs.modal', '[data-dismiss="modal"]', function(){
|
||
//刷新表格
|
||
$("#table").bootstrapTable('refresh');
|
||
})
|
||
});
|
||
|
||
</script>
|
||
<div class="modal fade" id="powerModal">
|
||
<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">工单列表</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 新增界面formid强制为subForm -->
|
||
<form class="form-horizontal " id="subForm_func">
|
||
<input id="id" name="id" type="hidden" value="${id}"/>
|
||
<input id="pid" name="pid" type="hidden" value="${pid}"/>
|
||
<!-- 界面提醒div强制id为alertDiv -->
|
||
<div id="alertDiv_func"></div>
|
||
<!-- <div id="powerDiv1"></div>
|
||
<div id="powerDiv2"></div> -->
|
||
<!-- <div id="menu4SelectDiv_func"></div> -->
|
||
<!-- <div class="form-group">
|
||
<label class="col-sm-2 control-label">等级</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="grade" name ="grade" placeholder="等级" value="${emergencyConfigureInfo.grade }">
|
||
</div> -->
|
||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||
<security:authorize buttonUrl="command/emergencyConfigureWorkOrder/add.do">
|
||
<button type="button" class="btn btn-default" onclick="doadd();"><i class="fa fa-plus"></i> 新增</button>
|
||
</security:authorize>
|
||
</div>
|
||
</form>
|
||
<table id="table3"></table>
|
||
</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>
|