diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index 59ee9190..fdc6d0ef 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/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) {//如果所选树的组织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 - } + + // if (this.agencyObj.pid === this.staffAgencyId) {//如果所选树的父级组织id和登录人员id相同,有权限 + // 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, + }, } } diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index 8ae143d3..2800a96b 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -30,10 +30,12 @@ { + + + if (obj.level === 'building') {//点击楼栋 this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj) @@ -201,18 +209,31 @@ export default { // 小区:小区id、小区名称、type、所属网格id、所属网格名称、所属组织id、所属组织名称、经度、纬度 // 楼:楼id、楼名称、type、所属小区id、所属小区名称 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 { } diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index 00dede49..491288f0 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/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: '', }, + } } diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 75140abe..1de9a574 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -41,26 +41,29 @@ icon="el-icon-plus" size="small" @click="handleAdd">新增房屋 - 下载房屋模板 - - + 导入房屋数据 - + icon="el-icon-download" + @click="handleExportModule">下载房屋模板 + + 导入房屋数据 + +
@@ -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) {//如果所选树的组织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 - } + // 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/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, + }, } }