<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: 220px;
	}
	.date_width{
	     width: 150px;
	}
</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/award/stock/list.html}" method="post">
	<ul class="seachform">
		
		<li>
			<label>奖品：</label>
			<input type="text" id="name" name="name" autocomplete="off"  th:value="${search.get('name')}"  class="scinput date_width" placeholder="奖品名称">
		</li>
	
		<li>
			<label>奖品等奖</label>
			<select class="scinput select_width"  id="level" name="level"   style="width: 150px;" >
				<option value="">全部</option>
				<option value="1" th:selected="${search.get('level')+'' eq '1' ? true : false}">一等奖</option>
				<option value="2" th:selected="${search.get('level')+'' eq '2' ? true : false}">二等奖</option>
				<option value="3" th:selected="${search.get('level')+'' eq '3' ? true : false}">三等奖</option>
			</select>
		</li>
		<li>
			<input type="button" class="scbtn" 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>奖品LOGO</th>
		    	
		    	<th>分发明细</th>
<!-- 		    	<th>奖码明细</th> -->
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
					<td th:text="${itemStat.count}"></td>
					<td th:text="${item.get('name')}"></td>
					<td  th:switch="${item.level}">
					   <span th:case="1" style="color:red">一等奖</span>
					   <span th:case="2" style="color:red">二等奖</span>
					   <span th:case="3" style="color:red">三等奖</span>
					   <span th:case="4" style="color:red">四等奖</span>
					</td>
					<td th:text="${item.get('stock_number')}"></td>
					<td th:text="${item.get('use_number')}"></td>
					<td th:text="${item.get('exchange_integral')}"></td>
					<td >
						<img style="height: 40px;"  th:if="${item.get('img')!=null && item.get('img')!=''}" th:src="${imgUrl+item.get('img')}">
					</td>
					<td> 
						<a th:href="${sysUrl+'/sys/award/material/consume.html?id='+item.id }" class="tablelink">奖品配送明细</a> 
					</td>
<!-- 					<td>  -->
<!-- 						<a th:href="${sysUrl+'/sys/award/sncode/list.html?awardMaterialId='+item.id }" class="tablelink">奖品抽奖信息</a>  -->
<!-- 					</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>
</body>
<script type="text/javascript">

	$("#button").on('click',function(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/material/list";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/material/list.html";
		},3000);
	});
</script>


</html>