Browse Source

小区管理操作按钮权限

shibei_master
jiangyy 4 years ago
parent
commit
dfb9c7b86a
  1. 110
      src/views/modules/base/community/buildTable.vue
  2. 6
      src/views/modules/base/community/communityTable.vue
  3. 30
      src/views/modules/base/community/roomTable.vue

110
src/views/modules/base/community/buildTable.vue

@ -41,47 +41,49 @@
size="small" size="small"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd">新增楼宇</el-button> @click="handleAdd">新增楼宇</el-button>
<div class="btn_upload"
<el-button style=";margin-left:10px" v-if="showImportBtn">
type="blue" <el-button style=";margin-left:10px"
size="small" type="blue"
icon="el-icon-download"
@click="handleExportModule('building')">下载楼宇模板</el-button>
<el-upload style=""
ref="upload_building"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'building')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'building')})">
<el-button style="margin-left:10px"
size="small" size="small"
icon="el-icon-upload2" icon="el-icon-download"
:loading="importBuildingLoading" @click="handleExportModule('building')">下载楼宇模板</el-button>
type="red">导入楼宇数据</el-button>
</el-upload> <el-upload style=""
<el-button style=";margin-left:10px" ref="upload_building"
type="blue" :multiple='false'
size="small" :show-file-list='false'
icon="el-icon-download" :before-upload="((file)=>{beforeUpload(file, 'building')})"
@click="handleExportModule('room')">下载房屋模板</el-button> action=""
accept=".xls,.xlsx"
<el-upload style="" :http-request="(()=>{uploadFile( 'building')})">
ref="upload_room" <el-button style="margin-left:10px"
:multiple='false' size="small"
:show-file-list='false' icon="el-icon-upload2"
:before-upload="((file)=>{beforeUpload(file, 'room')})" :loading="importBuildingLoading"
action="" type="red">导入楼宇数据</el-button>
accept=".xls,.xlsx" </el-upload>
:http-request="(()=>{uploadFile( 'room')})"> <el-button style=";margin-left:10px"
<el-button style="margin-left:10px" type="blue"
size="small" size="small"
icon="el-icon-upload2" icon="el-icon-download"
:loading="importRoomLoading" @click="handleExportModule('room')">下载房屋模板</el-button>
type="red">导入房屋数据</el-button>
</el-upload> <el-upload style=""
ref="upload_room"
:multiple='false'
:show-file-list='false'
:before-upload="((file)=>{beforeUpload(file, 'room')})"
action=""
accept=".xls,.xlsx"
:http-request="(()=>{uploadFile( 'room')})">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
</div> </div>
<div class="div_table"> <div class="div_table">
@ -134,12 +136,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -206,6 +210,7 @@ export default {
tableLoading: true, tableLoading: true,
selAllFlag: false, selAllFlag: false,
isIndeterminate: false,// isIndeterminate: false,//
showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -243,6 +248,21 @@ export default {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
if (this.agencyObj.level === 'community') {//
if (this.agencyObj.id === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (this.agencyObj.level === 'grid') {//
if (this.agencyObj.pid === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
this.showImportBtn = false
}
} }
console.log(this.agencyObj) console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist" const url = "/gov/org/building/buildinglist"
@ -258,6 +278,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)

6
src/views/modules/base/community/communityTable.vue

@ -157,13 +157,13 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button v-if="scopr.row.showBtn" <el-button v-if="scope.row.showBtn"
type="text" type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button v-if="scopr.row.showBtn" <el-button v-if="scope.row.showBtn"
type="text" type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@ -309,7 +309,7 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.forEach(item => { data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) { if (item.agencyId === this.staffAgencyId) {
item.showBtn = true item.showBtn = true
} else { } else {

30
src/views/modules/base/community/roomTable.vue

@ -125,12 +125,14 @@
style="color:#1C6AFD;text-decoration: underline;" style="color:#1C6AFD;text-decoration: underline;"
size="small" size="small"
@click="handleDetail(scope.row)">查看</el-button> @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#00A7A9;text-decoration: underline;" style="color:#00A7A9;text-decoration: underline;"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button type="text" <el-button v-if="scope.row.showBtn"
type="text"
style="color:#D51010;text-decoration: underline;" style="color:#D51010;text-decoration: underline;"
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -195,6 +197,7 @@ export default {
tableLoading: true, tableLoading: true,
selAllFlag: false, selAllFlag: false,
isIndeterminate: false,// isIndeterminate: false,//
showImportBtn: false,//
agencyObj: {},// agencyObj: {},//
ownerName: '', ownerName: '',
@ -234,6 +237,21 @@ export default {
this.tableLoading = true this.tableLoading = true
if (fromTree) { if (fromTree) {
this.agencyObj = treeObj this.agencyObj = treeObj
if (this.agencyObj.level === 'community') {//
if (this.agencyObj.id === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (this.agencyObj.level === 'grid') {//
if (this.agencyObj.pid === this.staffAgencyId) {//idid
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
this.showImportBtn = false
}
} }
const url = "/gov/org/house/houselist" const url = "/gov/org/house/houselist"
@ -250,6 +268,14 @@ export default {
if (code === 0) { if (code === 0) {
this.total = data.total this.total = data.total
data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
item.showBtn = false
}
});
this.tableData = data.list this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg)

Loading…
Cancel
Save