From ebce8b7025d4ce6bc6d60da51f0a9b658fea2745 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Tue, 13 Sep 2022 18:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E5=90=8C=E5=AE=A3=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppAnnounceWeChat/components/Add.vue | 75 +++++++------------ .../AppAnnounceWeChat/components/Detail.vue | 2 +- 2 files changed, 30 insertions(+), 47 deletions(-) diff --git a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Add.vue b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Add.vue index 7872ba3f..9bc13d94 100644 --- a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Add.vue +++ b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Add.vue @@ -75,7 +75,7 @@
@@ -115,22 +115,6 @@

视频

- -
- -

文件

-
-

网页

@@ -150,18 +134,18 @@ active-text="开启后,创建的群发任务需要审批人进行审批"> - - + +
-
- {{ item.name }} +
+ {{ item.name }}
- 请选择 -
{{ form.examineList.length ? '重新选择' : '选择' }}
+ 请选择 +
{{ form.examines.length ? '重新选择' : '选择' }}
- + ``
@@ -309,7 +293,7 @@ export default { choiceTime: '', contents: [], enableExamine: '0', - examineList: [], + examines: [], executorList: [], wxGroupsName: '', sendScope: '0', @@ -381,7 +365,7 @@ export default { }, getInfo(id) { - this.instance.post(`/app/appmasssendingtask/queryDetailById?id=${id}`).then(res => { + this.instance.post(`/app/whchatmomentstask/customerTasKDetail?id=${id}`).then(res => { if (res.code === 0) { this.form = { ...this.form, @@ -396,8 +380,8 @@ export default { this.dateForm.choiceTime = '' - if (res.data.examineList && res.data.examineList.length) { - this.form.examineList = res.data.examineList.map(v => { + if (res.data.examines && res.data.examines.length) { + this.form.examines = res.data.examines.map(v => { return { ...v, wxOpenUserId: v.examineUserId, @@ -480,6 +464,11 @@ export default { onLinkConfirm() { this.$refs.linkForm.validate((valid) => { if (valid) { + if (this.fileList.length) { + this.$message.error('最多支持9张图片,或1个视频,或1个链接') + return false + } + this.fileList.push({ ...this.linkForm, linkPicUrl: this.linkForm.linkPicUrl.length ? this.linkForm.linkPicUrl[0].url : '', @@ -524,6 +513,16 @@ export default { }, handleChange(e, size, accept) { + if (accept === '.mp4' && this.fileList.length) { + this.$message.error('最多支持9张图片,或1个视频,或1个链接') + return false + } + + if (accept !== '.mp4' && (this.fileList.map(v => v.msgType).indexOf('2') !== -1 || this.fileList.map(v => v.msgType).indexOf('4') !== -1) ) { + this.$message.error('最多支持9张图片,或1个视频,或1个链接') + return false + } + const isLt10M = e.size / 1024 / 1024 < size const suffixName = this.getExtension(e.name) const suffixNameList = accept.split(',') @@ -611,33 +610,17 @@ export default { this.isLoading2 = true } - console.log({ - ...this.form, - id: this.params.id, - executorList: this.form.executorList, - contents, - sendType, - filterTags: this.form.filterTags.map(v => v.id).join(','), - choiceTime: this.dateForm.choiceTime, - filterCriteria: this.form.filterCriteria.join(','), - examineList: this.form.examineList.length ? this.form.examineList.map(v => { - return { - ...v, - examineUserId: v.id, - examineUserName: v.name - } - }) : [] - }) this.instance.post(`/app/whchatmomentstask/addOrUpdate`, { ...this.form, id: this.params.id, executorList: this.form.executorList, contents, sendType, + taskType: 0, filterTags: this.form.filterTags.map(v => v.id).join(','), choiceTime: this.dateForm.choiceTime, filterCriteria: this.form.filterCriteria.join(','), - examineList: this.form.examineList.length ? this.form.examineList.map(v => { + examines: this.form.examines.length ? this.form.examines.map(v => { return { ...v, examineUserId: v.id, diff --git a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue index 64ea48b5..662d7e1a 100644 --- a/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue +++ b/packages/wxwork/AnnounceWeChat/AppAnnounceWeChat/components/Detail.vue @@ -288,7 +288,7 @@ }, getInfo (id) { - this.instance.post(`/app/appmasssendingtask/queryDetailById?id=${id}`).then(res => { + this.instance.post(`/app/whchatmomentstask/customerTasKDetail?id=${id}`).then(res => { if (res.code === 0) { this.info = res.data if (res.data.status === '4' && res.data.remindTime) {