|
|
@ -650,6 +650,9 @@ export default { |
|
|
|
nationList: [], |
|
|
|
educationList: [], |
|
|
|
}, //字典对象 |
|
|
|
|
|
|
|
importCode:'', |
|
|
|
dataList :[] |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -841,7 +844,7 @@ export default { |
|
|
|
const { metaListData, fileCode, msg } = res.data.data; |
|
|
|
this.dataList = metaListData; |
|
|
|
// 相等于在for循环中写filter过滤,这样写能够以 O(1) 的时间复杂度获取 itemGroupId 匹配的元素。 |
|
|
|
this.importCode = fileCode; |
|
|
|
this.importCode = fileCode; |
|
|
|
this.handleComfirmUpload() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
@ -850,6 +853,28 @@ export default { |
|
|
|
// this.$message.error('导入失败') |
|
|
|
});// |
|
|
|
}, |
|
|
|
async handleComfirmUpload () { |
|
|
|
this.importLoading = true; |
|
|
|
this.importBtnTitle = "正在上传中..."; |
|
|
|
const { importOption, importCode, dataList } = this; |
|
|
|
const formData = new FormData(); |
|
|
|
formData.append("columnMateJson", JSON.stringify(dataList)); |
|
|
|
formData.append("fileCode", importCode); |
|
|
|
await this.$http |
|
|
|
.post("/actual/base/importExcelData/importResiHouseExcel", formData) |
|
|
|
.then((res) => { |
|
|
|
console.log("res-up", res); |
|
|
|
if (res.data.code == 0 && res.data.msg == "success") { |
|
|
|
this.getTableData(); |
|
|
|
} else this.$message.error(res.data.msg); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("失败", err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
}); |
|
|
|
this.importLoading = false; |
|
|
|
this.importBtnTitle = "导入"; |
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
async handleExport() { |
|
|
|
const url = "/actual/base/resiCategorized/veteran/export"; |
|
|
|