Files
dsProject/dsBase/WebRoot/view/ywgl/xswh/import.html
2025-08-14 15:45:08 +08:00

138 lines
4.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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/student/getImportTemplate?school_id='+bureauId;
});
$("#downError").click(function () {
window.location.href = '/dsBase/student/downloadErrorXls?uuidString=' + errorUUID;
});
upload.render({
elem: '#selectFile',
url: '/dsBase/student/UploadToImportStudent',
auto: false,
accept: 'file',
data: {
bureau_id: bureauId
},
bindAction: '#uploadFile',
before: function () {
layer.load();
},
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.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>