<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 href="#">一对一资金流水管理</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/order/lessonOrderList.html}" method="post">
	<input type="hidden" name="reportType" value="9">
	<ul class="seachform">
			<li>
				<label>订单状态</label>
					<select class="scinput select_width"  name="order_status" th:switch="${search.get('order_status')}" >
						<option value=""  th:selected="${ search.get('order_status') eq '' }"  >全部</option>
						<option value="0" th:selected="${ search.get('order_status') eq '0' }"  >未支付</option>
						<option value="1" th:selected="${ search.get('order_status') eq '1' }" >已支付</option>
						<option value="4" th:selected="${ search.get('order_status') eq '4' }" >已退款</option>
					</select>
			</li>
			
			<li>
				<label>开始时间</label>
				<input type="text" id="beginDate" name="beginDate"  onclick="WdatePicker({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\')}'})" th:value="${search.endDate }" class="scinput date_width" placeholder="结束时间">
			</li>
			<li>
			    <label>订单编号</label>
			    <input name="order_no" type="text" class="scinput" th:value="${search.get('order_no')}"/>
		   </li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
			<input type="button" id="button" style="width: 100px;" 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>
		        <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 th:text="${item.get('order_no')}">
					</td>
					
					<td  th:switch="${item.get('order_status')}">
					   <span th:case="0">未支付</span>
					   <span th:case="1" style="color: red;">已支付</span>
					   <span th:case="1" style="color: red;">财务手动</span>
					   <span th:case="4" style="color: green;">已退款</span>
					   <span th:case="*">其他</span>
					</td>
					<td th:text=" ${#strings.contains(item.get('order_money'),'.00')} ?  ${#numbers.formatDecimal(item.get('order_money'),1,0)} :  ${#numbers.formatDecimal(item.get('order_money'),1,2)} " style="color:  red;"></td>
					<td th:text="${ item.get('is_listen_test') eq '1' ? '有' : '无'}"></td>
					<td th:text="${ item.get('course_count')}"></td>
					
			        <td  th:text="${#calendars.format(item.get('create_time'),'yyyy-MM-dd HH:mm')}" ></td>
				    <td  th:text="${#calendars.format(item.get('pay_time'),'yyyy-MM-dd HH:mm')}" ></td>
				   	<td th:text="${ item.get('master_name')}"></td>
				    <td th:text="${ item.get('parent_name')}"></td>
				   	<td th:text="${ item.get('child_name')}"></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">
$("#button").on('click',function(){
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/report/exportReport";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/order/lessonOrderList.html";
});
</script>
</body>
</html>