You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.5 KiB

4 months ago
<!DOCTYPE html>
<html lang="en">
4 months ago
<head>
<meta charset="UTF-8" />
4 months ago
<title></title>
<link rel="stylesheet" href="./component/pear/css/pear.css" />
4 months ago
</head>
4 months ago
4 months ago
<body>
4 months ago
<div class="mainBox">
4 months ago
<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>
4 months ago
</div>
4 months ago
<div></div>
<div class="layui-form-item" id="info">
<blockquote
class="layui-elem-quote"
style="color: #ffb800; border-left: 5px solid #ffb800"
>
<a
href="/dsideal_yy/ypt/intellioa/java/schoolDistrict/downloadTemplate"
style="margin-right: 20px; color: #1e9fff"
>下载模板</a
>温馨提示:导入操作将覆盖当前所有数据。
</blockquote>
</div>
</div>
4 months ago
</div>
<div class="bottom">
4 months ago
<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>
4 months ago
</div>
<script src="./component/layui/layui.js"></script>
<script src="./component/pear/pear.js"></script>
<script>
4 months ago
layui.use(["form", "jquery", "upload"], function () {
var form = layui.form;
var $ = layui.jquery;
var upload = layui.upload;
var errorUUID = "";
var stage = GetQueryString("stage");
var stageId = 2;
if (stage == "xx") {
stageId = 1;
}
upload.render({
elem: "#selectFile",
url:
"/dsideal_yy/ypt/intellioa/java/schoolDistrict/importTemplate?stage=" +
stageId,
auto: false,
accept: "file",
bindAction: "#uploadFile",
before: function () {
//obj参数包含的信息跟 choose回调完全一致可参见上文。
layer.load(); //上传loading
},
done: function (res) {
if (res.code === 2000) {
layer.msg(
"批量导入成功!",
{
icon: 1,
time: 1300,
4 months ago
},
4 months ago
function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
if (stage == "xx") {
parent.layui.table.reload("xxTable");
} else {
parent.layui.table.reload("czTable");
}
4 months ago
}
4 months ago
);
} else {
layer.closeAll("loading");
// layer.msg(res.message, {
// icon: 2,
// time: 2000
// });
errorUUID = res.uuid;
$("#error").show();
$("#info").hide();
4 months ago
}
4 months ago
},
4 months ago
});
4 months ago
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);
4 months ago
4 months ago
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>