77 lines
2.3 KiB
HTML
77 lines
2.3 KiB
HTML
<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="rush/kaohe/import_Cancel" buttonText="浏览"
|
|
uploadOnSelect="false" onuploadsuccess="onUploadSuccess"
|
|
onuploaderror="onUploadError" onfileselect="onFileSelect" />
|
|
<div style="margin-left:10px;margin-right:40px;margin-top:20px"><span ><font color="blue"> 注: 请按照模版上传文件!注意文件后缀为.xlsx</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+"rush/kaohe/downErrorFile?fileName="+fileName;
|
|
return false;
|
|
}
|
|
function downtemplate(){
|
|
window.open("www/lib/cancel.xlsx");
|
|
}
|
|
|
|
|
|
</script>
|
|
</html> |