|
|
@ -3,10 +3,11 @@ |
|
|
|
<resi-search v-if="searchList.length > 0" ref="resiSearch" :form-list="searchList" @search="handleSearch" /> |
|
|
|
<el-card class="resi-card-table"> |
|
|
|
<div class="resi-row-btn"> |
|
|
|
<el-button type="warning" size="small">导出</el-button> |
|
|
|
|
|
|
|
<el-button type="success" size="small" @click="handleAdd">新增</el-button> |
|
|
|
<el-button type="primary" size="small">下载人口模板</el-button> |
|
|
|
<el-button type="danger" size="small">导入人口数据</el-button> |
|
|
|
<el-button type="warning" size="small" @click="handleExport">导出</el-button> |
|
|
|
<!-- <el-button type="primary" size="small">下载人口模板</el-button> --> |
|
|
|
<!-- <el-button type="danger" size="small">导入人口数据</el-button> --> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
@ -36,13 +37,16 @@ |
|
|
|
width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button @click="handleLook(scope.row)" type="text" size="small" class="btn-color-look">查看</el-button> |
|
|
|
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">编辑</el-button> |
|
|
|
<el-popconfirm |
|
|
|
title="删除之后无法回复,确认删除?" |
|
|
|
@onConfirm="handleDel(scope.row)" |
|
|
|
> |
|
|
|
<el-button slot="reference" type="text" size="small" class="btn-color-del">删除</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
<template v-if="filterEdit(scope.row.ORG_ID)"> |
|
|
|
<el-button @click="handleEdit(scope.row)" type="text" size="small" class="btn-color-edit">编辑</el-button> |
|
|
|
<el-popconfirm |
|
|
|
title="删除之后无法回复,确认删除?" |
|
|
|
@onConfirm="handleDel(scope.row)" |
|
|
|
> |
|
|
|
<el-button slot="reference" type="text" size="small" class="btn-color-del">删除</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
</template> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -130,7 +134,6 @@ export default { |
|
|
|
pageLoading: false, |
|
|
|
dialogEditVisible: false, |
|
|
|
dialogVisible: false, |
|
|
|
openSearch: false, |
|
|
|
currentPage: 1, |
|
|
|
pageSize: 20, |
|
|
|
total: null, |
|
|
@ -138,7 +141,6 @@ export default { |
|
|
|
activeName: '', |
|
|
|
tableData: [], |
|
|
|
searchList: [], |
|
|
|
value: '', |
|
|
|
editForm: { |
|
|
|
GRID_ID: '', |
|
|
|
VILLAGE_ID: '', |
|
|
@ -150,47 +152,6 @@ export default { |
|
|
|
}, |
|
|
|
formList: [], |
|
|
|
tableHeader: [], |
|
|
|
tabsForm: [{ |
|
|
|
label: '所属网格', |
|
|
|
itemType: 'input', |
|
|
|
optionSourceType: '', |
|
|
|
sort: '1', |
|
|
|
require: true, |
|
|
|
validType: null, |
|
|
|
columnName: 'grid' |
|
|
|
}, { |
|
|
|
label: '小区名称', |
|
|
|
require: true, |
|
|
|
itemType: 'select', |
|
|
|
optionSourceType: '', |
|
|
|
sort: '1', |
|
|
|
validType: null, |
|
|
|
columnName: 'shequ' |
|
|
|
}, { |
|
|
|
label: '户籍查询', |
|
|
|
require: true, |
|
|
|
itemType: 'input', |
|
|
|
optionSourceType: '', |
|
|
|
sort: '1', |
|
|
|
validType: null, |
|
|
|
columnName: 'huji' |
|
|
|
}, { |
|
|
|
label: '本地户籍', |
|
|
|
itemType: 'select', |
|
|
|
require: true, |
|
|
|
optionSourceType: '', |
|
|
|
sort: '1', |
|
|
|
validType: null, |
|
|
|
columnName: 'huji1' |
|
|
|
}, { |
|
|
|
label: '姓名', |
|
|
|
itemType: 'input', |
|
|
|
optionSourceType: '', |
|
|
|
sort: '1', |
|
|
|
validType: null, |
|
|
|
require: true, |
|
|
|
columnName: 'username' |
|
|
|
}], |
|
|
|
tabsList: [] |
|
|
|
} |
|
|
|
}, |
|
|
@ -203,6 +164,10 @@ export default { |
|
|
|
console.log('storeoooo----0000', this.$store) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
filterEdit (id) { |
|
|
|
const { user } = this.$store.state |
|
|
|
return id === user.agencyId |
|
|
|
}, |
|
|
|
handleSizeChange (val) { |
|
|
|
console.log(`每页 ${val} 条`) |
|
|
|
this.pageSize = val |
|
|
@ -228,6 +193,69 @@ export default { |
|
|
|
this.conditions = val |
|
|
|
this.getTableData() |
|
|
|
}, |
|
|
|
// 下载文件 |
|
|
|
download (data, fileName) { |
|
|
|
console.log('data',data) |
|
|
|
if (!data) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var csvData = new Blob([data]) |
|
|
|
|
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|
|
|
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
|
|
|
} |
|
|
|
// for Non-IE (chrome, firefox etc.) |
|
|
|
else { |
|
|
|
var a = document.createElement('a'); |
|
|
|
document.body.appendChild(a); |
|
|
|
a.style = 'display: none'; |
|
|
|
var url = window.URL.createObjectURL(csvData); |
|
|
|
a.href = url; |
|
|
|
a.download = fileName; |
|
|
|
a.click(); |
|
|
|
a.remove(); |
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
handleExport () { |
|
|
|
let params = { |
|
|
|
formCode: 'resi_base_info', |
|
|
|
conditions: this.conditions |
|
|
|
} |
|
|
|
|
|
|
|
// .post('epmetuser/icresiuser/exportExcel', params) |
|
|
|
this.$http({ |
|
|
|
url: 'epmetuser/icresiuser/exportExcel', |
|
|
|
method: 'post', |
|
|
|
data: params, |
|
|
|
header: { |
|
|
|
headers: { 'Content-Type': 'application/x-download' } |
|
|
|
}, |
|
|
|
responseType: 'blob' |
|
|
|
}).then(({ data: res }) => { |
|
|
|
// var headerData = res.headers |
|
|
|
// this.download(res, '人员数据.xlsx') |
|
|
|
console.log('res',res) |
|
|
|
const fileName = '人员数据.xlsx' |
|
|
|
let blob = new Blob([res], {type: 'application/vnd.ms-excel'}) |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
var aLink = document.createElement("a"); |
|
|
|
aLink.style.display = "none"; |
|
|
|
aLink.href = url; |
|
|
|
aLink.setAttribute("download", fileName); |
|
|
|
document.body.appendChild(aLink); |
|
|
|
aLink.click(); |
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
// window.location.href = res.data |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('获取导出情失败', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleClick (tab, event) { |
|
|
|
console.log(tab, event) |
|
|
|
}, |
|
|
|