|
|
@ -42,7 +42,7 @@ |
|
|
|
icon="el-icon-plus" |
|
|
|
@click="handleAdd">新增小区</el-button> |
|
|
|
<div class="btn_upload" |
|
|
|
v-if="agencyObj.level==='community'||agencyObj.level==='grid'"> |
|
|
|
v-if="showImportBtn"> |
|
|
|
<el-button style="" |
|
|
|
type="blue" |
|
|
|
size="small" |
|
|
@ -157,12 +157,14 @@ |
|
|
|
style="color:#1C6AFD;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDetail(scope.row)">查看</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-button v-if="scopr.row.showBtn" |
|
|
|
type="text" |
|
|
|
style="color:#00A7A9;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleEdit(scope.row)">修改</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
<el-button v-if="scopr.row.showBtn" |
|
|
|
type="text" |
|
|
|
style="color:#D51010;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
@ -229,6 +231,7 @@ export default { |
|
|
|
tableLoading: true, |
|
|
|
selAllFlag: false, |
|
|
|
isIndeterminate: false,//复选框的不确定状态 |
|
|
|
showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断 |
|
|
|
|
|
|
|
agencyObj: {},//树所选的组织对象 |
|
|
|
ownerName: '', |
|
|
@ -236,6 +239,7 @@ export default { |
|
|
|
tableData: [], |
|
|
|
selection: [], |
|
|
|
|
|
|
|
|
|
|
|
//form相关 |
|
|
|
formShow: false, |
|
|
|
formTitle: '新增小区', |
|
|
@ -254,7 +258,6 @@ export default { |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
tableHeight () { |
|
|
|
|
|
|
|
return (this.clientHeight - 300) |
|
|
|
|
|
|
|
}, |
|
|
@ -269,9 +272,26 @@ export default { |
|
|
|
this.loadTable() |
|
|
|
}, |
|
|
|
async loadTable (fromTree, treeObj) { |
|
|
|
console.log(111, this.staffAgencyId) |
|
|
|
|
|
|
|
this.tableLoading = true |
|
|
|
if (fromTree) { |
|
|
|
this.agencyObj = treeObj |
|
|
|
if (this.agencyObj.level === 'community') {//只有社区和网格显示操作按钮 |
|
|
|
if (this.agencyObj.id === this.staffAgencyId) {//如果所选树的组织id和登录人员id相同,有权限 |
|
|
|
this.showImportBtn = true |
|
|
|
} else { |
|
|
|
this.showImportBtn = false |
|
|
|
} |
|
|
|
} else if (this.agencyObj.level === 'grid') {//网格下 |
|
|
|
if (this.agencyObj.pid === this.staffAgencyId) {//如果所选树的父级组织id和登录人员id相同,有权限 |
|
|
|
this.showImportBtn = true |
|
|
|
} else { |
|
|
|
this.showImportBtn = false |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showImportBtn = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const url = "/gov/org/neighborhood/neighborhoodlist" |
|
|
@ -289,6 +309,14 @@ export default { |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.total = data.total |
|
|
|
data.forEach(item => { |
|
|
|
if (item.agencyId === this.staffAgencyId) { |
|
|
|
item.showBtn = true |
|
|
|
} else { |
|
|
|
item.showBtn = false |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
this.tableData = data.list |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
@ -702,7 +730,10 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
staffAgencyId: { |
|
|
|
type: String, |
|
|
|
default: '', |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|