|
|
@ -31,13 +31,16 @@ |
|
|
@click="handleSearch">查询</el-button> |
|
|
@click="handleSearch">查询</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<div class="div_btn"> |
|
|
<div class="div_btn"> |
|
|
<el-button type="warning" |
|
|
<el-button style="float:left" |
|
|
|
|
|
type="warning" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleExport">导出</el-button> |
|
|
@click="handleExport">导出</el-button> |
|
|
<el-button type="success" |
|
|
<el-button style="float:left" |
|
|
|
|
|
type="success" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleAdd">新增小区</el-button> |
|
|
@click="handleAdd">新增小区</el-button> |
|
|
<el-button type="primary" |
|
|
<el-button style="float:left" |
|
|
|
|
|
type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
@click="handleExportModule">下载小区模板</el-button> |
|
|
@click="handleExportModule">下载小区模板</el-button> |
|
|
|
|
|
|
|
|
@ -45,19 +48,16 @@ |
|
|
:multiple='false' |
|
|
:multiple='false' |
|
|
:show-file-list='false' |
|
|
:show-file-list='false' |
|
|
:before-upload="beforeUpload" |
|
|
:before-upload="beforeUpload" |
|
|
action='' |
|
|
action="" |
|
|
|
|
|
accept=".xls,.xlsx" |
|
|
:limit="1" |
|
|
:limit="1" |
|
|
:on-exceed="handleExceed" |
|
|
:on-exceed="handleExceed" |
|
|
:http-request="uploadFile"> |
|
|
:http-request="uploadFile"> |
|
|
<el-button style="margin-left:10px" |
|
|
<el-button style="margin-left:10px" |
|
|
plain |
|
|
|
|
|
icon="el-icon-upload2" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
:disabled="loading">导入小区数据</el-button> |
|
|
|
|
|
</el-upload> |
|
|
|
|
|
<!-- <el-button type="danger" |
|
|
|
|
|
size="small" |
|
|
size="small" |
|
|
@click="uploadFile">导入小区数据</el-button> --> |
|
|
type="danger">导入小区数据</el-button> |
|
|
|
|
|
</el-upload> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="div_table"> |
|
|
<div class="div_table"> |
|
|
@ -123,7 +123,7 @@ |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-press-escape="false" |
|
|
:close-on-press-escape="false" |
|
|
:title="formTitle" |
|
|
:title="formTitle" |
|
|
width="800px" |
|
|
width="900px" |
|
|
top="5vh" |
|
|
top="5vh" |
|
|
@closed="diaClose"> |
|
|
@closed="diaClose"> |
|
|
<community-form ref="ref_form" |
|
|
<community-form ref="ref_form" |
|
|
@ -159,7 +159,10 @@ export default { |
|
|
//form相关 |
|
|
//form相关 |
|
|
formShow: false, |
|
|
formShow: false, |
|
|
formTitle: '新增小区', |
|
|
formTitle: '新增小区', |
|
|
centerPoint: [] |
|
|
|
|
|
|
|
|
files: "", |
|
|
|
|
|
fileName: "", |
|
|
|
|
|
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import' |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -180,10 +183,9 @@ export default { |
|
|
handleSearch () { |
|
|
handleSearch () { |
|
|
this.loadTable() |
|
|
this.loadTable() |
|
|
}, |
|
|
}, |
|
|
async loadTable (fromTree, treeObj, centerPoint) { |
|
|
async loadTable (fromTree, treeObj) { |
|
|
if (fromTree) { |
|
|
if (fromTree) { |
|
|
this.agencyObj = treeObj |
|
|
this.agencyObj = treeObj |
|
|
this.centerPoint = centerPoint |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const url = "/gov/org/neighborhood/neighborhoodlist" |
|
|
const url = "/gov/org/neighborhood/neighborhoodlist" |
|
|
@ -284,20 +286,10 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导出表格 |
|
|
//导出表格 |
|
|
async handleExport () { |
|
|
async handleExport () { |
|
|
let title = this.agencyObj.label |
|
|
let title = this.agencyObj.label |
|
|
|
|
|
|
|
|
if (this.agencyObj.level === 'building') {//点击楼栋 |
|
|
|
|
|
title = title + '—房屋列表' |
|
|
|
|
|
|
|
|
|
|
|
} else if (this.agencyObj.level === 'neighbourHood') {//点击小区 |
|
|
|
|
|
title = title + '—楼栋列表' |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
title = title + '—小区列表' |
|
|
title = title + '—小区列表' |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const url = "/gov/org/neighborhood/exportneighborhoodinfo" |
|
|
const url = "/gov/org/neighborhood/exportneighborhoodinfo" |
|
|
let params = { |
|
|
let params = { |
|
|
@ -349,16 +341,7 @@ export default { |
|
|
|
|
|
|
|
|
handleExportModule () { |
|
|
handleExportModule () { |
|
|
let title = '' |
|
|
let title = '' |
|
|
|
|
|
|
|
|
if (this.agencyObj.level === 'building') {//点击楼栋 |
|
|
|
|
|
title = '房屋模板' |
|
|
|
|
|
|
|
|
|
|
|
} else if (this.agencyObj.level === 'neighbourHood') {//点击小区 |
|
|
|
|
|
title = '楼栋模板' |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
title = '小区模板' |
|
|
title = '小区模板' |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const url = "/gov/org/neighborhood/exporttemplate" |
|
|
const url = "/gov/org/neighborhood/exporttemplate" |
|
|
let params = {} |
|
|
let params = {} |
|
|
@ -397,7 +380,7 @@ export default { |
|
|
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
|
|
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
uploadFile () { |
|
|
async uploadFile () { |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
|
|
|
|
|
|
if (this.fileName == "") { |
|
|
if (this.fileName == "") { |
|
|
@ -410,29 +393,23 @@ export default { |
|
|
|
|
|
|
|
|
var url = '/gov/org/neighborhood/import' |
|
|
var url = '/gov/org/neighborhood/import' |
|
|
let fileFormData = new FormData(); |
|
|
let fileFormData = new FormData(); |
|
|
fileFormData.append('fileName', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
// let params = { |
|
|
|
|
|
// file: this.files |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
app.ajax.importFilePut( |
|
|
const { data, code, msg } = await requestPost(url, fileFormData) |
|
|
url, |
|
|
if (code === 0) { |
|
|
fileFormData, |
|
|
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
|
|
|
|
this.loading = false |
|
|
this.$emit('refreshTree') |
|
|
this.$message.success(rspMsg) |
|
|
|
|
|
this.loadTable() |
|
|
this.loadTable() |
|
|
}) |
|
|
} else { |
|
|
}, |
|
|
this.$message.error(msg) |
|
|
(rspMsg, data) => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.$message.error('<p>' + rspMsg + '</p>'); |
|
|
|
|
|
} |
|
|
} |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleSizeChange (val) { |
|
|
handleSizeChange (val) { |
|
|
console.log(`每页 ${val} 条`) |
|
|
console.log(`每页 ${val} 条`) |
|
|
}, |
|
|
}, |
|
|
|