2022-08-30 18:08:25 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="sendScoped">
|
2022-08-31 17:05:17 +08:00
|
|
|
<div class="checkedBox">
|
|
|
|
|
<div class="item" v-for="(item,index) in checkList" :key="index" @click="checkBtn(item)">
|
|
|
|
|
<div class="left">
|
|
|
|
|
<icon type="success" size="18" v-if="item.checked"/>
|
|
|
|
|
<icon type="circle" size="18" v-else />
|
|
|
|
|
<div class="title">{{ item.name }}</div>
|
|
|
|
|
</div>
|
2022-09-08 10:38:13 +08:00
|
|
|
<div class="right" v-if="item.vlaue != '0'">
|
|
|
|
|
<div v-if="item.value == '1' && deptSelect.length">已选择{{ deptSelect.length }}个部门</div>
|
|
|
|
|
<div v-if="item.value == '2' && girdSelect.length">已选择{{ girdSelect.length }}个网格</div>
|
2022-08-31 17:05:17 +08:00
|
|
|
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
|
|
|
|
|
</div>
|
2022-08-31 13:43:21 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-08-30 18:08:25 +08:00
|
|
|
|
|
|
|
|
<div class="btn">
|
2022-08-31 17:05:17 +08:00
|
|
|
<div class="submitBtn" @click="submit">确定</div>
|
2022-08-30 18:08:25 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: 'sendScoped',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-08-31 13:43:21 +08:00
|
|
|
value: '',
|
|
|
|
|
checkList: [
|
2022-09-08 10:38:13 +08:00
|
|
|
{ name: '全部居民群', checked: true, value: '0'},
|
2022-09-02 14:14:55 +08:00
|
|
|
{ name: '按部门选择', checked: false, value: '1'},
|
|
|
|
|
{ name: '按网格选择', checked: false, value: '2' }
|
2022-08-31 13:43:21 +08:00
|
|
|
],
|
2022-08-31 17:05:17 +08:00
|
|
|
showContent: false,
|
2022-09-07 18:04:53 +08:00
|
|
|
sendType: '',
|
2022-08-31 17:05:17 +08:00
|
|
|
deptSelect: [],
|
|
|
|
|
girdSelect: [],
|
2022-09-02 14:14:55 +08:00
|
|
|
sendScope: '0',
|
2022-09-07 18:04:53 +08:00
|
|
|
girdListIds: [],
|
|
|
|
|
deptListIds: [],
|
|
|
|
|
wxGroups: [],
|
|
|
|
|
groupNames: [],
|
2022-08-30 18:08:25 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-08-31 13:43:21 +08:00
|
|
|
checkBtn(e) {
|
|
|
|
|
this.checkList.forEach(v=> v.checked = false)
|
|
|
|
|
e.checked = true
|
2022-09-02 14:14:55 +08:00
|
|
|
if(e.value == '1' || e.value == '2') {
|
2022-09-07 18:04:53 +08:00
|
|
|
uni.navigateTo({url: `./scopedSelect?type=${e.value}&sendType=${this.sendType}`})
|
2022-08-31 17:05:17 +08:00
|
|
|
}
|
2022-09-02 14:14:55 +08:00
|
|
|
this.sendScope = e.value
|
2022-08-31 17:05:17 +08:00
|
|
|
},
|
|
|
|
|
submit() {
|
2022-09-07 18:04:53 +08:00
|
|
|
this.getWxGroups()
|
|
|
|
|
uni.setStorageSync('sendScope', this.sendScope)
|
2022-09-08 16:05:19 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.navigateBack({
|
|
|
|
|
success: () => {
|
|
|
|
|
uni.$emit('predictUser', this.wxGroups)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}, 4000)
|
|
|
|
|
|
2022-09-07 18:04:53 +08:00
|
|
|
},
|
|
|
|
|
getWxGroups() {
|
|
|
|
|
this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`,
|
|
|
|
|
{
|
2022-09-08 16:05:19 +08:00
|
|
|
filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',')
|
2022-09-07 18:04:53 +08:00
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
this.wxGroups = res.data
|
2022-09-08 16:05:19 +08:00
|
|
|
uni.setStorageSync('wxGroupsUser', this.wxGroups)
|
|
|
|
|
console.log(this.wxGroups,res.data);
|
2022-09-07 18:04:53 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-08-30 18:08:25 +08:00
|
|
|
},
|
|
|
|
|
onLoad(o) {
|
2022-09-07 18:04:53 +08:00
|
|
|
this.sendType = o.type;
|
2022-08-30 18:08:25 +08:00
|
|
|
document.title = "选择发送范围"
|
2022-09-08 16:05:19 +08:00
|
|
|
// this.checkList.forEach(i=> {
|
|
|
|
|
// return {
|
|
|
|
|
// name: i.name,
|
|
|
|
|
// value: i.value,
|
2022-09-08 10:38:13 +08:00
|
|
|
// checked: this.sendScope.find(v=>(i.value==v))
|
2022-09-08 16:05:19 +08:00
|
|
|
// }
|
|
|
|
|
// })
|
2022-08-30 18:08:25 +08:00
|
|
|
},
|
2022-09-07 18:04:53 +08:00
|
|
|
onShow() {
|
2022-09-08 16:05:19 +08:00
|
|
|
this.sendScope = uni.getStorageSync('sendScope') || ''
|
|
|
|
|
this.girdListIds = uni.getStorageSync('girdSelect').map(e=>e.id) || []
|
|
|
|
|
this.deptListIds = uni.getStorageSync('deptList').map(v=>v.id) || []
|
2022-09-07 18:04:53 +08:00
|
|
|
}
|
2022-08-30 18:08:25 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.sendScoped {
|
2022-08-31 17:05:17 +08:00
|
|
|
.checkedBox {
|
|
|
|
|
background: #FFF;
|
|
|
|
|
padding: 0 32px;
|
2022-08-31 13:43:21 +08:00
|
|
|
box-sizing: border-box;
|
2022-08-31 17:05:17 +08:00
|
|
|
.item {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
border-bottom: 1px solid #DDD;
|
|
|
|
|
padding: 30px 0;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
.left,
|
|
|
|
|
.right {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.title {
|
|
|
|
|
margin-left: 12px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-31 13:43:21 +08:00
|
|
|
}
|
2022-08-31 17:05:17 +08:00
|
|
|
|
2022-08-30 18:08:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
background: #FFF;
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 128px;
|
|
|
|
|
padding: 24px 32px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
.submitBtn {
|
|
|
|
|
flex: 1;
|
|
|
|
|
height: 80px;
|
|
|
|
|
line-height: 80px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
border: 2px solid #CCCCCC;
|
|
|
|
|
background: #1365DD;
|
|
|
|
|
color: #FFF;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|