first commit
This commit is contained in:
98
WebRoot/jsp/equipment/getCompanyAllInfoPage.jsp
Normal file
98
WebRoot/jsp/equipment/getCompanyAllInfoPage.jsp
Normal file
@ -0,0 +1,98 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript">
|
||||
//表格查询参数
|
||||
function queryParamsFun(params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
}
|
||||
};
|
||||
|
||||
var initFun = function(){
|
||||
$("#table_company").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/equipment/equipmentDialin/getUnits4Select.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
//striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10,20,30], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'client', // 设置为服务器端分页
|
||||
queryParams: queryParamsFun,
|
||||
sortName: 'insdt', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
singleSelect:true,
|
||||
columns: [
|
||||
{
|
||||
radio:true,//单选框
|
||||
//checkbox: true, // 显示一个勾选框
|
||||
}, {
|
||||
field: 'text', // 返回json数据中的name
|
||||
title: '厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
},
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table_company");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
initFun();
|
||||
})
|
||||
|
||||
function dosaveCompanyInfo(){
|
||||
var selectRowArr=$("#table_company").bootstrapTable('getAllSelections');
|
||||
if(selectRowArr.length <= 0){
|
||||
showAlert('d','请选择厂区');
|
||||
}else{
|
||||
|
||||
var selectRowInfo = selectRowArr[0];
|
||||
selectRowId=selectRowInfo['id'];
|
||||
selectRowName=selectRowInfo['text'];
|
||||
selectRowEname=selectRowInfo['ename'];
|
||||
|
||||
$('#dialinComId').val(selectRowId);
|
||||
$('#dialinComName').val(selectRowName);
|
||||
|
||||
var timestamp=moment().format('YYYYMMDDHHmmss');
|
||||
var dialinCode = selectRowEname+'-'+'BR'+'-'+timestamp;
|
||||
$('#id').val(dialinCode);
|
||||
//给上传masterId_process赋值
|
||||
masterId_process = dialinCode;
|
||||
closeModal("comanyAllDivSubModal");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="comanyAllDivSubModal">
|
||||
<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">
|
||||
<div id="alertDiv"></div>
|
||||
<!-- <div id="table"></div> -->
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="table_company"></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="dosaveCompanyInfo()" id="btn_save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user