This commit is contained in:
shijingjing
2022-09-13 18:16:15 +08:00
parent 8c0e7be81b
commit a3cf3fd57a
4 changed files with 74 additions and 63 deletions

View File

@@ -9,8 +9,9 @@
<div><span class="color_red">*</span><span class="title">发送范围</span></div>
<div @click="toSleectScoped">
<span>
<span class="color_gray" v-if="!form.sendScope">请选择</span>
<span v-if="form.sendScope">预计送达{{ form.wxGroups.length }}名成员</span>
<span class="color_gray" v-if="!form.sendScope || sum==0">请选择</span>
<span v-if="type=='ResidentsGroup' && form.wxGroups.length">预计送达{{ form.wxGroups.length }}名成员</span>
<span v-if="type!='ResidentsGroup' && sum != 0">预计送达{{ sum }}名成员</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</span>
</div>
@@ -183,9 +184,9 @@ export default {
taskType: '',
executorList: [], // 任务执行人集合(群发朋友圈的执行人)
groupList: [], // 添加人集合
contentList: [], // 发送内容
contents: [], // 发送内容
enableExamine: '0', // 是否需要审批 0否 1是
examineList: [], // 审批人
examines: [], // 审批人
choiceTime: '', // 定时发送时间
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送
@@ -233,6 +234,7 @@ export default {
}
],
midiaIds: [],
sum: ''
}
},
methods: {
@@ -386,7 +388,7 @@ export default {
this.form.contents.push(...files)
if(this.type=='Residents' || this.type=='CircleOfFriends') {
this.forms.contentList = this.form.contents
this.forms.contents = this.form.contents
}
if(!this.form.taskTitle) {
@@ -434,16 +436,18 @@ export default {
this.flag = true
let formData = {}
let url = ''
if(this.type=='Residents' || this.type=='CircleOfFriends') {
url = `/app/whchatmomentstask/addOrUpdate`
formData = this.forms
} else if(this.type=='ResidentsGroup') {
url = `/app/appmasssendingtask/addOrUpdate`
formData = this.form
}
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...formData }).then(res=>{
if(res?.code ==0) {
this.$http.post(url, { ...formData }).then(res=>{
if(res?.code == 0) {
this.flag = false
this.$u.toast("新增成功")
}
}).catch((err)=>{
this.flag = false
@@ -477,14 +481,18 @@ export default {
}
},
onShow() {
// this.form.wxGroups = uni.getStorageSync('wxGroupsUser') || []
this.form.wxGroups = uni.getStorageSync('wxGroupsUser') || []
this.form.sendScope = uni.getStorageSync('sendScope')
if(this.type=='Residents') {
this.forms.taskType = 1
this.forms.sendScope = this.form.sendScope
this.forms.groupList = this.form.wxGroups
this.sum = this.form.wxGroups.reduce((pre, cur) => pre + cur.customerCount, 0)
} else if(this.type=='CircleOfFriends') {
this.forms.taskType = 0
this.forms.sendScope = this.form.sendScope
this.forms.executorList = this.form.wxGroups
this.sum = this.form.wxGroups.reduce((pre, cur) => pre + cur.customerCount, 0)
}
this.forms.taskTitle = this.form.taskTitle