<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>
</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/orgclass/orgclassTempList.html}">机构班级临时数据列表</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/orgclass/orgclassTempList.html}" method="post">
		<ul class="seachform">
			<!--<li>
				<label>名称：</label>
				<input name="LIKE_name" type="text" class="scinput" th:value="${search.get('LIKE_name')}"/>
			</li>-->
			<li>
				<label>&nbsp;</label>
				<input type="button" class="scbtn" value="刷新" />
			</li>
			<li>
				<ul class="toolbar">
					<a th:href="@{/sys/orgclass/orgclassTempAdd.html}"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>新增</li></a>
					<a href="javascript:;" th:onclick="'importCheck()'"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>数据校验</li></a>
					<a href="javascript:;" th:onclick="'comfirmImport()'"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>确认导入</li></a>
				</ul>
			</li>
		</ul>
	</form>
	<table class="tablelist">
		<thead>
		<tr>
			<th>vipId</th>
			<th>学生姓名</th>
			<th>年级</th>
			<th>学校</th>
			<th>班级</th>
			<th>家长姓名</th>
			<th>老师id</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="${item.vipId}" ></td>
			<td th:text="${item.childName}" ></td>
			<td th:text="${item.grade}" ></td>
			<td th:text="${item.school}" ></td>
			<td th:text="${item.schoolClass}" ></td>
			<td th:text="${item.parentName}" ></td>
			<td th:text="${item.teacherId}" ></td>
			<td th:text="${item.teacherName}" ></td>
			<td th:text="${item.teacherPhone}" ></td>
			<td th:text="${item.subject}" ></td>
			<td th:text="${item.orgName}" ></td>
			<td style="width: 141px;" th:text="${#calendars.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
			<td th:text="${item.status}" ></td>
			<td th:text="${item.errorReason}" ></td>
			<td>
				<a th:href="@{/sys/orgclass/orgclassTempAdd.html(id=${item.id})}" class="tablelink" >修改</a>
				<a href="javascript:;" th:onclick="'deleteById(\''+${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">
    function deleteById(id){
        parent.layer.confirm("确定删除吗？",
            {icon: 4, btn: ['确定','取消']
            }, function(){
                $.ajax({
                    url: '[[${sysUrl}]]/sys/orgclass/orgclassTempDelete',
                    type: "post",
                    data:{
                        'id': id
                    },
                    dataType: "json",
                    success:function(data){
                        if(data.meta.success){
                            parent.layer.msg("删除成功",{icon:1});
                            setTimeout(function(){
                                location.reload();
                            },1000);
                        }else{
                            parent.layer.msg(data.meta.message,{icon:11});
                        }
                    }
                });
            });
    }
	function importCheck(){
		$.ajax({
			url: '[[${sysUrl}]]/sys/orgclass/importCheck',
			type: "post",
			data:{},
			dataType: "json",
			success:function(data){
				if(data.meta.success){
					setTimeout(function(){
						location.reload();
					},1000);
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
				}
			}
		});
	}
	function comfirmImport(){
		$.ajax({
			url: '[[${sysUrl}]]/sys/orgclass/comfirmImport',
			type: "post",
			data:{},
			dataType: "json",
			success:function(data){
				if(data.meta.success){
					parent.layer.msg("导入成功",{icon:1});
					setTimeout(function(){
						location.reload();
					},1000);
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
				}
			}
		});
	}
</script>
</html>