This commit is contained in:
shijingjing
2022-09-13 10:15:58 +08:00
parent 7945028589
commit 8fc6e0a3a7
3 changed files with 46 additions and 62 deletions

View File

@@ -10,7 +10,7 @@
<div @click="toSleectScoped">
<span>
<span class="color_gray" v-if="!form.sendScope">请选择</span>
<span v-if="form.sendScope">预计送达{{ form.wxGroups.length || forms.executorList }}名成员</span>
<span v-if="form.sendScope">预计送达{{ form.wxGroups.length }}名成员</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</span>
</div>
@@ -190,38 +190,6 @@ export default {
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送
gender: '', // 性别0-女、1-男、2-全部
wxGroups: [
{
corpId: "ww596787bb70f08288",
errorCode: null,
errorMsg: null,
groupCount: 1,
groupIds: "wrytYEDgAAA5MGVJ3Ttb6ycbmxJ2Zv-Q",
groupNames: "111",
groupOwnerId: "d41d8cd98f00b204e9800998ecf8427e",
groupOwnerName: "张硕",
id: null,
msgId: null,
sendStatus: null,
sendTime: null,
taskId: null,
},
{
corpId: "ww596787bb70f08288",
errorCode: null,
errorMsg: null,
groupCount: 4,
groupIds: "wrytYEDgAA-Llt9H1jr40WT1_RfOstWQ,wrytYEDgAADava7QSJGicwZg09nG_GXg,wrytYEDgAAKG6qd39fHWFkrTiT9vsSQQ,wrytYEDgAAPxVpqyzf4kwzwvtdE0nqbQ",
groupNames: "慧政务需求沟通,临汾市政法委企微项目沟通,淄博企微项目沟通群,未命名群聊",
groupOwnerId: "XieJin",
groupOwnerName: "谢晋",
id: null,
msgId: null,
sendStatus: null,
sendTime: null,
taskId: null,
}
], // 送达居民群
},
enableExamine: false,
isTimedTask: false,
@@ -380,10 +348,7 @@ export default {
confirm() {
if(this.flag) return
if(this.type=='ResidentsGroup') {
// 文本
const firstContent = [
{
@@ -420,6 +385,10 @@ export default {
})
this.form.contents.push(...files)
if(this.type=='Residents' || this.type=='CircleOfFriends') {
this.forms.contentList = this.form.contents
}
if(!this.form.taskTitle) {
return this.$u.toast('请输入任务名称')
}
@@ -436,19 +405,38 @@ export default {
if(!this.form.examines.length) {
return this.$u.toast("请选择审批人")
} else {
this.form.enableExamine = '1'
this.form.enableExamine = this.form.enableExamine
}
this.forms.enableExamine = this.form.enableExamine
} else {
this.forms.enableExamine
this.form.
}
if(this.isTimedTask) {
this.form.sendType = 1
this.forms.sendType = 1
if(!this.form.choiceTime.length) {
return this.$u.toast("请选择发送时间")
} else if (new Date(this.form.choiceTime).getTime() < Date.now()) {
return this.$u.toast('定时发送时间不得早于当前时间')
}
this.forms.choiceTime = this.form.choiceTime
} else {
this.form.sendType = 0
this.forms.sendType = 0
this.forms.choiceTime = ''
this.form.choiceTime = ''
}
this.flag = true
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...this.form }).then(res=>{
let formData = {}
if(this.type=='Residents' || this.type=='CircleOfFriends') {
formData = this.forms
} else if(this.type=='ResidentsGroup') {
formData = this.form
}
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...formData }).then(res=>{
if(res?.code ==0) {
this.flag = false
this.$u.toast("新增成功")
@@ -458,18 +446,6 @@ export default {
this.flag = false
this.$u.toast(err)
})
} else {
this.$http.post(`/app/whchatmomentstask/addOrUpdate`, { ...this.form }).then(res=>{
if(res?.code ==0) {
this.flag = false
this.$u.toast("新增成功")
}
}).catch((err)=>{
this.flag = false
this.$u.toast(err)
})
}
},
getDeptUser() {
@@ -496,11 +472,19 @@ export default {
} else if(this.type=='CircleOfFriends') {
this.forms.taskType = 0
}
this.forms.taskTitle = this.form.taskTitle
},
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.groupList = this.form.wxGroups
} else if(this.type=='CircleOfFriends') {
this.forms.taskType = 0
this.forms.executorList = this.form.wxGroups
}
this.forms.taskTitle = this.form.taskTitle
}
}
</script>

View File

@@ -35,7 +35,7 @@
</div>
</div>
<div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div class="item" v-if="['Residents'].includes(sendType)">
<div>添加时间</div>
<div @click="showCalendar = true">
<span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span>
@@ -44,7 +44,7 @@
</div>
</div>
<div class="items" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div class="items" v-if="['Residents'].includes(sendType)">
<div>性别</div>
<div class="sex">
<span :class="sex == 0? 'active':''" @click="sex = 0">全部</span>

View File

@@ -81,7 +81,7 @@ export default {
uni.$emit('predictUser', this.wxGroups)
}
})
}, 4000)
}, 1000)
},
// 群发居民群