<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 70px;
	}
	.date_width{
	     width: 100px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">微信管理</a></li>
		<li><a th:href="@{/sys/lib/libVipSumList.html}">图书馆会员服务</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/lib/libVipSumList.html}" method="post">
	<ul class="seachform">
	   <li>
				<label>开始时间</label>
				<input type="text" id="beginDate" name="beginDate"  onclick="WdatePicker({readOnly:true,maxDate:'#F{$dp.$D(\'endDate\')}'})" th:value="${search.beginDate }" class="scinput date_width " placeholder="开始时间">
			</li>
			
			
			<li>
				<label>结束时间</label>
				<input type="text" id="endDate" name="endDate"  onclick="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'%y-%M-%d'})" th:value="${search.endDate }" class="scinput date_width" placeholder="结束时间">
			</li>
		<li>
				<label>图书馆</label>
					<select class="scinput select_width"  name="libId"   style="width: 220px;" >
						<option value=""   >全部</option>
						<option th:each="item:${libList}"  th:value="${item.id}"  th:selected="${ search.get('libId') eq item.id }"  th:text="${item.leagueName}"></option>
					</select>
		</li>
		<li>
		<label>卡片类型</label>
					<select class="scinput select_width" name="level" >
					    <option value=""  th:selected="${ search.get('level') eq '' }"  >全部</option>
						<option value="1" th:selected="${ search.get('level') eq '1' }" >会员卡</option>
						<option value="5" th:selected="${ search.get('level') eq '5' }" >尊享卡</option>
						<option value="4" th:selected="${ search.get('level') eq '4' }" >联名卡</option>
					</select>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li id="scbtnbution">
			<label>&nbsp;</label>
			<input type="button" class="scbtnbution" value="导出" />
		</li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th style="width: 50px;">序号</th>
		        <th>图书馆</th>
		        <th>购卡服务</th>
		        <th>孩子姓名</th>
		        <th>会员类型</th>
		        <th>会员卡编号</th>
		        <th>购买时间</th>
		        <th>到期时间</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count}" ></td>
				<td th:text="${item.get('league_name')}" ></td>
					<td>
				     <!--   <span th:each="sort:${species}" th:if="${sort.code eq item.get('species')}" th:text="${sort.name}"></span> -->
				       <span th:each="sort:${cardType}" th:if="${sort.code eq item.get('type')}" th:text="${sort.name}"></span>
				    </td>
					<td th:text="${item.get('child_name')}" ></td>
					<td th:switch="${item.get('level')}" >
					    <span th:case="1" >会员卡</span>
					    <span th:case="5" style="color: red;">尊享卡</span>
					    <span th:case="4" >联名卡</span>
					    <span th:case="*" >会员卡</span>
				   </td>
				   <td th:text="${item.get('flow_id')}" ></td>
					<td th:text="${#calendars.format(item.get('start_time'),'yyyy-MM-dd HH:mm')}" ></td>
					<td th:text="${#calendars.format(item.get('end_time'),'yyyy-MM-dd HH:mm')}" ></td>
				
			</tr>
		</tbody>
	</table>
	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>

<script type="text/javascript">


$("#scbtnbution").on('click',function(){
	if($('#endDate').val()==''){
		layer.msg("请选择结束时间",{icon:11});
		return false;
	}
	if($('#beginDate').val()==''){
		layer.msg("请选择开始时间",{icon:11});
		return false;
	}
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/report/exportXlsx";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/lib/libVipSumList.html";
});
</script>
</html>