|
|
@ -624,21 +624,21 @@ export default { |
|
|
|
}); |
|
|
|
const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 |
|
|
|
formData.append("file", file.file); //添加文件对象 |
|
|
|
formData.append("fileMode",'VOLUNTEER'); |
|
|
|
await this.$http |
|
|
|
.post("/actual/base/resiCategorized/volunteer/import", formData) |
|
|
|
.post("/actual/base/importExcelData/extractExcelHead", formData) |
|
|
|
.then((res) => { |
|
|
|
console.log("res-up", res); |
|
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
|
this.$message.success("导入成功"); |
|
|
|
this.getTableData(); |
|
|
|
this.$refs.upload.clearFiles(); |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
const { metaListData, fileCode, msg } = res.data.data; |
|
|
|
this.dataList = metaListData; |
|
|
|
// 相等于在for循环中写filter过滤,这样写能够以 O(1) 的时间复杂度获取 itemGroupId 匹配的元素。 |
|
|
|
this.importCode = fileCode; |
|
|
|
this.handleComfirmUpload() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("失败", err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
// this.$message.error('导入失败') |
|
|
|
}); |
|
|
|
});// |
|
|
|
}, |
|
|
|
// 搜索事件 |
|
|
|
handleSearch(val) { |
|
|
|