+
下载楼栋模板
+ @click="handleExportModule('building')">下载小区楼栋模板
{
if (data.code === 0 && data.msg == "success") {
// this.$message.success('导入成功')
+ this.checkExtractExcelHead(data.data.fileName,data.data.url,type === 'community'?'BUILDING_INFO':'HOUSE_INFO')
} else {
// this.$message({
// showClose: true,
@@ -1073,8 +1054,6 @@ export default {
// this.showMessage(rspMsg)
if (type === "community") {
this.importCommunityLoading = false;
- } else if (type === "building") {
- this.importBuildingLoading = false;
} else if (type === "room") {
this.importRoomLoading = false;
}
@@ -1082,9 +1061,7 @@ export default {
(rspMsg, data) => {
if (type === "community") {
this.importCommunityLoading = false;
- } else if (type === "building") {
- this.importBuildingLoading = false;
- } else if (type === "room") {
+ } else if (type === "room") {
this.importRoomLoading = false;
}
// this.$message.error(rspMsg)
@@ -1092,7 +1069,41 @@ export default {
{ headers: { "Content-Type": "multipart/form-data" } }
);
},
-
+ async checkExtractExcelHead(originFileName,originalFilePath,importCategory) {
+ const url = "/actual/base/intelligentImportData/extractExcelHead";
+ let params = {
+ originFileName,
+ originalFilePath,
+ importCategory,
+ };
+ const { data, code, msg } = await requestPost(url, params);
+ if (code === 0) {
+ this.fileCode = data.fileCode;
+ this.saveImportResiHouseExcel(originFileName)
+ } else if (code >= 8000) {
+ this.$message.err(msg);
+ this.dataListLoading = false;
+ }
+ },
+ async saveImportResiHouseExcel(originFileName) {
+ const { fileCode ,uploadType} = this;
+ const formData = new FormData();
+ let json = uploadType === 'community'?'{"所属社区":"所属社区","所属网格":"所属网格","所属小区":"所属小区","所属楼栋":"所属楼栋","所属单元":"所属单元","门牌号":"门牌号","姓名":"居民姓名","联系电话":"联系电话","证件号":"证件号","低保类别":"低保类型","因病":"因病","因残":"因残","低收入":"低收入"}':'{"所属网格":"所属网格","所属小区":"所属小区","所属楼栋":"所属楼栋","所属单元":"所属单元","门牌号":"门牌号","房屋类型":"房屋类型","居住用途":"居住用途","房屋状态":"房屋状态","房主姓名":"房主姓名","房主电话":"房主电话","房主身份证":"房主身份证","党员中心户":"党员中心户","五好家庭":"五好家庭","模范之家":"模范之家","功臣之家":"功臣之家","光荣之家":"光荣之家"}'
+ formData.append("columnMateJson", json);
+ formData.append("fileCode", fileCode);
+ formData.append("taskName", originFileName);
+ await this.$http
+ .post(
+ "/actual/base/intelligentImportData/importResiHouseExcel",
+ formData
+ )
+ .then((res) => {
+
+ })
+ .catch((err) => {
+
+ });
+ },
showMessage(msg) {
this.$alert(msg, "操作结果", {
confirmButtonText: "关闭",
diff --git a/src/views/modules/base/smartImport/cpts/executeTask.vue b/src/views/modules/base/smartImport/cpts/executeTask.vue
index 52551d636..fb8629611 100644
--- a/src/views/modules/base/smartImport/cpts/executeTask.vue
+++ b/src/views/modules/base/smartImport/cpts/executeTask.vue
@@ -230,7 +230,7 @@ export default {
async cancelTask() {
let url = "/actual/base/intelligentImportData/cancelTask";
let parm = {
- fileCode: this.fileCode,
+ fileCode: this.fileCode||this.fileCodeRow ,
taskId: this.taskId,
};
let { data, code, msg } = await requestPost(url, parm);