|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<title></title>
|
|
|
|
|
<link rel="stylesheet" href="./component/pear/css/pear.css" />
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<div class="mainBox">
|
|
|
|
|
<div class="main-container">
|
|
|
|
|
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<button class="layui-btn layui-btn-sm" 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: #ffb800;border-left: 5px solid #ffb800;">
|
|
|
|
|
温馨提示:导入操作将覆盖当前所有数据。
|
|
|
|
|
</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="layui-btn layui-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 stage = GetQueryString("stage");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#downTemplate").click(function () {
|
|
|
|
|
window.location.href = '/QingLong/teacher/getImportTemplate';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#downError").click(function () {
|
|
|
|
|
window.location.href = '/QingLong/teacher/downloadErrorXls?uuidString=' + errorUUID;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
upload.render({
|
|
|
|
|
elem: '#selectFile',
|
|
|
|
|
url: '/QingLong/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>
|