<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/bookList/materielTemplateList2.html}" method="post">
	<ul class="seachform">
			
			<li>
				<label>模板名称</label>
				<input type="text" id="LIKE_templateName" name="LIKE_templateName" th:value="${search.get('LIKE_templateName')}" class="scinput date_width " placeholder="模板名称">
			</li>

			<li>
				<input type="button" class="scbtn" value="查询" />
			</li>
			<li>
				<ul class="toolbar">
					<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>选择</li>
				</ul>
			</li>
		
		
	</ul>
	</form>


	

	<table class="tablelist">
		<thead>
		    <tr>
				<th></th>
				<th style="width: 50px;">序号</th>
		    	<th>模板名称</th>
		    	<th>创建时间</th>
		    	<th style=" width: 360px;"> <table style="width: 100%;">
				<thead><tr><th>物料名称</th><th>物料数量</th></tr></thead></table></th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td><input name="selectlist" type="radio" th:data-id="${item.id}" /></td>
				<input  type="hidden" th:value="${item.id}" class="id"/>
					<td th:text="${itemStat.count}"></td>
					<td th:text="${item.templateName}" class="templateName"></td>
					<td th:text="${item.createTime}"></td>
					<td>
						<table style="width: 100%;">
							<tbody>
						<tr th:each="item2:${item.infoList}" th:if="${item}">
								<td th:text="${item2.materielName}" style=" width: 180px;"></td>
								<td th:text="${item2.materielCount}"></td>
						</tr>
							</tbody>
						</table>
					</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">
	$(function(){
		$('ul.toolbar li.click').click(function () {
			$.each($('[name=selectlist]'), function () {
				if ($(this).prop('checked')) {
					var id= $(this).parent().siblings(".id").val();
					var schoolName= $(this).parent().siblings(".templateName").html();
					window.opener.document.getElementById("templateName").value=schoolName;
					window.opener.document.getElementById("templateId").value=id;
				}
			});
			window.close();
		});


		$.each($('[name=selectlist]'), function () {
			var id1= $(this).parent().siblings(".id").html();
			var id=window.opener.document.getElementById("templateId").value;
			if(id1==id){
				$(this).prop('checked', true);
			}
		});
	})
</script>
</html>