This commit is contained in:
liuye
2022-01-13 18:42:09 +08:00
parent cd3a686a0a
commit 1f0b96bfc2
2 changed files with 19 additions and 36 deletions

View File

@@ -4,7 +4,7 @@
<div class="hint">
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span style="color:#3F8DF5" @click="girdNameClick(item, index)">{{item.girdName}}</span></span>
</div>
<div class="showTypes" v-if="!userList.length">
<div class="showTypes">
<div v-if="treeList.length > 0">
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
<div class="imges">
@@ -16,7 +16,7 @@
</div>
<div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs" />
<img src="./components/img/right-icon.png" alt="" class="imgs" v-if="item.girdLevel != 2"/>
</div>
</div>
</div>
@@ -41,9 +41,12 @@ export default {
treeList: [],
slectList: [],
userList: [],
type: 0, //0统计 1组织
}
},
onLoad() {
onLoad(option) {
this.type = option.type
this.getTree()
},
methods: {
@@ -75,7 +78,7 @@ export default {
},
itemClick(row) {
console.log(row)
if(row.girdLevel == 2) return
var obj = {
girdName: row.girdName,
id: row.id,
@@ -86,22 +89,12 @@ export default {
},
searckGird(row) {
if(row.girdLevel != 2) { //查网格
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
if (res?.data) {
this.treeList = res.data.records
}
})
}else { //查网格员
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${row.id}`).then((res) => {
if (res?.data) {
this.userList = res.data
this.userList.map((item) => {
item.isChecked = false
})
}
})
}
if(row.girdLevel == 2) return
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
if (res?.data) {
this.treeList = res.data.records
}
})
},
girdNameClick(row, index) {
@@ -136,26 +129,13 @@ export default {
this.$forceUpdate()
},
userClick(row, index) {
if (this.userList[index].isChecked) {//取消
this.userList[index].isChecked = false
this.SelectGird = {}
} else {
this.userList.map((item) => {
item.isChecked = false
})
this.userList[index].isChecked = true
this.SelectGird = row
}
this.$forceUpdate()
},
submit() {
if (this.SelectGird.id != null) {
uni.$emit('goback', this.SelectGird)
uni.navigateBack()
} else {
return this.$u.toast('请选择网格或网格员')
return this.$u.toast('请选择网格')
}
},