<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>选择人员</title>
	<meta name="decorator" content="default"/>


	<style>
		.widthClass{
			display: inline-block;
		}
		.shows .input-group{
			width: 48%!important;
		}
	</style>
	<style>
		body{
			background-color:transparent;
			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
			color:#ffffff;
			background-color:rgba(255,255,255,0);
			height:100%;
		}
	</style>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row">
		<div class="full-width fl">
			<div class="contentShadow layui-row" id="queryDiv">
				<form:form id="searchForm" modelAttribute="workSupplier" action="${url}" method="post" class="form-inline">
					<input type="hidden" name="url" value="${url}"/>
					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
					<div class="commonQuery ">
						<div class="layui-item query athird">
							<label class="layui-form-label">类别:</label>
							<div class="layui-input-block">
								<form:select path="falt" class="form-control simple-select">
									<form:option value="2" label="客户"/>
									<form:option value="1" label="供应商"/>
								</form:select>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">名称:</label>
							<div class="layui-input-block">
								<form:input path="name" htmlEscape="false" maxlength="20"  class=" form-control layui-input"/>
							</div>
						</div>

						<div class="layui-item athird">
							<div class="input-group">
								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
							</div>
						</div>
						<div style="    clear:both;"></div>
					</div>
				</form:form>
			</div>
		</div>

		<div class="full-width fl">
			<div class="contentShadow layui-form contentDetails">

				<table class="oa-table layui-table" id="contentTable">
					<thead>
					<tr>
						<th width="40" style="text-align: center"><input type="checkbox" class="i-checks"></th>
						<th style="text-align: center">开户银行</th>
						<th style="text-align: center">开户账号</th>
						<th width="15%" style="text-align: center">客户/供应商名称</th>
						<th style="text-align: center">统一社会信用代码</th>
					</tr>
					</thead>
					<tbody>
					<c:forEach items="${page.list}" var="workSupplier" varStatus="index">
						<tr id="t${index.index}">
							<td style="text-align:center;"> <input type="checkbox" id="${workSupplier.id}" class="i-checks"></td>
							<td class="codelabe2">${workSupplier.bank}</td>
							<td class="codelabe3">${workSupplier.bankNumber}</td>
							<td class="codelabe0" >${workSupplier.name}</td>
							<td class="codelabel">${workSupplier.uscCode}</td>
						</tr>
					</c:forEach>

					</tbody>
				</table>

				<!-- 分页代码 -->
				<table:page page="${page}"></table:page>
				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
</div>
<script>
</script>
<script type="text/javascript">
    $(document).ready(function() {
        //搜索框收放
        $('#moresee').click(function(){
            if($('#moresees').is(':visible'))
            {
                $('#moresees').slideUp(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
            }else{
                $('#moresees').slideDown(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
            }
        });
        laydate.render({
            elem: '#beginDate',
            event: 'focus',
            type : 'date'
        });
        laydate.render({
            elem: '#endDate',
            event: 'focus',
            type : 'date'
        });
        $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
            $('#contentTable tbody tr td input.i-checks').iCheck('check');
        });
        $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
            $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
        });
    });

    function getSelectedItem(){
        var size = $("#contentTable tbody tr td input.i-checks:checked").size();
        if(size == 0 ){
            top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
            return "-1";
        }
        if(size >1 ){
            top.layer.alert('请选择一条数据!', {icon: 0, title:'警告'});
            return "-1";
        }
            var id =  $("#contentTable tbody tr td input.i-checks:checked").attr("id");
            var name = $("#contentTable tbody tr td input.i-checks:checked").parent().parent().parent().find(".codelabe0").html();
            var uscCode = $("#contentTable tbody tr td input.i-checks:checked").parent().parent().parent().find(".codelabel").html();
            var bank = $("#contentTable tbody tr td input.i-checks:checked").parent().parent().parent().find(".codelabe2").html();
            var bankNumber = $("#contentTable tbody tr td input.i-checks:checked").parent().parent().parent().find(".codelabe3").html();
            var data = {'id':id,'name':name,'uscCode':uscCode,'bank':bank,'bankNumber':bankNumber};
            return data;
    }
    function page(n,s){
        if(n) $("#pageNo").val(n);
        if(s) $("#pageSize").val(s);
        $("#searchForm").attr("action","${url}");
        $("#searchForm").submit();
        return false;
    }
</script>
</body>
</html>