From 8fc6e0a3a7bc204a3ac975bf6917dc6bb364065c Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Tue, 13 Sep 2022 10:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addPropaganda.vue | 102 ++++++++---------- .../AppCooperationPropaganda/scopedSelect.vue | 4 +- .../AppCooperationPropaganda/sendScoped.vue | 2 +- 3 files changed, 46 insertions(+), 62 deletions(-) diff --git a/src/apps/AppCooperationPropaganda/addPropaganda.vue b/src/apps/AppCooperationPropaganda/addPropaganda.vue index ca2e4f16..ef1654fe 100644 --- a/src/apps/AppCooperationPropaganda/addPropaganda.vue +++ b/src/apps/AppCooperationPropaganda/addPropaganda.vue @@ -10,7 +10,7 @@
请选择 - 预计送达{{ form.wxGroups.length || forms.executorList }}名成员 + 预计送达{{ form.wxGroups.length }}名成员
@@ -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 = [ { @@ -419,6 +384,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,40 +405,47 @@ 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=>{ - if(res?.code ==0) { - this.flag = false - this.$u.toast("新增成功") - } - }).catch((err)=>{ - 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) - }) + 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("新增成功") + + } + }).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 + } } diff --git a/src/apps/AppCooperationPropaganda/scopedSelect.vue b/src/apps/AppCooperationPropaganda/scopedSelect.vue index 403dcf97..dd3eb90b 100644 --- a/src/apps/AppCooperationPropaganda/scopedSelect.vue +++ b/src/apps/AppCooperationPropaganda/scopedSelect.vue @@ -35,7 +35,7 @@ -
+
添加时间
请选择 @@ -44,7 +44,7 @@
-
+
性别
全部 diff --git a/src/apps/AppCooperationPropaganda/sendScoped.vue b/src/apps/AppCooperationPropaganda/sendScoped.vue index e11ea756..ccd62330 100644 --- a/src/apps/AppCooperationPropaganda/sendScoped.vue +++ b/src/apps/AppCooperationPropaganda/sendScoped.vue @@ -81,7 +81,7 @@ export default { uni.$emit('predictUser', this.wxGroups) } }) - }, 4000) + }, 1000) }, // 群发居民群