|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>中招录取导入Excel</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/layui/css/layui.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]-->
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
<div class="weadmin-body">
|
|
|
<div class="layui-form-item template">
|
|
|
<div style="color: red;font-size:12px;margin-top: 10px;margin-bottom: 10px;">温馨提示:导入信息需要严格按照中招导入模板!!!
|
|
|
</div>
|
|
|
<label for="" class="layui-form-label" style="margin-left:0px;width:50px;">
|
|
|
<span class="we-red">*</span> 省份
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_1"></div>
|
|
|
<script type="text/html" id="test1">
|
|
|
<select name="sel1" id="sel1" style="width:200px;height:32px;" onchange="changeSelect(1)">
|
|
|
<% for (var i = 0; i < data.length; i ++) { %>
|
|
|
<option value="<%=data[i].area_code%>"><%=data[i].area_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item template">
|
|
|
<label for="" class="layui-form-label" style="margin-left:0px;width:50px;">
|
|
|
<span class="we-red">*</span> 专业
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_2"></div>
|
|
|
<script type="text/html" id="test2">
|
|
|
<select id="sel2" name="sel2" style="width:200px;height:32px;" onchange="changeSelect(2)">
|
|
|
<% for (var i = 0; i < data.length;i ++) { %>
|
|
|
<option value="<%=data[i].zhuanye_code%>"><%=data[i].zhuanye_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item" style="margin-top: 68px">
|
|
|
<button type="button" class="layui-btn layui-btn-normal" id="test8" style="width: 180px;">选择.xls文件</button>
|
|
|
<button type="button" class="layui-btn" id="test9" style="margin-left: 10px;">上传</button>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<button class="layui-btn" style="margin-left: 500px;" id="closeDialog">关闭</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="../../lib/layui/layui.js"></script>
|
|
|
<script src="../../lib/template.js"></script>
|
|
|
<script src="../../lib/base64.js"></script>
|
|
|
<script>
|
|
|
//获取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;
|
|
|
};
|
|
|
|
|
|
layui.extend({
|
|
|
admin: '{/}../../static/js/admin'
|
|
|
});
|
|
|
layui.use(['jquery', 'admin', 'upload', 'layer'], function () {
|
|
|
var $ = layui.jquery,
|
|
|
admin = layui.admin,
|
|
|
layer = layui.layer,
|
|
|
upload = layui.upload;
|
|
|
var batch_id=GetQueryString("batch_id");
|
|
|
var area_code="";
|
|
|
var zhuanye_code="";
|
|
|
window.bindShengFen = function () {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/xueji/common_getShengFenByJihua?batch_id="+batch_id+"&area_code="+area_code,
|
|
|
success: function (data) {
|
|
|
var html = template.render('test1', data);
|
|
|
document.getElementById('select_1').innerHTML = html;
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
bindShengFen();
|
|
|
//绑定专业下拉框
|
|
|
function bindZhuanYeSelect() {
|
|
|
area_code=$("#sel1").val();
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
url: "/baseService/xueji/common_getZhuanYeByJihua?batch_id="+batch_id+"&area_code="+area_code,
|
|
|
success: function (data) {
|
|
|
var html = template.render('test2', data);
|
|
|
document.getElementById('select_2').innerHTML = html;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
bindZhuanYeSelect();
|
|
|
window.changeSelect = function (i) {
|
|
|
if (i == 1) {
|
|
|
area_code=$("#sel1").val();
|
|
|
}
|
|
|
}
|
|
|
//选完文件后不自动上传
|
|
|
upload.render({
|
|
|
elem: '#test8'
|
|
|
, url: '/baseService/xueji/zz_UploadExcel?batch_id=' + GetQueryString("batch_id")+'&person_type_id='+ GetQueryString("person_type_id")
|
|
|
, auto: false
|
|
|
, accept: 'file' //普通文件
|
|
|
, data:{"batch_id":GetQueryString("batch_id"),"person_type_id":GetQueryString("person_type_id"),"area_code":$('#sel1').val(),"zhuanye_code":$('#sel2').val()}
|
|
|
, bindAction: '#test9'
|
|
|
, before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
|
|
|
layer.load(); //上传loading
|
|
|
}
|
|
|
, done: function (res, index, upload) {
|
|
|
layer.closeAll('loading'); //关闭loading
|
|
|
if (res.success) {
|
|
|
layer.msg("导入成功", {icon: 1}, function () {
|
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
|
parent.layer.close(index);
|
|
|
parent.layui.table.reload('tableZZList',{page:{curr:1}});
|
|
|
parent.layui.table.reload('tableZZHuiZong',{page:{curr:1}});
|
|
|
})
|
|
|
} else {
|
|
|
layer.alert(res.message, function (index) {
|
|
|
layer.close(index);
|
|
|
/*if (res.message !== "检查发现是一个空的表格,不能上传!") {
|
|
|
document.getElementById('test10').style.display = "inline-block";//下载错误模板
|
|
|
$("#test10").click(function () {
|
|
|
window.location.href = '/baseService/xueji/zz_importErrorDBF?uuidString=' + res.uuid+"&type=1";
|
|
|
window.location.href = '/baseService/zhaosheng/downloadErrorXls?uuidString=' + res.uuid+"&type=1";
|
|
|
})
|
|
|
}*/
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
, error: function (index, upload) {
|
|
|
layer.closeAll('loading'); //关闭loading
|
|
|
}
|
|
|
});
|
|
|
// 关闭页面
|
|
|
$("#closeDialog").click(function () {
|
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
|
parent.layer.close(index);
|
|
|
})
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |