Browse Source

保障房走智能导入

V1.0
mk 2 years ago
parent
commit
851c73b0ea
  1. 31
      src/views/modules/base/residentManagement/housingNature/housingNature.vue

31
src/views/modules/base/residentManagement/housingNature/housingNature.vue

@ -302,21 +302,43 @@ export default {
}); });
const formData = new FormData(); //FormDataappend('key', value) const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); // formData.append("file", file.file); //
formData.append("fileMode",'ENSUREHOUSE');
await this.$http await this.$http
.post("/actual/base/resiHousingNature/import", formData) .post("/actual/base/importExcelData/extractExcelHead", formData)
.then((res) => {
const { metaListData, fileCode, msg } = res.data.data;
this.dataList = {"所属网格":"所属网格","所属小区":"所属小区","所属楼栋":"所属楼栋","所属单元":"所属单元","所属房屋":"所属房屋","本地户籍":"本地户籍","居民姓名":"居民姓名","联系电话":"联系电话","国籍":"国籍","证件类型":"证件类型","证件号":"证件号","民族":"民族","备注":"备注","户籍地址":"户籍所在地","现居地址":"现居住地址","房东姓名":"房东姓名","房东身份证号":"房东身份证号","住房性质":"住房性质","领取通知书日期":"领取通知书日期","保障类型":"保障类型","发证日期":"发证日期","补贴编号":"补贴编号","补贴金额":"补贴金额"};
// forfilter, O(1) itemGroupId
this.importCode = fileCode;
this.handleComfirmUpload()
})
.catch((err) => {
console.log("失败", err);
file.onError(); //
// 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) => { .then((res) => {
console.log("res-up", res); console.log("res-up", res);
if (res.data.code == 0 && res.data.msg == "success") { if (res.data.code == 0 && res.data.msg == "success") {
this.$message.success("导入成功");
this.getTableData(); this.getTableData();
this.$refs.upload.clearFiles();
} else this.$message.error(res.data.msg); } else this.$message.error(res.data.msg);
}) })
.catch((err) => { .catch((err) => {
console.log("失败", err); console.log("失败", err);
file.onError(); // file.onError(); //
// this.$message.error('')
}); });
this.importLoading = false;
this.importBtnTitle = "导入";
}, },
// //
handleSearch(val) { handleSearch(val) {
@ -356,6 +378,7 @@ export default {
this.showAdd = false; this.showAdd = false;
this.showEdit = false; this.showEdit = false;
}, },
// //
handleComfirm(type) { handleComfirm(type) {
this.handleClose(); this.handleClose();

Loading…
Cancel
Save