|
|
|
|
@ -245,6 +245,7 @@
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
drag
|
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
@ -758,7 +759,18 @@ export default {
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
submitFileForm() {
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleBeforeUpload(file) {
|
|
|
|
|
let fileType = ["xls", "xlsx"]
|
|
|
|
|
const fileName = file.name.split('.');
|
|
|
|
|
const fileExt = fileName[fileName.length - 1];
|
|
|
|
|
const isTypeOk = fileType.indexOf(fileExt) >= 0;
|
|
|
|
|
if (!isTypeOk) {
|
|
|
|
|
this.$modal.msgError(`文件类型只能为xls格式/.xlsx格式`);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|