216 lines
10 KiB
Plaintext
216 lines
10 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
var editDetailFun = function(id) {
|
|||
|
|
// stopBubbleDefaultEvent();
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/doedit.do', {id:id} , function(data) {
|
|||
|
|
$("#subDiv_detail").html(data);
|
|||
|
|
openModal('subModal_detail');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var addDetailFun = function() {
|
|||
|
|
var pid=$('#id').val();
|
|||
|
|
// stopBubbleDefaultEvent();
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/doadd.do' ,{pid,unitId:unitId}, function(data) {
|
|||
|
|
$("#subDiv_detail").html(data);
|
|||
|
|
openModal('subModal_detail');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var deleteDetailFun = function(id) {
|
|||
|
|
// stopBubbleDefaultEvent();
|
|||
|
|
if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
|||
|
|
$.post(ext.contextPath + '/structure/structureCardPictureRoutePointdetail/dodelete.do', {id : id}, function(data) {
|
|||
|
|
if(data==1){
|
|||
|
|
$("#table_pointDetail").bootstrapTable('refresh');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','删除失败','mainAlertDetaildiv');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// var deletesparamFun = function() {
|
|||
|
|
// var checkedItems = $("#table_pointDetail").bootstrapTable('getSelections');
|
|||
|
|
// var datas="";
|
|||
|
|
// $.each(checkedItems, function(index, item){
|
|||
|
|
// datas+=item.id+",";
|
|||
|
|
// });
|
|||
|
|
// if(datas==""){
|
|||
|
|
// showAlert('d','请先选择记录','mainAlertDetaildiv');
|
|||
|
|
// }else{
|
|||
|
|
// if(confirm("信息删除后不能恢复,请问要执行删除操作吗?")){
|
|||
|
|
// $.post(ext.contextPath + '/process/initialPoint/deletesNew.do', {ids:datas} , function(data) {
|
|||
|
|
// if(data>0){
|
|||
|
|
// $("#table_pointDetail").bootstrapTable('refresh');
|
|||
|
|
// }else{
|
|||
|
|
// showAlert('d','删除失败','mainAlertDetaildiv');
|
|||
|
|
// }
|
|||
|
|
// });
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// }
|
|||
|
|
// };
|
|||
|
|
|
|||
|
|
function doupdate() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/structure/structureCardPicture/updateRoutePoint.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
closeModal('subModal');
|
|||
|
|
$("#table_picture").bootstrapTable('refresh');
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '更新失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
// $("#subForm").bootstrapValidator({
|
|||
|
|
// live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
// fields: {
|
|||
|
|
// name: {
|
|||
|
|
// validators: {
|
|||
|
|
// notEmpty: {
|
|||
|
|
// message: '名称不能为空'
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
|
|||
|
|
$("#table_pointDetail").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/structure/structureCardPictureRoutePointdetail/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,
|
|||
|
|
pid : $('#id').val(),
|
|||
|
|
search_name: $('#search_name').val()
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'insdt', // 要排序的字段
|
|||
|
|
sortOrder: 'asc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
width: '120',
|
|||
|
|
field: 'contents', // 返回json数据中的name
|
|||
|
|
title: '巡检内容', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
width : '100',
|
|||
|
|
field: 'requirement', // 返回json数据中的shelfclass
|
|||
|
|
title: '巡检要求', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
width : '100',
|
|||
|
|
field: 'num', // 返回json数据中的shelfclass
|
|||
|
|
title: '台数(项数)', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: 120, // 定义列的宽度,单位为像素px
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var str="";
|
|||
|
|
str+='<button class="btn btn-default btn-sm" onclick="editDetailFun(\'' + row.id + '\')"><i class="fa fa-edit" title="编辑"></i></button>';
|
|||
|
|
str+='<button class="btn btn-default btn-sm" onclick="deleteDetailFun(\'' + row.id + '\')"><i class="fa fa-trash-o" title="删除"></i></button>';
|
|||
|
|
str='<div class="btn-group" >'+str+'</div>';
|
|||
|
|
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function(){ //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_pointDetail");
|
|||
|
|
},
|
|||
|
|
onLoadError: function(){ //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<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">
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input id="id" name="id" type="hidden" value="${structureCardPictureRoute.id}" />
|
|||
|
|
<!-- 界面提醒div强制id为alertdiv -->
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">点位名称</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="text" id="patrolContent" name="patrolContent" class="form-control" placeholder="巡检要求" value="${structureCardPictureRoute.patrolContent}">
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<!-- 参数配置 -->
|
|||
|
|
<div class="box box-primary" >
|
|||
|
|
<div id="mainAlertDetaildiv"></div>
|
|||
|
|
<div id="subDetailDiv"></div>
|
|||
|
|
<div id="mpSubDiv"></div>
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">巡检内容配置</h3>
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<!-- <a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a> -->
|
|||
|
|
<!-- <button type="button" class="btn btn-default btn-sm" onclick="importFun();"><i class="fa fa-cloud-upload"></i> 导入</button>
|
|||
|
|
<button type="button" class="btn btn-default btn-sm" onclick="downloadFun();"><i class="fa fa-cloud-download"></i> 导出</button> -->
|
|||
|
|
<!-- <div class="form-group pull-right" >
|
|||
|
|
<div class="input-group input-group-sm" style="width: 180px;">
|
|||
|
|
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="参数名称/参数code">
|
|||
|
|
<div class="input-group-btn">
|
|||
|
|
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div> -->
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body">
|
|||
|
|
<table id="table_pointDetail"></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="doupdate()">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|