|
@ -215,7 +215,7 @@ export default { |
|
|
if (fromTree) { |
|
|
if (fromTree) { |
|
|
this.agencyObj = treeObj |
|
|
this.agencyObj = treeObj |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(this.agencyObj) |
|
|
const url = "/gov/org/building/buildinglist" |
|
|
const url = "/gov/org/building/buildinglist" |
|
|
let params = { |
|
|
let params = { |
|
|
pageSize: this.pageSize, |
|
|
pageSize: this.pageSize, |
|
@ -380,11 +380,11 @@ export default { |
|
|
let url = "/gov/org/neighborhood/exporttemplate" |
|
|
let url = "/gov/org/neighborhood/exporttemplate" |
|
|
if (type === 'building') { |
|
|
if (type === 'building') { |
|
|
title = '楼宇导入模板' |
|
|
title = '楼宇导入模板' |
|
|
url = '' |
|
|
url = '/gov/org/neighborhood/exporttemplate' |
|
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
} else if (type === 'room') { |
|
|
title = '房间导入模板' |
|
|
title = '房屋导入模板' |
|
|
url = '' |
|
|
url = '/gov/org/house/exporttemplate' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -440,35 +440,46 @@ export default { |
|
|
let params = {} |
|
|
let params = {} |
|
|
let fileFormData = new FormData(); |
|
|
let fileFormData = new FormData(); |
|
|
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
|
|
|
params.file = fileFormData |
|
|
// params.file = fileFormData |
|
|
params.orgId = this.agencyObj.id |
|
|
// params.orgId = this.agencyObj.id |
|
|
params.orgType = this.agencyObj.level |
|
|
// params.orgType = this.agencyObj.level |
|
|
|
|
|
|
|
|
if (type === 'building') { |
|
|
if (type === 'building') { |
|
|
this.$refs['upload_building'].clearFiles() |
|
|
this.$refs['upload_building'].clearFiles() |
|
|
url = '/gov/org/building/buildingimport' |
|
|
url = 'http://192.168.51.26:8080/api/gov/org/building/buildingimport' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
} else if (type === 'room') { |
|
|
this.$refs['upload_room'].clearFiles() |
|
|
this.$refs['upload_room'].clearFiles() |
|
|
url = '/gov/org/ichouse/houseimport' |
|
|
// url = 'http://192.168.51.26:8080/api/gov/org/house/houseimport' |
|
|
|
|
|
url = '/gov/org/house/houseimport' |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, fileFormData) |
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "success", |
|
|
window.app.ajax.post2(url, fileFormData, |
|
|
message: "导入成功" |
|
|
(data, rspMsg) => { |
|
|
}); |
|
|
|
|
|
|
|
|
if (data.code === 0 || data.code > 8000) { |
|
|
|
|
|
// this.$message({ |
|
|
|
|
|
// type: "success", |
|
|
|
|
|
// message: "导入成功" |
|
|
|
|
|
// }); |
|
|
|
|
|
this.$message.success(rspMsg) |
|
|
this.$emit('refreshTree') |
|
|
this.$emit('refreshTree') |
|
|
this.loadTable() |
|
|
this.loadTable() |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg) |
|
|
this.$message.error(rspMsg) |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
(rspMsg, data) => { |
|
|
|
|
|
|
|
|
|
|
|
this.$message.error(rspMsg) |
|
|
|
|
|
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|