|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>学生信息导入</title>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport"
|
|
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
<link rel="stylesheet" href="../../static/css/font.css">
|
|
|
<link rel="stylesheet" href="../../static/css/weadmin.css">
|
|
|
<link rel="stylesheet" href="../../lib/ztree/zTreeStyle.css">
|
|
|
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
|
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
|
|
<![endif]-->
|
|
|
<style>
|
|
|
select {
|
|
|
width: 180px;
|
|
|
height: 38px;
|
|
|
line-height: 38px;
|
|
|
border: 1px solid #ccc;
|
|
|
border-radius: 3px;
|
|
|
font-size: 15px;
|
|
|
padding-left: 6px;
|
|
|
color: #666;
|
|
|
}
|
|
|
|
|
|
.inline {
|
|
|
display: inline-block;
|
|
|
vertical-align: top;
|
|
|
}
|
|
|
|
|
|
.disabled {
|
|
|
pointer-events: none;
|
|
|
border: 1px solid #e6e6e6;
|
|
|
background: #FBFBFB;
|
|
|
color: #C9C9C9;
|
|
|
cursor: not-allowed;
|
|
|
opacity: 1;
|
|
|
}
|
|
|
|
|
|
#searchTxt {
|
|
|
width: 164px;
|
|
|
border: 1px solid #dedede;
|
|
|
border-radius: 3px;
|
|
|
height: 37px;
|
|
|
padding-left: 13px;
|
|
|
vertical-align: top;
|
|
|
}
|
|
|
|
|
|
#search {
|
|
|
border: none;
|
|
|
margin-left: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
#iconDel {
|
|
|
position: absolute;
|
|
|
right: 92px;
|
|
|
top: 10px;
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
.aaa {
|
|
|
background-color: #FBFBFB;
|
|
|
border: 1px solid #e6e6e6;
|
|
|
color: #C9C9C9;
|
|
|
cursor: not-allowed;
|
|
|
opacity: 1;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="weadmin-nav">
|
|
|
<span class="layui-breadcrumb" id="super">
|
|
|
<a href="">首页</a>
|
|
|
<a href="">防控安全管理<span id="tiptit">
|
|
|
</span></a>
|
|
|
<a><cite>学生信息导入</cite></a>
|
|
|
</span>
|
|
|
<a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right"
|
|
|
href="javascript:location.reload();" title="刷新">
|
|
|
<i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
|
|
|
</div>
|
|
|
<div class="weadmin-body">
|
|
|
<div class="layui-form-item inline">
|
|
|
<label for="" class="layui-form-label">
|
|
|
班级
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_1" style="width: 500px"></div>
|
|
|
<script type="text/html" id="test1">
|
|
|
<select name="service_type" id="sel1" onchange="getplaceTable()">
|
|
|
<% for (var i = 0; i < data.length; i ++) { %>
|
|
|
<option value="<%=data[i].class_id%>"><%=data[i].class_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-form-item inline" style="float:right">
|
|
|
<span id="importAcc">
|
|
|
|
|
|
<div class="layui-btn layui-btn-normal" type="button" id="importInformation" onclick="importInformation();">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>导入学生新增信息
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-btn layui-btn-warm" type="button" id="exportInformation" onclick="exportInformation();">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>导出新增错误信息
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-btn layui-btn-danger" type="button" id="clearInformation" onclick="clearInformation()">
|
|
|
<span class="layui-icon layui-icon-shrink-right"></span>清空新增信息
|
|
|
</div>
|
|
|
|
|
|
</span>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="layui-form-item">
|
|
|
<table class="layui-table" lay-filter="idTest" id="idTest"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="../../lib/layui/layui.js"></script>
|
|
|
<script src="../../lib/template.js"></script>
|
|
|
<script src="../../lib/base64.js"></script>
|
|
|
<script>
|
|
|
layui.extend({
|
|
|
admin: '{/}../../static/js/admin'
|
|
|
});
|
|
|
layui.use(['form', 'jquery', 'admin', 'table','element'], function () {
|
|
|
var form = layui.form,
|
|
|
$ = layui.jquery,
|
|
|
admin = layui.admin,
|
|
|
table = layui.table,
|
|
|
element = layui.element;
|
|
|
|
|
|
//获取url传参的办法
|
|
|
window.GetQueryString = function (name, istop) {
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
|
return null;
|
|
|
};
|
|
|
//导入学生新增信息
|
|
|
window.importInformation = function () {
|
|
|
WeAdminShow('导入学生信息', './importExcelInformation.html', 600, 300);
|
|
|
};
|
|
|
|
|
|
//导出新增错误信息
|
|
|
window.exportInformation = function () {
|
|
|
window.location.href = '/baseService/mobile/exportInformation';
|
|
|
};
|
|
|
//清空学生新增信息
|
|
|
window.clearInformation = function () {
|
|
|
var class_id = $("#sel1").val();
|
|
|
layer.confirm('执行本操作后,选择班级所有学生新导入的信息将被清除,您确定要继续吗?', {
|
|
|
btn: ['确定', '取消']
|
|
|
}, function (index, layero) {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
url: "/baseService/mobile/clearExcelInformation?class_id="+class_id,
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
layer.msg("清空成功!", {icon: 1, time: 1000});
|
|
|
getplaceTable();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
window.getclass = function () {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/mobile/getclass",
|
|
|
success: function (data) {
|
|
|
var html = template.render('test1', data);
|
|
|
document.getElementById('select_1').innerHTML = html;
|
|
|
form.render();
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
getclass();
|
|
|
window.getplaceTable = function () {
|
|
|
var class_id = $("#sel1").val();
|
|
|
table.render({
|
|
|
elem: '#idTest'
|
|
|
, url: '/baseService/mobile/xueshengxinxi_list?class_id='+class_id
|
|
|
, cols: [[
|
|
|
{field: 'place_id', title: '序号', align: 'center', type: 'numbers', width: 80}
|
|
|
, {field: 'class_name', title: '班级', align: 'center'}
|
|
|
, {field: 'person_name', title: '姓名', align: 'center',
|
|
|
templet: function (d) {
|
|
|
if (d.imgExist == 0||d.imgExist === undefined) {
|
|
|
var str = '<div>' + d.person_name + '</div>';
|
|
|
return str;
|
|
|
}else{
|
|
|
var str = '<div><a href="#" class="layui-table-link" onclick="showStudentPhoto(\''+d.person_name+'\'\,\'' + d.idcard_code + '\')">' + d.person_name + '</a></div>';
|
|
|
return str;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
, {field: 'xb_name', title: '性别', align: 'center'}
|
|
|
, {field: 'birthday', title: '出生日期', align: 'center'}
|
|
|
, {field: 'idcard_code', title: '身份证号', align: 'center'}
|
|
|
, {field: 'imgExist', title: '照片上传', align: 'center', width: 100}
|
|
|
, {field: 'zzmm_name', title: '政治面貌', align: 'center'}
|
|
|
, {field: 'mz_name', title: '民族', align: 'center'}
|
|
|
, {field: 'parent_phone', title: '家长电话', align: 'center'}
|
|
|
, {field: 'dorm', title: '寝室', align: 'center'}
|
|
|
, {field: 'poor', title: '是否为贫困生', align: 'center',
|
|
|
templet: function (d) {
|
|
|
if (d.poor == 1) {
|
|
|
var str = '<div>是</div>';
|
|
|
return str;
|
|
|
}else if(d.poor == 2){
|
|
|
var str = '<div>否</div>';
|
|
|
return str;
|
|
|
}else{
|
|
|
var str = '<div></div>';
|
|
|
return str;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
]]
|
|
|
, page: true
|
|
|
, height: 'full'
|
|
|
, done: function () {
|
|
|
$("[data-field='imgExist']").children().each(function () {
|
|
|
if ($(this).text() == '1') {
|
|
|
$(this).css("background", "#5FB878")
|
|
|
$(this).text("是")
|
|
|
} else if ($(this).text() == '0') {
|
|
|
$(this).css("background", "#FF5722")
|
|
|
$(this).text("否")
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
getplaceTable();
|
|
|
//显示考生照片
|
|
|
window.showStudentPhoto = function (person_name,idcard_code) {
|
|
|
WeAdminShow('【'+person_name+'】照片', "../zhaosheng/StudentImage/" + idcard_code+".JPG", 210, 323);
|
|
|
};
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |