|
@@ -12,7 +12,7 @@
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
- <a-upload :fileList="fileList" @change="handleChange" :remove="handleRemove" :beforeUpload="beforeUpload">
|
|
|
+ <a-upload :fileList="fileList" :multiple="true" @change="handleChange" :remove="handleRemove" :beforeUpload="beforeUpload">
|
|
|
<a-button> <a-icon type="upload" />选择上传文件</a-button>
|
|
|
</a-upload>
|
|
|
</a-form-item>
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
const reg = /\.(xls|xlsx)(\?.*)?$/
|
|
|
return new Promise((resolve, reject) => {
|
|
|
if (reg.test(file.name)) {
|
|
|
- this.fileList = [file]
|
|
|
+ this.fileList = [...this.fileList, file]
|
|
|
return false
|
|
|
} else {
|
|
|
this.$message.error(`请上传正确的excel文件`)
|
|
@@ -89,7 +89,10 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
const formData = new FormData()
|
|
|
- formData.append('file', this.fileList[0])
|
|
|
+ //循环添加到formData中
|
|
|
+ this.fileList.forEach(function (file) {
|
|
|
+ formData.append('files', file, file.name)
|
|
|
+ })
|
|
|
importCheckStandard(formData)
|
|
|
.then((res) => {
|
|
|
this.$message.success(res.data)
|