-
+ ]">
-
+
-
+
@@ -37,10 +34,10 @@ import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
export default {
- provide() {
+ provide () {
return {
// 刷新
- refresh() {
+ refresh () {
this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false;
@@ -48,7 +45,7 @@ export default {
},
};
},
- data() {
+ data () {
return {
loading: true,
userType: localStorage.getItem("userType"),
@@ -64,7 +61,7 @@ export default {
watch: {
$route: "routeHandle",
},
- async created() {
+ async created () {
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
console.log(this.$store.state.sidebarMenuList);
@@ -76,11 +73,11 @@ export default {
},
computed: {},
methods: {
- changeCustomerName(customerName) {
+ changeCustomerName (customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName);
},
// 窗口改变大小
- windowResizeHandle() {
+ windowResizeHandle () {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener(
@@ -92,7 +89,7 @@ export default {
);
},
// 路由, 监听
- routeHandle(route) {
+ routeHandle (route) {
if (!route.meta.isTab) {
return false;
}
@@ -115,7 +112,7 @@ export default {
this.$store.state.contentTabsActiveName = tab.name;
this.syncLevelOneMenuActive(tab.menuId);
},
- async syncLevelOneMenuActive(menuId) {
+ async syncLevelOneMenuActive (menuId) {
await nextTick();
console.log(
"*******************************",
@@ -138,7 +135,7 @@ export default {
idx !== -1 ? this.$store.state.sidebarMenuList[idx].children : [];
},
// 获取当前管理员信息
- async getWorkUserInfo() {
+ async getWorkUserInfo () {
const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {};
const { data, code, msg } = await requestPost(url, params);
@@ -148,6 +145,7 @@ export default {
localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
+ localStorage.setItem("agencyId", data.agencyId);
if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || "");
}
diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue
index 002c73e0..a93ae623 100644
--- a/src/views/modules/base/community/buildTable.vue
+++ b/src/views/modules/base/community/buildTable.vue
@@ -660,7 +660,10 @@ export default {
}
},
props: {
-
+ staffAgencyId: {
+ type: String,
+ default: '',
+ },
}
}
diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue
index 1c15672c..8ae143d3 100644
--- a/src/views/modules/base/community/community.vue
+++ b/src/views/modules/base/community/community.vue
@@ -29,13 +29,16 @@
@@ -67,7 +70,8 @@ export default {
selTreeObj: {},
- centerPoint: []
+ centerPoint: [],
+ staffAgencyId: localStorage.getItem("agencyId")
}
},
@@ -78,6 +82,7 @@ export default {
this.treeLoading = true
await this.loadOrgData()
await this.loadTree()
+
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (this.treeData.length > 0) {
this.$nextTick(() => {
@@ -276,8 +281,8 @@ export default {
.div_table {
margin-left: 15px;
- flex: 1;
- // width: calc(100vw - 550px);
+ // flex: 1;
+ width: calc(100vw - 550px);
background-color: #ffffff;
border-radius: 5px;
padding: 10px;
diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue
index 8566f09b..c4678931 100644
--- a/src/views/modules/base/community/communityTable.vue
+++ b/src/views/modules/base/community/communityTable.vue
@@ -42,7 +42,7 @@
icon="el-icon-plus"
@click="handleAdd">新增小区
+ v-if="showImportBtn">
查看
- 修改
- 删除
@@ -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: '',
+ },
}
}
diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue
index 5b3b80fc..25b60b18 100644
--- a/src/views/modules/base/community/roomTable.vue
+++ b/src/views/modules/base/community/roomTable.vue
@@ -615,7 +615,10 @@ export default {
}
},
props: {
-
+ staffAgencyId: {
+ type: String,
+ default: '',
+ },
}
}
From dfb9c7b86ad10c76327b8ead7ed4bafbaeda984c Mon Sep 17 00:00:00 2001
From: jiangyy
Date: Mon, 7 Mar 2022 17:27:25 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/base/community/buildTable.vue | 110 +++++++++++-------
.../modules/base/community/communityTable.vue | 6 +-
.../modules/base/community/roomTable.vue | 30 ++++-
3 files changed, 100 insertions(+), 46 deletions(-)
diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue
index a93ae623..59ee9190 100644
--- a/src/views/modules/base/community/buildTable.vue
+++ b/src/views/modules/base/community/buildTable.vue
@@ -41,47 +41,49 @@
size="small"
icon="el-icon-plus"
@click="handleAdd">新增楼宇
-
- 下载楼宇模板
-
-
-
+ 导入楼宇数据
-
- 下载房屋模板
-
-
- 下载楼宇模板
+
+
+ 导入楼宇数据
+
+ 导入房屋数据
-
+ icon="el-icon-download"
+ @click="handleExportModule('room')">下载房屋模板
+
+
+ 导入房屋数据
+
+
@@ -134,12 +136,14 @@
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看
- 修改
- 删除
@@ -206,6 +210,7 @@ export default {
tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//复选框的不确定状态
+ showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断
agencyObj: {},//树所选的小区对象
ownerName: '',
@@ -243,6 +248,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
+ }
}
console.log(this.agencyObj)
const url = "/gov/org/building/buildinglist"
@@ -258,6 +278,14 @@ export default {
if (code === 0) {
this.total = data.total
+ data.list.forEach(item => {
+ if (item.agencyId === this.staffAgencyId) {
+ item.showBtn = true
+ } else {
+ item.showBtn = false
+ }
+
+ });
this.tableData = data.list
} else {
this.$message.error(msg)
diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue
index c4678931..00dede49 100644
--- a/src/views/modules/base/community/communityTable.vue
+++ b/src/views/modules/base/community/communityTable.vue
@@ -157,13 +157,13 @@
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看
- 修改
- {
+ data.list.forEach(item => {
if (item.agencyId === this.staffAgencyId) {
item.showBtn = true
} else {
diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue
index 25b60b18..75140abe 100644
--- a/src/views/modules/base/community/roomTable.vue
+++ b/src/views/modules/base/community/roomTable.vue
@@ -125,12 +125,14 @@
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看
- 修改
- 删除
@@ -195,6 +197,7 @@ export default {
tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//复选框的不确定状态
+ showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断
agencyObj: {},//树所选的小区对象
ownerName: '',
@@ -234,6 +237,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
+ }
}
const url = "/gov/org/house/houselist"
@@ -250,6 +268,14 @@ export default {
if (code === 0) {
this.total = data.total
+ data.list.forEach(item => {
+ if (item.agencyId === this.staffAgencyId) {
+ item.showBtn = true
+ } else {
+ item.showBtn = false
+ }
+
+ });
this.tableData = data.list
} else {
this.$message.error(msg)
From 2f467d4df8e8a8ecb51a3453133c8c392466c93d Mon Sep 17 00:00:00 2001
From: jiangyy
Date: Wed, 9 Mar 2022 09:26:24 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E7=AE=A1=E7=90=86-?=
=?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/base/community/buildTable.vue | 39 ++++-----
.../modules/base/community/community.vue | 31 +++++--
.../modules/base/community/communityTable.vue | 11 +--
.../modules/base/community/roomTable.vue | 86 ++++++++++---------
4 files changed, 98 insertions(+), 69 deletions(-)
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">下载房屋模板
+
+ 导入房屋数据
+
+