This commit is contained in:
shijingjing
2022-09-07 18:04:53 +08:00
parent 79dffc51b2
commit 0b3523418c
5 changed files with 101 additions and 50 deletions

View File

@@ -2,7 +2,7 @@
<div class="AppCooperationPropaganda"> <div class="AppCooperationPropaganda">
<AiTopFixed> <AiTopFixed>
<div class="tab-select"> <div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{ item }}<span></span></div> <div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(item,index)">{{ item.name }}<span></span></div>
</div> </div>
<div class="search"> <div class="search">
<div class="searchBox"> <div class="searchBox">
@@ -98,7 +98,20 @@ export default {
appName: '协同宣发', appName: '协同宣发',
data() { data() {
return { return {
tabs: ['群发居民群','群发居民','群发朋友圈'], tabs: [
{
name: '群发居民群',
value: 'ResidentsGroup'
},
{
name: '群发居民',
value: 'Residents'
},
{
name: '群发朋友圈',
value: 'CircleOfFriends'
},
],
tabIndex: 0, tabIndex: 0,
current: 1, current: 1,
name: '', name: '',
@@ -114,12 +127,14 @@ export default {
createUserId: '', createUserId: '',
userList: [], userList: [],
userIdList: [], userIdList: [],
status: '' status: '',
sendType: '',
} }
}, },
methods: { methods: {
tabClick(index) { tabClick(item,index) {
this.tabIndex = index; this.tabIndex = index;
this.sendType = item.value
}, },
toDetail(item) { toDetail(item) {
uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`}) uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`})
@@ -183,7 +198,7 @@ export default {
this.endTime = val.year + '-' + val.month + '-' + val.day this.endTime = val.year + '-' + val.month + '-' + val.day
}, },
toAdd() { toAdd() {
uni.navigateTo({url: `./addPropaganda?index=${this.tabIndex}`}) uni.navigateTo({url: `./addPropaganda?type=${this.sendType}`})
} }
}, },
onShow() { onShow() {

View File

@@ -10,7 +10,7 @@
<div @click="toSleectScoped"> <div @click="toSleectScoped">
<span> <span>
<span class="color_gray" v-if="!form.sendScope">请选择</span> <span class="color_gray" v-if="!form.sendScope">请选择</span>
<span v-if="form.sendScope">已选择</span> <span v-if="form.sendScope">预计送达{{ 1 }}名成员</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</span> </span>
</div> </div>
@@ -146,7 +146,7 @@ export default {
choiceTime: '', // 定时发送时间 choiceTime: '', // 定时发送时间
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择 sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送 sendType: '0', // 0立即发送、1定时发送
wxGroups: [], wxGroups: [], // 送达居民群
}, },
enableExamine: false, enableExamine: false,
isTimedTask: false, isTimedTask: false,
@@ -154,7 +154,6 @@ export default {
files: [], files: [],
showTaskTime: false, showTaskTime: false,
userList: [], userList: [],
// userListIds: [],
showPopup: false, showPopup: false,
showFodder: false, showFodder: false,
showUpload: false, showUpload: false,
@@ -169,19 +168,6 @@ export default {
}, },
flag: false, flag: false,
uploadList: [ uploadList: [
// {
// title: '从素材库上传',
// list: [
// {
// icon: '',
// name: ''
// },
// {
// icon: '',
// name: ''
// }
// ]
// },
{ {
title: '从本地上传', title: '从本地上传',
list: [ list: [
@@ -207,6 +193,8 @@ export default {
}, },
methods: { methods: {
...mapActions(['selectEnterpriseContact']), ...mapActions(['selectEnterpriseContact']),
// 发送范围
toSleectScoped() { toSleectScoped() {
uni.navigateTo({url: `./sendScoped?type=${this.type}`}) uni.navigateTo({url: `./sendScoped?type=${this.type}`})
}, },
@@ -387,8 +375,8 @@ export default {
} }
}, },
onLoad(o) { onLoad(o) {
this.type = o.index; this.type = o.type;
document.title = this.type==0? "群发居民群": this.type==1? "群发居民": "群发朋友圈" document.title = this.type=='ResidentsGroup'? "群发居民群": this.type=='Residents'? "群发居民": "群发朋友圈"
uni.$on('checkedScope', res => { uni.$on('checkedScope', res => {
this.form.sendScope = res.sendScope this.form.sendScope = res.sendScope
}) })

View File

@@ -3,26 +3,27 @@
<div class="item"> <div class="item">
<div>添加人</div> <div>添加人</div>
<div @click="selectUser"> <div @click="selectUser">
<span v-if="selectedUser.length || userListIds.length">已选择{{ selectedUser.length || userListIds.length }}名成员</span> <span v-if="selectedUser.length || deptListArr.length">已选择{{ selectedUser.length || deptListArr.length }}
<span v-if="selectedUser.length">个网格</span><span v-if="deptListArr.length">个部门</span></span>
<span class="color_gray" v-else>请选择</span> <span class="color_gray" v-else>请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="item"> <div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>包含标签</div> <div>包含标签</div>
<div @click="toTagsList(0)"> <div @click="toTagsList(0)">
<span class="color_gray">请选择</span> <span class="color_gray">请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="item"> <div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>剔除标签</div> <div>剔除标签</div>
<div @click="toTagsList(1)"> <div @click="toTagsList(1)">
<span class="color_gray">请选择</span> <span class="color_gray">请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="item"> <div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>添加时间</div> <div>添加时间</div>
<div @click="showCalendar = true"> <div @click="showCalendar = true">
<span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span> <span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span>
@@ -30,7 +31,7 @@
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="items"> <div class="items" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>性别</div> <div>性别</div>
<div class="sex"> <div class="sex">
<span :class="sex == 0? 'active':''" @click="sex = 0">全部</span> <span :class="sex == 0? 'active':''" @click="sex = 0">全部</span>
@@ -54,12 +55,13 @@ export default {
data() { data() {
return { return {
type: "", type: "",
sendType: '',
showCalendar: false, showCalendar: false,
startTime: '', startTime: '',
endTime: '', endTime: '',
sex: "0", sex: "0",
userList: [], userList: [],
userListIds: [], deptListArr: [],
selectedUser: [] selectedUser: []
} }
}, },
@@ -78,12 +80,11 @@ export default {
this.selectEnterpriseContact({ this.selectEnterpriseContact({
fromDepartmentId: 0, fromDepartmentId: 0,
mode: "multi", mode: "multi",
type: ["user"], type: ["department"],
selectedUserIds: this.userListIds?.map(e => e.id) selectedUserIds: this.deptListArr?.map(e => e.id)
}).then((res)=>{ }).then((res)=>{
if(res?.userList) { if(res?.userList) {
this.userListIds = res.userList this.deptListArr = res.userList
console.log(this.userListIds,'userListIds');
} }
} }
).catch((err) => { ).catch((err) => {
@@ -103,19 +104,28 @@ export default {
// 选时间范围 // 选时间范围
selectDate(e) { selectDate(e) {
console.log(e);
this.startTime = e.startDate this.startTime = e.startDate
this.endTime = e.endDate this.endTime = e.endDate
}, },
submit() {} submit() {
uni.setStorageSync('girdList',this.selectedUser)
uni.setStorageSync('deptList',this.deptListArr)
uni.navigateBack({
success: () => {
uni.$emit("girdList", this.selectedUser)
uni.$emit("deptList", this.deptListArr)
}
})
}
}, },
onLoad(o) { onLoad(o) {
this.type = o.type; this.type = o.type;
this.sendType = o.sendType;
document.title = this.type == 1? '按部门选择':'按网格选择' document.title = this.type == 1? '按部门选择':'按网格选择'
uni.$on("pagePicker:custom", res => { uni.$on("pagePicker:custom", res => {
this.selectedUser = res this.selectedUser = res
}) })
} },
} }
</script> </script>

View File

@@ -67,18 +67,13 @@ export default {
this.treeList = this.allData.filter(e => !e.parentGirdId) this.treeList = this.allData.filter(e => !e.parentGirdId)
this.selectGridPath = [{girdName: "可选范围", id: ''}] this.selectGridPath = [{girdName: "可选范围", id: ''}]
}, },
itemClick({id,girdName,isChecked}) { itemClick({id,girdName}) {
this.selectGridPath.push({girdName,id}) this.selectGridPath.push({girdName,id})
this.getGridsAndUsersByParent(id,isChecked) this.getGridsAndUsersByParent(id)
}, },
getGridsAndUsersByParent(id,checkType) { getGridsAndUsersByParent(id) {
if(checkType) { this.treeList = this.allData.filter(e => (e.parentGirdId == id))
this.selected.push(this.treeList)
}
this.treeList = this.allData.filter(e => (e.parentGirdId == id)).map(v=>
({...v,isChecked: this.selected.find(i=> i.id==v.id)}))
this.$forceUpdate() this.$forceUpdate()
}, },
girdNameClick(row, index) { girdNameClick(row, index) {

View File

@@ -30,15 +30,19 @@ export default {
return { return {
value: '', value: '',
checkList: [ checkList: [
{ name: '全部居民群', checked: true, value: '0'}, { name: '全部居民群', checked: false, value: '0'},
{ name: '按部门选择', checked: false, value: '1'}, { name: '按部门选择', checked: false, value: '1'},
{ name: '按网格选择', checked: false, value: '2' } { name: '按网格选择', checked: false, value: '2' }
], ],
showContent: false, showContent: false,
type: '', sendType: '',
deptSelect: [], deptSelect: [],
girdSelect: [], girdSelect: [],
sendScope: '0', sendScope: '0',
girdListIds: [],
deptListIds: [],
wxGroups: [],
groupNames: [],
} }
}, },
methods: { methods: {
@@ -46,22 +50,61 @@ export default {
this.checkList.forEach(v=> v.checked = false) this.checkList.forEach(v=> v.checked = false)
e.checked = true e.checked = true
if(e.value == '1' || e.value == '2') { if(e.value == '1' || e.value == '2') {
uni.navigateTo({url: `./scopedSelect?type=${e.value}`}) uni.navigateTo({url: `./scopedSelect?type=${e.value}&sendType=${this.sendType}`})
} }
this.sendScope = e.value this.sendScope = e.value
}, },
submit() { submit() {
this.getWxGroups()
uni.setStorageSync('sendScope', this.sendScope)
uni.navigateBack({ uni.navigateBack({
success: () => { success: () => {
uni.$emit("checkedScope",{ sendScope: this.sendScope }); uni.$emit("checkedScope",{ sendScope: this.sendScope });
} }
}) })
},
getWxGroups() {
this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`,
// null,
// {
// data: {
// filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',')
// },
// headers: {'Content-Type': 'application/json;charset=utf-8'},
// transformRequest: [function(data) {
// console.log(data);
// return data.filterCriteria
// }]
// }).then(res => {
// if (res.code === 0) {
// this.wxGroups = res.data
// }
// })
{
filterCriteria: ''
}).then(res => {
if (res.code === 0) {
this.wxGroups = res.data
} }
})
},
}, },
onLoad(o) { onLoad(o) {
this.type = o.type; this.sendType = o.type;
document.title = "选择发送范围" document.title = "选择发送范围"
this.sendScope = uni.getStorageSync('sendScope')
// this.checkList.map(i=> i.value ==this.sendScope)
}, },
onShow() {
uni.$on("girdList",res => {
this.girdListIds = res.map(e=>e.id)
})
uni.$on("deptList",res => {
this.deptListIds = res.map(e=>e.id)
})
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>