+ ]">
-
+
-
+
@@ -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 9066cd7d..fdc6d0ef 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: '',
@@ -242,8 +247,17 @@ export default {
async loadTable (fromTree, treeObj) {
this.tableLoading = true
if (fromTree) {
+
this.agencyObj = treeObj
+
+ // 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 = {
@@ -258,6 +272,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)
@@ -410,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 {
@@ -590,12 +613,12 @@ export default {
if (data.code === 0 && data.msg == 'success') {
// this.$message.success('导入成功')
} else {
- this.$message({
- showClose: true,
- message: rspMsg,
- duration: 0,
- type: "error"
- })
+ // this.$message({
+ // showClose: true,
+ // message: rspMsg,
+ // duration: 0,
+ // type: "error"
+ // })
// this.$message.error(rspMsg)
}
this.$emit('refreshTree')
@@ -660,7 +683,14 @@ export default {
}
},
props: {
-
+ staffAgencyId: {
+ 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 1c15672c..2800a96b 100644
--- a/src/views/modules/base/community/community.vue
+++ b/src/views/modules/base/community/community.vue
@@ -29,13 +29,18 @@
@@ -67,7 +72,9 @@ export default {
selTreeObj: {},
- centerPoint: []
+ centerPoint: [],
+ staffAgencyId: localStorage.getItem("agencyId"),
+ showImportBtn: false
}
},
@@ -78,6 +85,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(() => {
@@ -147,7 +155,12 @@ export default {
handleNodeClick (obj) {
this.getTreeObj(obj)
+
+
this.$nextTick(() => {
+
+
+
if (obj.level === 'building') {//点击楼栋
this.$refs['ref_buildingTable'].loadTable(true, this.selTreeObj)
@@ -196,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 {
}
@@ -276,8 +302,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 e4e504cb..491288f0 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.list.forEach(item => {
+ if (item.agencyId === this.staffAgencyId) {
+ item.showBtn = true
+ } else {
+ item.showBtn = false
+ }
+
+ });
this.tableData = data.list
} else {
this.$message.error(msg)
@@ -440,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 {
@@ -624,12 +652,12 @@ export default {
if (data.code === 0 && data.msg == 'success') {
// this.$message.success('导入成功')
} else {
- this.$message({
- showClose: true,
- message: rspMsg,
- duration: 0,
- type: "error"
- })
+ // this.$message({
+ // showClose: true,
+ // message: rspMsg,
+ // duration: 0,
+ // type: "error"
+ // })
// this.$message.error(rspMsg)
}
this.$emit('refreshTree')
@@ -702,6 +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 d17e7a9b..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">下载房屋模板
+
+ 导入房屋数据
+
+
@@ -125,12 +128,14 @@
style="color:#1C6AFD;text-decoration: underline;"
size="small"
@click="handleDetail(scope.row)">查看
-
修改
-
删除
@@ -195,6 +200,7 @@ export default {
tableLoading: true,
selAllFlag: false,
isIndeterminate: false,//复选框的不确定状态
+ // showImportBtn: false,//是否显示操作按钮,根据登录人所属组织判断
agencyObj: {},//树所选的小区对象
ownerName: '',
@@ -234,6 +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
+ // }
}
const url = "/gov/org/house/houselist"
@@ -250,6 +271,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)
@@ -397,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 {
@@ -553,12 +583,12 @@ export default {
if (data.code === 0 && data.msg == 'success') {
// this.$message.success('导入成功')
} else {
- this.$message({
- showClose: true,
- message: rspMsg,
- duration: 0,
- type: "error"
- })
+ // this.$message({
+ // showClose: true,
+ // message: rspMsg,
+ // duration: 0,
+ // type: "error"
+ // })
// this.$message.error(rspMsg)
}
this.$emit('refreshTree')
@@ -615,7 +645,14 @@ export default {
}
},
props: {
-
+ staffAgencyId: {
+ type: String,
+ default: '',
+ },
+ showImportBtn: {
+ type: Boolean,
+ default: false,
+ },
}
}
diff --git a/src/views/modules/shequ/index.vue b/src/views/modules/shequ/index.vue
index c0f09f69..7469479e 100644
--- a/src/views/modules/shequ/index.vue
+++ b/src/views/modules/shequ/index.vue
@@ -9,11 +9,17 @@