139 lines
5.9 KiB
Plaintext
139 lines
5.9 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="java.util.Date" %>
|
|||
|
|
<%@page import="java.text.SimpleDateFormat" %>
|
|||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|||
|
|
<%
|
|||
|
|
SessionManager sessionManager = new SessionManager();
|
|||
|
|
%>
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var checkedItem="";
|
|||
|
|
var $table;
|
|||
|
|
function doselect() {
|
|||
|
|
if(checkedItem!= null && checkedItem!=""){
|
|||
|
|
//console.info(checkedItem);
|
|||
|
|
$('#processsectionid' ).val(checkedItem.id);
|
|||
|
|
$('#processsectionCode' ).val(checkedItem.code);
|
|||
|
|
$('#processsectionName').val(checkedItem.name);
|
|||
|
|
closeModal("equipmentProcessSectionSubModal");
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var dosearchprocess = function() {
|
|||
|
|
$("#equipmentProcessSection").bootstrapTable('refresh');
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
//显示已经勾选的数据
|
|||
|
|
function stateFormatter(value, row, index) {
|
|||
|
|
var flag=false;
|
|||
|
|
if(row.id=='${processsectionId}'){
|
|||
|
|
flag=true;
|
|||
|
|
checkedItem = row;
|
|||
|
|
}
|
|||
|
|
if (flag)
|
|||
|
|
return {
|
|||
|
|
checked : true//设置选中
|
|||
|
|
};
|
|||
|
|
return value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(function() {
|
|||
|
|
$table = $("#equipmentProcessSection").bootstrapTable({ // 对应table标签的id
|
|||
|
|
//url: ext.contextPath + '/equipment/getList.do', // 获取表格数据的url
|
|||
|
|
//url: ext.contextPath + '/equipment/equipmentBelong/getList.do', // 获取表格数据的url
|
|||
|
|
url: ext.contextPath + '/user/processSection/getlist.do', // 获取表格数据的url
|
|||
|
|
clickToSelect:true,
|
|||
|
|
singleSelect:true,
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
search_code: '${companyId}',
|
|||
|
|
search_name: $('#search_processname').val()
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
queryParamsType: "limit",
|
|||
|
|
sortName: 'morder', // 要排序的字段
|
|||
|
|
sortOrder: 'asc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
formatter: stateFormatter
|
|||
|
|
},{
|
|||
|
|
field: 'name', // 返回json数据中的name
|
|||
|
|
title: '名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'code', // 返回json数据中的name
|
|||
|
|
title: '编号', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function(){ //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("equipmentProcessSection");
|
|||
|
|
},
|
|||
|
|
onLoadError: function(){ //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//绑定选中事件、取消事件、全部选中、全部取消
|
|||
|
|
$table.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e,rows, obj) {
|
|||
|
|
if('check'==e.type){
|
|||
|
|
$('#equipmentProcessSection .checked').removeClass("checked");
|
|||
|
|
obj.parent().addClass("checked");
|
|||
|
|
checkedItem = rows;
|
|||
|
|
}else{
|
|||
|
|
obj.parent().removeClass("checked");
|
|||
|
|
checkedItem = "";
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="equipmentProcessSectionSubModal" >
|
|||
|
|
<div class="modal-dialog modal-md" >
|
|||
|
|
<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">
|
|||
|
|
<div id="alertDiv_MaintainPlanSelect"></div>
|
|||
|
|
<div id="mainAlertdiv"></div>
|
|||
|
|
<div id="menu4SelectDiv"></div>
|
|||
|
|
<div id="modal-body">
|
|||
|
|
<div class="input-group input-group-sm" style="width: 250px;float: right;margin-bottom: 15px;">
|
|||
|
|
<input type="text" id="search_processname" name="search_processname" class="form-control pull-right" placeholder="名称/编号">
|
|||
|
|
<div class="input-group-btn">
|
|||
|
|
<button class="btn btn-default" onclick="dosearchprocess();"><i class="fa fa-search"></i></button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="table-scrollable">
|
|||
|
|
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentProcessSection"></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="doselect()" id="btn_save">确定</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|