rushfee/resource/html/tick/importExlfile.html

77 lines
2.3 KiB
HTML
Raw Normal View History

2022-05-16 15:07:40 +00:00
<html login="false" auth="false">
<head>
<title>企业历史注册信息批量导入</title>
<script src="www/lib/uploader/swfupload/swfupload.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function (){
$("#errorbtn").hide();
});
function onFileSelect(e) {//file,sender,source,type[fileselect]
var file=e.file;//size,modificationdate,creationdate,post,type[.txt],id,name,filestatus,index[0]
//alert(file.name);
}
function onUploadSuccess(e) {
var result=aos.decode(e.serverData);
if(result.data.iflag==0){
alert("存在异常信息,请下载查看!");
aos.get('filename').setValue(result.data.filename);
$("#errorbtn").show();
//$('#filename').val(result.data.filename);
}else{
alert(result.data.info);
}
this.setText("");
}
function onUploadError(e) {
}
function startUpload() {
var fileupload = aos.get("fileupload1");
fileupload.startUpload();
}
</script>
</head>
<body>
<div widget="toolbar">
<a widget="button" iconCls="icon-import" onclick="startUpload()">导入</a>
<input widget="edit" name="filename" style="display: none" /> <!-- style="display: none" -->
<a widget="button" iconCls="icon-bottom" onclick="downtemplate()">导入模板下载</a>
<a widget="button" iconCls="icon-bottom" id="errorbtn" style="display: none" onclick="downfile()">异常文件下载</a>
</div>
<div widget="" style="width: 100%; height: 100%;">
<input id="fileupload1" widget="fileupload" limitType="*.xlsx"
flashUrl="www/lib/uploader/swfupload/swfupload.swf"
uploadUrl="operExlData/importExlfile" buttonText="浏览"
uploadOnSelect="false" onuploadsuccess="onUploadSuccess"
onuploaderror="onUploadError" onfileselect="onFileSelect" />
<div style="margin-left:10px;margin-right:40px;margin-top:20px"><span ><font color="blue"> 注:&nbsp;请按照模版上传文件限制10000条信息</font></span></div>
</div>
</div>
</body>
<script type="text/javascript">
function downfile(){
$("#errorbtn").hide();
var fileName = aos.get('filename').value;
var base = document.getElementsByTagName("base")[0].href;
window.location.href=base+"operExlData/downErrorFile?fileName="+fileName;
return false;
}
function downtemplate(){
window.open("www/lib/PhonePlate.xlsx");
}
</script>
</html>