|
|
@ -39,6 +39,8 @@ |
|
|
|
type="green" |
|
|
|
size="small" |
|
|
|
@click="handleAdd">新增小区</el-button> |
|
|
|
<div class="btn_upload" |
|
|
|
v-if="agencyObj.level==='community'||agencyObj.level==='grid'"> |
|
|
|
<el-button style="" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
@ -91,6 +93,7 @@ |
|
|
|
size="small" |
|
|
|
type="red">导入房屋数据</el-button> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
@ -237,7 +240,7 @@ export default { |
|
|
|
if (fromTree) { |
|
|
|
this.agencyObj = treeObj |
|
|
|
} |
|
|
|
// console.log(this.agencyObj) |
|
|
|
console.log(this.agencyObj) |
|
|
|
const url = "/gov/org/neighborhood/neighborhoodlist" |
|
|
|
|
|
|
|
let params = { |
|
|
@ -399,18 +402,18 @@ export default { |
|
|
|
|
|
|
|
handleExportModule (type) { |
|
|
|
let title = '' |
|
|
|
let url = "/gov/org/neighborhood/exporttemplate" |
|
|
|
let url = "" |
|
|
|
if (type === 'community') { |
|
|
|
title = '小区导入模板' |
|
|
|
url = '' |
|
|
|
url = '/gov/org/neighborhood/exporttemplate' |
|
|
|
|
|
|
|
} else if (type === 'building') { |
|
|
|
title = '楼宇导入模板' |
|
|
|
url = '' |
|
|
|
url = '/gov/org/building/exporttemplate' |
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
|
title = '房间导入模板' |
|
|
|
url = '' |
|
|
|
url = '/gov/org/house/exporttemplate' |
|
|
|
} |
|
|
|
|
|
|
|
let params = {} |
|
|
@ -461,13 +464,13 @@ export default { |
|
|
|
|
|
|
|
//清空上传列表 |
|
|
|
let url = '' |
|
|
|
let params = {} |
|
|
|
|
|
|
|
let fileFormData = new FormData(); |
|
|
|
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 === 'grid' ? 'grid' : 'agency');//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
|
|
|
|
|
|
params.file = fileFormData |
|
|
|
params.orgId = this.agencyObj.id |
|
|
|
params.orgType = this.agencyObj.level === 'grid' ? 'grid' : 'agency' |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'community') { |
|
|
@ -482,24 +485,31 @@ export default { |
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
|
this.$refs['upload_room'].clearFiles() |
|
|
|
url = '/gov/org/ichouse/houseimport' |
|
|
|
url = '/gov/org/house/houseimport' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "导入成功" |
|
|
|
}); |
|
|
|
this.startLoading() |
|
|
|
window.app.ajax.post2(url, fileFormData, |
|
|
|
(data, rspMsg) => { |
|
|
|
this.endLoading() |
|
|
|
if (data.code === 0 || data.code > 8000) { |
|
|
|
// this.$message({ |
|
|
|
// type: "success", |
|
|
|
// message: "导入成功" |
|
|
|
// }); |
|
|
|
this.$message.success(rspMsg) |
|
|
|
this.$emit('refreshTree') |
|
|
|
this.loadTable() |
|
|
|
} else { |
|
|
|
// debugger |
|
|
|
// this.$message.error(msg) |
|
|
|
this.$message.error(rspMsg) |
|
|
|
} |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.endLoading() |
|
|
|
this.$message.error(rspMsg) |
|
|
|
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -587,6 +597,11 @@ export default { |
|
|
|
.div_btn { |
|
|
|
display: flex; |
|
|
|
margin-top: 20px; |
|
|
|
|
|
|
|
.btn_upload { |
|
|
|
margin-left: 10px; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.el-row { |
|
|
|