|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title></title>
|
|
|
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
|
|
<style>
|
|
|
.require-star {
|
|
|
position: absolute;
|
|
|
width: 3px;
|
|
|
height: 14px;
|
|
|
background-color: #ea4335;
|
|
|
top: 12px;
|
|
|
right: 8px;
|
|
|
border-radius: 1.5px;
|
|
|
}
|
|
|
|
|
|
.input-width {
|
|
|
max-width: 455px
|
|
|
}
|
|
|
|
|
|
.layui-form-select {
|
|
|
width: 280px;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
|
|
|
<div class="mainBox">
|
|
|
<div class="main-container">
|
|
|
|
|
|
<div class="layui-form-item">
|
|
|
<button class="pear-btn pear-btn-primary pear-btn-md" id="selectFile">
|
|
|
<i class="layui-icon layui-icon-upload"></i>
|
|
|
选择文件
|
|
|
</button>
|
|
|
</div>
|
|
|
<div class="layui-form-item" id="info">
|
|
|
<blockquote class="layui-elem-quote" style="color: #1e9fff;">
|
|
|
温馨提示:导入教工需要严格按照导入模板编辑教工信息,<a style="text-decoration:underline;cursor: pointer;"
|
|
|
id="downTemplate">请点此下载</a>
|
|
|
</blockquote>
|
|
|
</div>
|
|
|
<div class="layui-form-item" id="error" style="display: none">
|
|
|
<blockquote class="layui-elem-quote" style="color: #ff5722;border-left: 5px solid #ff5722;">
|
|
|
错误:Excel中的数据不正确,请下载修改后重新上传!,<a style="text-decoration:underline;cursor: pointer;"
|
|
|
id="downError">请点此下载</a>
|
|
|
</blockquote>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="bottom">
|
|
|
<div class="button-container">
|
|
|
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" id="uploadFile">
|
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
|
上传
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
|
<script src="../../../component/pear/pear.js"></script>
|
|
|
|
|
|
<script>
|
|
|
layui.use(['form', 'jquery', 'upload'], function () {
|
|
|
var form = layui.form;
|
|
|
var $ = layui.jquery;
|
|
|
var upload = layui.upload;
|
|
|
|
|
|
var errorUUID = "";
|
|
|
|
|
|
var bureauId = GetQueryString("bureau_id");
|
|
|
|
|
|
$("#downTemplate").click(function () {
|
|
|
window.location.href = '/dsBase/teacher/getImportTemplate';
|
|
|
});
|
|
|
|
|
|
$("#downError").click(function () {
|
|
|
window.location.href = '/dsBase/teacher/downloadErrorXls?uuidString=' + errorUUID;
|
|
|
});
|
|
|
|
|
|
upload.render({
|
|
|
elem: '#selectFile',
|
|
|
url: '/dsBase/teacher/UploadToImportTeacher',
|
|
|
auto: false,
|
|
|
accept: 'file',
|
|
|
data: {
|
|
|
bureau_id: bureauId
|
|
|
},
|
|
|
bindAction: '#uploadFile',
|
|
|
before: function () { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
|
|
|
layer.load(); //上传loading
|
|
|
},
|
|
|
done: function (res) {
|
|
|
if (res.success) {
|
|
|
layer.closeAll('loading');
|
|
|
$("#error").hide();
|
|
|
layer.msg("上传成功!", {
|
|
|
icon: 1,
|
|
|
time: 1300
|
|
|
}, function () {
|
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
|
parent.refresh();
|
|
|
//parent.layui.table.reload("data-table");
|
|
|
});
|
|
|
} else {
|
|
|
layer.closeAll('loading');
|
|
|
// layer.msg(res.message, {
|
|
|
// icon: 2,
|
|
|
// time: 2000
|
|
|
// });
|
|
|
errorUUID = res.uuid;
|
|
|
$("#error").show();
|
|
|
$("#info").hide();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function GetQueryString(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;
|
|
|
}
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html> |