221 lines
8.6 KiB
Plaintext
221 lines
8.6 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
<!DOCTYPE html>
|
||
|
||
<script type="text/javascript">
|
||
var doSearchUser = function() {
|
||
$("#table_user").bootstrapTable('refresh');
|
||
};
|
||
|
||
function doSelect(){
|
||
var selectRowArr=$("#table_user").bootstrapTable('getAllSelections');
|
||
|
||
if(selectRowArr.length <= 0){
|
||
showAlert('d','请选择厂区');
|
||
}else{
|
||
|
||
var selectRowInfo = selectRowArr[0];
|
||
var acceptId=selectRowInfo['id'];
|
||
var acceptName=selectRowInfo['caption'];
|
||
|
||
console.log({acceptId});
|
||
console.log({acceptName});
|
||
|
||
$('#acceptId').val(acceptId);
|
||
$('#acceptName').val(acceptName);
|
||
closeModal("user4SelectModal");
|
||
}
|
||
/* var ids="";
|
||
if(selectionIds.length>0){
|
||
for(var i=0;i<selectionIds.length;i++){
|
||
ids+=selectionIds[i]+",";
|
||
}
|
||
} else{
|
||
closeModal("user4SelectModal");
|
||
return;
|
||
}
|
||
|
||
console.log("==========ids=============="+ids);
|
||
|
||
var id="";
|
||
var name="";
|
||
$.post(ext.contextPath + "/equipment/equipmentDialin/findUserByIds.do", {userIdsStr:ids}, function (data) {
|
||
$.each(data,function(index,value){
|
||
id+=data[index].id+",";
|
||
name+=data[index].name+",";
|
||
})
|
||
|
||
$('#acceptName').text(name);
|
||
$('#acceptId').val(id);
|
||
closeModal("user4SelectModal");
|
||
$('#companySelectTreeSecond').html('');
|
||
},'json'); */
|
||
|
||
}
|
||
|
||
var $table;
|
||
var selectionIds = []; //保存选中ids
|
||
/* function initialSelectionIds(){
|
||
var userIds='${users}';
|
||
var check_array='';
|
||
if(userIds.length>0){
|
||
check_array=userIds.split(",");
|
||
}
|
||
|
||
if(''!=check_array && check_array!=null && check_array.length>0){
|
||
selectionIds =new Array(check_array.length);
|
||
for(var i=0;i<check_array.length;i++){
|
||
selectionIds[i]=check_array[i];
|
||
}
|
||
}
|
||
} */
|
||
|
||
function queryParams(params) {
|
||
|
||
var temp={
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
search_name: $('#search_userName').val(),
|
||
search_pid:companyId,
|
||
//pid:companyId,
|
||
jobIds:$('#jobIds').val()
|
||
};
|
||
return temp;
|
||
}
|
||
|
||
$(function() {
|
||
//简易公司combotree
|
||
$.post(ext.contextPath + "/user/showCompanySelectTree.do", {}, function (data) {
|
||
$('#companySelectTreeSecond').html(data);
|
||
|
||
});
|
||
|
||
$("#search_userName").keyup(function(){
|
||
if (event.keyCode == 13) {
|
||
event.preventDefault();
|
||
//回车查询
|
||
doSearchUser();
|
||
event.stopPropagation();
|
||
}
|
||
})
|
||
|
||
//initialSelectionIds();
|
||
//console.log("initialSelectionIds selectionIds================================================="+selectionIds);
|
||
$table=$("#table_user").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/user/getUsers.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
clickToSelect:true,
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20], // 设置页面可以显示的数据条数
|
||
pageSize: 20, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
clickToSelect:true,
|
||
maintainSelected:true,
|
||
//responseHandler:responseHandler, //在渲染页面数据之前执行的方法,此配置很重要!!!!!!!
|
||
queryParams: queryParams,
|
||
queryParamsType: "limit",
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
/* {
|
||
field: 'checkStatus',
|
||
checkbox: true, // 显示一个勾选框
|
||
formatter: function (i,row) { // 每次加载 checkbox 时判断当前 row 的 id 是否已经存在全局 Set() 里
|
||
if($.inArray(row.id,Array.from(selectionIds))!=-1){ // 因为 Set是集合,需要先转换成数组
|
||
return {
|
||
checked : true // 存在则选中
|
||
}
|
||
}
|
||
}
|
||
}, */
|
||
{
|
||
radio:true,//单选框
|
||
},{
|
||
field: 'caption',
|
||
title: "姓名",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: '30%'
|
||
},{
|
||
field: '_pname',
|
||
title: "公司/部门",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: '70%'
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_user");
|
||
|
||
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
},
|
||
|
||
})
|
||
|
||
});
|
||
|
||
|
||
var initFun = function(){
|
||
}
|
||
|
||
</script>
|
||
|
||
<div class="modal fade" id="user4SelectModal">
|
||
<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 " style="width:100%">
|
||
<div id="alertDiv"></div>
|
||
<div class="form-inline">
|
||
<div class="form-group">
|
||
<input type="hidden" id="jobIds"name="jobIds" class="form-control" placeholder="职位Ids" value="${jobIds }">
|
||
<!-- <ul id="companyForUserSelect" style="list-style-type:none;padding-left:0px;width:260px;">
|
||
<li class="dropdown" style="width:260px;">
|
||
Menu toggle button
|
||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||
style="width:260px;" onclick="document.getElementById('user_tree').style.display = 'block';">
|
||
<div class="input-group">
|
||
<span class="input-group-addon"
|
||
style="height:34px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">公司:</span>
|
||
<input class="form-control " id="coname_input" name="coname_input" placeholder="请选择"
|
||
style="height:34px;width: 200px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
||
readonly />
|
||
</div>/input-group
|
||
</a>
|
||
<ul id="user_tree" class="dropdown-menu" data-stopPropagation="true">
|
||
<li class="header">
|
||
<div id="companiestree" style="width: 250px;height:300px; overflow:auto;"></div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul> -->
|
||
<div id="companySelectTreeSecond"></div>
|
||
</div>
|
||
<div class="input-group input-group-sm pull-right" style="width: 250px;">
|
||
<input type="text" id="search_userName" autocomplete="off" name="search_userName" class="form-control" style="height:34px" placeholder="姓名">
|
||
<div class="input-group-btn">
|
||
<button class="btn btn-default" onclick="doSearchUser();" style="height:34px"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<table id="table_user"></table>
|
||
</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> |