This commit is contained in:
liuye
2022-01-14 10:56:52 +08:00
parent 5959781e15
commit 78c8bd01f8
6 changed files with 230 additions and 252 deletions

View File

@@ -40,19 +40,31 @@ export default {
allData: null,
treeList: [],
slectList: [],
userGird: {},
userList: [],
type: 0, //0统计 1组织
girdLevel: 0,
parentGirdId: ''
}
},
onLoad(option) {
this.type = option.type
this.getTree()
onLoad() {
this.isGirdUser()
},
methods: {
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType) {
this.userGird = res.data
this.getTree()
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
}
}
})
},
getTree() {
this.slectList = []
this.$http.post('/app/appgirdinfo/listAllByTop').then((res) => {
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${this.girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${this.parentGirdId}`).then((res) => {
if (res?.data) {
this.allData = res.data
this.treeInit()
@@ -61,18 +73,14 @@ export default {
},
treeInit() {
if(this.allData[0].isLastLevel == 1) {
this.userList = this.allData[0].girdMemberList
this.userList.map((item) => {
item.isChecked = false
})
}else {
this.treeList = this.allData[0].girdList
}
this.treeList = this.allData
this.treeList.map((item) => {
item.isChecked = false
})
var obj = {
girdName: this.allData[0].girdName,
id: this.allData[0].id,
girdLevel: this.allData[0].girdLevel
girdName: '可选范围',
id: '',
girdLevel: ''
}
this.slectList.push(obj)
},
@@ -90,9 +98,10 @@ export default {
searckGird(row) {
if(row.girdLevel == 2) return
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
var girdLevel = Number(row.girdLevel)+1
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
if (res?.data) {
this.treeList = res.data.records
this.treeList = res.data
}
})
},
@@ -138,10 +147,6 @@ export default {
return this.$u.toast('请选择网格')
}
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
}
}
</script>