|
|
@ -288,14 +288,15 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
beforeUpload(file) { |
|
|
|
console.log(file) |
|
|
|
const extension = file.name.split('.')[1] === 'xls' |
|
|
|
const extension2 = file.name.split('.')[1] === 'xlsx' |
|
|
|
if (!extension && !extension2) { |
|
|
|
this.$message.error('上传文件只能是excel') |
|
|
|
return false |
|
|
|
const extension = file.name.split('.') |
|
|
|
if (extension && extension.length > 1) { |
|
|
|
const ext = extension[extension.length - 1] |
|
|
|
if (ext === 'xlsx' || ext === 'xls') { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
this.$message.error('上传文件只能是excel') |
|
|
|
return false |
|
|
|
}, |
|
|
|
uploadImportFile(file) { |
|
|
|
uploadImport(file.file).then(response => { |
|
|
|