BUG 30236
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AiEmpty :description="isGridMember?`暂无数据`:`当前人员不是网格员或网格长`" class="emptyWrap" v-else/>
|
<AiEmpty :description="`暂无数据`" class="emptyWrap" v-else/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="subBtn flex">
|
<div class="subBtn flex">
|
||||||
@@ -49,34 +49,20 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
isGridMember() {
|
|
||||||
return this.user.girdCheckType > 0
|
|
||||||
},
|
|
||||||
//是否展示所有网格(随手拍)
|
//是否展示所有网格(随手拍)
|
||||||
isApply: v => v.query?.formType == 2,
|
isApply: v => v.query?.formType == 2,
|
||||||
clearable: v => v.query?.clearable,
|
clearable: v => v.query?.clearable,
|
||||||
isMyGirds: v => v.query?.self == true,
|
|
||||||
selected: v => [v.query?.selected].flat(),
|
selected: v => [v.query?.selected].flat(),
|
||||||
isFormMap: v => v.query?.isFormMap || 0
|
|
||||||
},
|
},
|
||||||
onLoad(query) {
|
onLoad(query) {
|
||||||
this.query = query
|
this.query = query
|
||||||
this.isGridMember || this.isApply ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
|
this.getAllGrids()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getAllGrids() {
|
getAllGrids() {
|
||||||
this.selectList = []
|
this.selectList = []
|
||||||
let {girdMemberId} = this.user,
|
let url = `/app/appgirdinfo/listByInfo`
|
||||||
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`,
|
this.$instance.post(url).then(res => {
|
||||||
params = {girdMemberId}
|
|
||||||
if (this.isApply) {
|
|
||||||
url = `/app/appgirdinfo/listByInfo`
|
|
||||||
params = {}
|
|
||||||
}
|
|
||||||
if (this.isMyGirds) {
|
|
||||||
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2`
|
|
||||||
}
|
|
||||||
this.$instance.post(url, null, {params}).then((res) => {
|
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let parents = res.data?.map(e => e.parentGirdId)
|
let parents = res.data?.map(e => e.parentGirdId)
|
||||||
this.allData = res.data?.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
this.allData = res.data?.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||||
@@ -96,7 +82,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.options = this.allData.filter((e, i, arr) => !arr?.map(e => e.id).includes(e.parentGirdId) || this.isMyGirds)
|
this.options = this.allData.filter((e, i, arr) => !arr?.map(e => e.id).includes(e.parentGirdId))
|
||||||
this.options?.map((item) => item.isChecked = this.selected.includes(item.id))
|
this.options?.map((item) => item.isChecked = this.selected.includes(item.id))
|
||||||
let obj = {girdName: '可选范围', id: ''}
|
let obj = {girdName: '可选范围', id: ''}
|
||||||
this.selectList.push(obj)
|
this.selectList.push(obj)
|
||||||
@@ -141,7 +127,7 @@ export default {
|
|||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
if (this.SelectGird.id != null) {
|
if (this.SelectGird.id != null) {
|
||||||
if (!this.isApply && !this.isMyGirds) {
|
if (!this.isApply) {
|
||||||
uni.setStorageSync("lastSelectedGrid", this.SelectGird.parentGirdId)
|
uni.setStorageSync("lastSelectedGrid", this.SelectGird.parentGirdId)
|
||||||
}
|
}
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
|
|||||||
Reference in New Issue
Block a user