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.
90 lines
3.1 KiB
90 lines
3.1 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
|
<link rel="stylesheet" href="../iconfont/iconfont.css" />
|
|
|
|
</head>
|
|
|
|
<body class="pear-container layui-form">
|
|
|
|
<div class="mainBox">
|
|
<div class="main-container" style="margin-top: 10px;">
|
|
<blockquote class="layui-elem-quote">
|
|
请下载填报模板:<a href="javascript:void(0)" style="color: #1E9FFF;font-weight: bolder;" id="downExcel">下载</a>
|
|
</blockquote>
|
|
|
|
<div class="layui-upload-drag" style="display: block;" id="uploadExcel">
|
|
<i class="layui-icon layui-icon-upload"></i>
|
|
<div>点击上传,或将文件拖拽到此处</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
<script src="../../../component/pear/pear.js"></script>
|
|
|
|
<script>
|
|
layui.use(function () {
|
|
var $ = layui.jquery;
|
|
var upload = layui.upload;
|
|
|
|
var jobId = GetQueryString("job_id");
|
|
var downExcelPath = GetQueryString("file_name");
|
|
var statusCode = GetQueryString("status_code");
|
|
|
|
$("#downExcel").click(function () {
|
|
window.location = "/QingLong/collect/downJobExcelTemplate?job_id=" + jobId;
|
|
});
|
|
|
|
upload.render({
|
|
elem: '#uploadExcel',
|
|
url: '/QingLong/collect/importData',
|
|
data: { job_id: jobId, status_code: statusCode },
|
|
text: { // 自定义提示文本
|
|
"check-error": "只允许上传xlsx格式的文件"
|
|
},
|
|
exts: 'xlsx',
|
|
done: function (res) {
|
|
if (res.success) {
|
|
layer.msg("上传成功", {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function () {
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
parent.refresh();
|
|
});
|
|
|
|
} else {
|
|
layer.msg(res.message, {
|
|
icon: 2,
|
|
time: 2000
|
|
}, function () {
|
|
if (res.upload_excel_filename_user) {
|
|
window.location = "/QingLong/Excel/" + res.upload_excel_filename_user;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
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> |