|
|
<!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></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>
|
|
|
</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");
|
|
|
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,
|
|
|
},
|
|
|
function () {
|
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
|
if (stage == "xx") {
|
|
|
parent.layui.table.reload("xxTable");
|
|
|
} else {
|
|
|
parent.layui.table.reload("czTable");
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
} 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>
|