<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="p" uri="http://www.test.com/jsp/permission" %>
<!doctype html>
<html>
<head>
	<%@ include file="../../common/head.jsp"%>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<link href="../res/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <script src="../res/js/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="../res/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="../res/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script>
    	
    	$(function(){
    		$('#btnSearch').click(function () { 
    			$('#tab_user').bootstrapTable('refresh');
  	        });  
  	        
  	        $('#clearHref').click(function () { 
  	        	$('#myform')[0].reset();
 	       	}); 
    	});
    	function init_pwd(){
    		var data = getSelectedRow("tab_user");
    		if(null == data){
    			return;
    		}
 
    	}

        function user_type(value,row,index){
    	    if(value == 0){
    	        return '集团员工';
			}else if(value==1){
                return '外部注册用户';
            } 
        }
    	function queryParams(params){
			var page = params.offset / params.limit + 1;
			var dataObj = new Object(); 
			dataObj.personnelcode=$("#personnelcode").val();
			dataObj.name=$("#name").val();
			dataObj.phone=$("#phone").val();
			dataObj.type=$("#type").val();
			return  { page:page, 
					  pageSize:params.limit, 
					  search:JSON.stringify(dataObj), 
					  sort:params.sort,
					  order:params.order
			}
		}; 
		function format_action(value,row,index){
           	var returnhtml = '<a href="javascript:show('+row.ID+');">查看详情 </a>';
           	return returnhtml;
    	}
    	 
    	function show(id){
    		$.openDlg({
    			url:'transfer.cs?action=view&id=' + id,
    			title:'查看详情',
    			width:'95%',
    			height:'95%',
    		});
    	}	
    	
    </script>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInUp">
<!--           <div class="ibox " style=""> -->
<!--               <div class="ibox-content"> -->
	              <div class="row row-lg">
	              		<div class="col-sm-12">
							<div class="ibox-content m-b-sm border-bottom">
								<div class="ibox-title">
									<h5>查询条件</h5>
								</div>
								<form class="form-inline" id="myform">
								    <div class="form-group"><label>&nbsp;员工号：</label><input id="personnelcode" name="personnelcode" class="form-control" type="text" value=""></div>
									<div class="form-group"><label>&nbsp;姓名：</label><input id="name" name="name" class="form-control" type="text" value=""></div>
									<div class="form-group"><label>&nbsp;电话：</label><input id="phone" name="phone" class="form-control" type="text" value=""></div>
									<div class="form-group">
										<label>&nbsp;用户类型：</label>
										<select class="form-control" id="type">
											<option value="">--全部--</option>
											<option value="0">集团用户</option>
											<option value="1">外部注册用户</option>
										</select>
									</div>
									&nbsp;&nbsp;
									<label><a href="#" id="btnSearch" class="btn btn-primary"><i class="icon-search"></i> 搜索</a></label>&nbsp;&nbsp;
									<label><a href="#" id="clearHref" class="btn btn-primary"><i class="icon-search"></i> 清除搜索条件</a></label>
								</form>
							</div>
		                  <table id="tab_user"  
		                  	   data-toggle="table"
						       data-url="list2.cs"
						       data-method="get"
						       data-click-to-select="true"
						       data-pagination="true"
						       data-data-type="json"
						       data-show-refresh="true"
						       data-show-columns="true"
						       data-show-toggle="true"
						       data-search-on-enter-key="true"
						       data-toolbar="#def_toolbar"  
						       data-side-pagination="server"
						       data-query-params="queryParams"
						       data-mobile-responsive="true"
								>
		                      <thead>
		                          <tr>
		                              <th data-checkbox="true"	data-click-to-select="true"></th>
		                              <th data-field="ID" data-visible="false">id</th>
		                              <th data-field="PERSONNELCODE">员工号</th>
		                              <th data-field="NAME">姓名</th>
		                              <th data-field="PHONE">手机号</th>
 		                              <th data-field="TYPE" data-formatter="user_type">用户类型</th>
		                              <th data-field="QQ">QQ</th>
		                              <th data-field="WEIXIN">微信</th>
		                              <th data-formatter="format_action">操作</th>
		                          </tr>
		                      </thead>
		                  </table>
	              		
	              		</div>
	              	
	              </div>
				 
<!--               </div> -->
<!--           </div> -->
    </div>
    

</body>

</html>
