|
|
@ -42,16 +42,16 @@ |
|
|
|
<el-button style="" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
@click="handleExportModule">下载小区模板</el-button> |
|
|
|
@click="handleExportModule('community')">下载小区模板</el-button> |
|
|
|
|
|
|
|
<el-upload ref="upload" |
|
|
|
<el-upload ref="upload_community" |
|
|
|
style="" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'community')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:http-request="uploadFile"> |
|
|
|
:http-request="(()=>{uploadFile( 'community')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
type="red">导入小区数据</el-button> |
|
|
@ -60,18 +60,16 @@ |
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
@click="handleExportModule">下载楼宇模板</el-button> |
|
|
|
@click="handleExportModule('building')">下载楼宇模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload" |
|
|
|
ref="upload_building" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'building')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:limit="1" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:http-request="uploadFile"> |
|
|
|
:http-request="(()=>{uploadFile( 'building')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
type="red">导入楼宇数据</el-button> |
|
|
@ -79,18 +77,16 @@ |
|
|
|
<el-button style=";margin-left:10px" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
|
@click="handleExportModule">下载房屋模板</el-button> |
|
|
|
@click="handleExportModule('room')">下载房屋模板</el-button> |
|
|
|
|
|
|
|
<el-upload style="" |
|
|
|
ref="upload" |
|
|
|
ref="upload_room" |
|
|
|
:multiple='false' |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="((file)=>{beforeUpload(file, 'room')})" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:limit="1" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:http-request="uploadFile"> |
|
|
|
:http-request="(()=>{uploadFile( 'room')})"> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
type="red">导入房屋数据</el-button> |
|
|
@ -241,9 +237,9 @@ export default { |
|
|
|
if (fromTree) { |
|
|
|
this.agencyObj = treeObj |
|
|
|
} |
|
|
|
|
|
|
|
// console.log(this.agencyObj) |
|
|
|
const url = "/gov/org/neighborhood/neighborhoodlist" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/neighborhood/neighborhoodlist" |
|
|
|
|
|
|
|
let params = { |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageNo: this.pageNo, |
|
|
@ -401,11 +397,22 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleExportModule () { |
|
|
|
handleExportModule (type) { |
|
|
|
let title = '' |
|
|
|
title = '小区模板' |
|
|
|
let url = "/gov/org/neighborhood/exporttemplate" |
|
|
|
if (type === 'community') { |
|
|
|
title = '小区导入模板' |
|
|
|
url = '' |
|
|
|
|
|
|
|
} else if (type === 'building') { |
|
|
|
title = '楼宇导入模板' |
|
|
|
url = '' |
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
|
title = '房间导入模板' |
|
|
|
url = '' |
|
|
|
} |
|
|
|
|
|
|
|
const url = "/gov/org/neighborhood/exporttemplate" |
|
|
|
let params = {} |
|
|
|
|
|
|
|
app.ajax.exportFilePost( |
|
|
@ -441,11 +448,10 @@ export default { |
|
|
|
}, |
|
|
|
// 上传文件个数超过定义的数量 |
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
|
|
|
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
|
|
|
}, |
|
|
|
|
|
|
|
async uploadFile () { |
|
|
|
async uploadFile (type) { |
|
|
|
|
|
|
|
if (this.fileName == "") { |
|
|
|
|
|
|
@ -454,13 +460,34 @@ export default { |
|
|
|
this.loading = true |
|
|
|
|
|
|
|
//清空上传列表 |
|
|
|
this.$refs['upload'].clearFiles() |
|
|
|
|
|
|
|
var url = '/gov/org/neighborhood/import' |
|
|
|
let url = '' |
|
|
|
let params = {} |
|
|
|
let fileFormData = new FormData(); |
|
|
|
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, fileFormData) |
|
|
|
params.file = fileFormData |
|
|
|
params.orgId = this.agencyObj.id |
|
|
|
params.orgType = this.agencyObj.level === 'grid' ? 'grid' : 'agency' |
|
|
|
|
|
|
|
|
|
|
|
if (type === 'community') { |
|
|
|
this.$refs['upload_community'].clearFiles() |
|
|
|
url = '/gov/org/icneighborhood/neighborhoodimport' |
|
|
|
|
|
|
|
|
|
|
|
} else if (type === 'building') { |
|
|
|
this.$refs['upload_building'].clearFiles() |
|
|
|
url = '/gov/org/building/buildingimport' |
|
|
|
|
|
|
|
|
|
|
|
} else if (type === 'room') { |
|
|
|
this.$refs['upload_room'].clearFiles() |
|
|
|
url = '/gov/org/ichouse/houseimport' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|