Browse Source

小区管理-导入增加权限

shibei_master
jiangyy 4 years ago
parent
commit
2f467d4df8
  1. 39
      src/views/modules/base/community/buildTable.vue
  2. 31
      src/views/modules/base/community/community.vue
  3. 11
      src/views/modules/base/community/communityTable.vue
  4. 86
      src/views/modules/base/community/roomTable.vue

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

@ -210,7 +210,7 @@ export default {
tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//
showImportBtn: false,//
// showImportBtn: false,//
agencyObj: {},//
ownerName: '',
@ -247,23 +247,17 @@ export default {
async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) {
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
}
// if (this.agencyObj.pid === this.staffAgencyId) {//idid
// this.showImportBtn = true
// } else {
// this.showImportBtn = false
// }
}
console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist"
let params = {
@ -438,10 +432,11 @@ export default {
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
// this.$message({
// type: "success",
// message: msg
// });
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
@ -692,6 +687,10 @@ export default {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
}
}
</script>

31
src/views/modules/base/community/community.vue

@ -30,10 +30,12 @@
<build-table v-if="selTreeObj.level==='neighborHood'"
ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
@toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table>
<room-table v-else-if="selTreeObj.level==='building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table>
<community-table v-else
@ -71,7 +73,8 @@ export default {
selTreeObj: {},
centerPoint: [],
staffAgencyId: localStorage.getItem("agencyId")
staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false
}
},
@ -152,7 +155,12 @@ export default {
handleNodeClick (obj) {
this.getTreeObj(obj)
this.$nextTick(() => {
if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
@ -201,18 +209,31 @@ export default {
// idtypeidid
// idtypeid
if (obj.level === 'building') {//
let communityNode = this.$refs.ref_tree.getNode(obj.pid)
obj.communityId = communityNode.data.id
obj.communityName = communityNode.data.label
let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
}

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

@ -468,11 +468,11 @@ export default {
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
// this.$message({
// showClose: true,
// message: msg,
// duration: 0
// })
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
@ -734,6 +734,7 @@ export default {
type: String,
default: '',
},
}
}
</script>

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

@ -41,26 +41,29 @@
icon="el-icon-plus"
size="small"
@click="handleAdd">新增房屋</el-button>
<el-button style="float:left"
type="blue"
size="small"
icon="el-icon-download"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
<div class="btn_upload"
v-if="showImportBtn">
<el-button style="float:left"
type="blue"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
icon="el-icon-download"
@click="handleExportModule">下载房屋模板</el-button>
<el-upload ref="upload"
:multiple='false'
:show-file-list='false'
:before-upload="beforeUpload"
action=""
accept=".xls,.xlsx"
:limit="1"
:on-exceed="handleExceed"
:http-request="uploadFile">
<el-button style="margin-left:10px"
size="small"
icon="el-icon-upload2"
:loading="importRoomLoading"
type="red">导入房屋数据</el-button>
</el-upload>
</div>
</div>
<div class="div_table">
@ -197,7 +200,7 @@ export default {
tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//
showImportBtn: false,//
// showImportBtn: false,//
agencyObj: {},//
ownerName: '',
@ -237,21 +240,21 @@ export default {
this.tableLoading = true
if (fromTree) {
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
}
// 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"
@ -423,10 +426,11 @@ export default {
this.$emit('refreshTree')
this.loadTable()
} else if (code > 8000) {
// this.$message({
// type: "success",
// message: msg
// });
this.$message({
showClose: true,
message: msg,
duration: 0
})
this.$emit('refreshTree')
this.loadTable()
} else {
@ -645,6 +649,10 @@ export default {
type: String,
default: '',
},
showImportBtn: {
type: Boolean,
default: false,
},
}
}
</script>

Loading…
Cancel
Save