协同宣发

This commit is contained in:
yanran200730
2022-07-25 10:39:46 +08:00
parent 4413821d1b
commit e051460e31
2 changed files with 54 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import {Message} from 'element-ui'
let baseURLs = { let baseURLs = {
production: "/", production: "/",
development: '/lan' development: '/saas'
} }
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV] instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
instance.interceptors.request.use(config => { instance.interceptors.request.use(config => {

View File

@@ -272,6 +272,29 @@
v-model="miniAppForm.mpTitle"> v-model="miniAppForm.mpTitle">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="封面图" prop="media" style="width: 100%;" :rules="[{ required: true, message: '请上传封面图', trigger: 'change' }]">
<ai-uploader url="/app/wxcp/upload/uploadFile?type=image" :instance="instance" isWechat v-model="miniAppForm.media" :limit="1"></ai-uploader>
</el-form-item>
</div>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowDate"
width="590px"
title="定时发送"
@close="onClose"
@onConfirm="onDateForm">
<el-form ref="dateForm" :model="dateForm" label-width="130px" label-position="right">
<div class="ai-form">
<el-form-item label="定时发送时间" style="width: 100%;" prop="choiceTime" :rules="[{ required: true, message: '请选择定时发送时间', trigger: 'change' }]">
<el-date-picker
style="width: 100%;"
v-model="dateForm.choiceTime"
type="datetime"
size="small"
placeholder="请选择定时发送时间">
</el-date-picker>
</el-form-item>
</div> </div>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -279,7 +302,7 @@
</template> </template>
<template #footer> <template #footer>
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="confirm(0)" style="width: 120px;">通知成员发送</el-button> <el-button type="primary" @click="confirm(0)" style="width: 120px;" v-loading="isLoading">通知成员发送</el-button>
<el-button type="primary" @click="confirm(1)">定时发送</el-button> <el-button type="primary" @click="confirm(1)">定时发送</el-button>
</template> </template>
</ai-detail> </ai-detail>
@@ -303,16 +326,22 @@
fileList: [], fileList: [],
isShowAddLink: false, isShowAddLink: false,
isShowAddMiniapp: false, isShowAddMiniapp: false,
isShowDate: false,
isLoading: false,
linkForm: { linkForm: {
linkPicUrl: [], linkPicUrl: [],
linkDesc: '', linkDesc: '',
linkTitle: '', linkTitle: '',
linkUrl: '' linkUrl: ''
}, },
dateForm: {
choiceTime: ''
},
miniAppForm: { miniAppForm: {
mpAppid: '', mpAppid: '',
mpPage: '', mpPage: '',
mpTitle: '' mpTitle: '',
media: []
}, },
form: { form: {
content: '', content: '',
@@ -370,6 +399,8 @@
filterCriteria: res.data.filterCriteria.split(',') filterCriteria: res.data.filterCriteria.split(',')
} }
this.dateForm.choiceTime = res.data.choiceTime
if (res.data.examines && res.data.examines.length) { if (res.data.examines && res.data.examines.length) {
this.form.examines = res.data.examines.map(v => { this.form.examines = res.data.examines.map(v => {
return { return {
@@ -457,7 +488,9 @@
if (valid) { if (valid) {
this.fileList.push({ this.fileList.push({
...this.miniAppForm, ...this.miniAppForm,
msgType: '5' msgType: '5',
...this.miniAppForm.media[0],
mediaId: this.miniAppForm.media[0].media.mediaId
}) })
this.isShowAddMiniapp = false this.isShowAddMiniapp = false
@@ -473,6 +506,7 @@
this.miniAppForm.mpAppid = '' this.miniAppForm.mpAppid = ''
this.miniAppForm.mpPage = '' this.miniAppForm.mpPage = ''
this.miniAppForm.mpTitle = '' this.miniAppForm.mpTitle = ''
this.dateForm.choiceTime = ''
}, },
removeFile (index) { removeFile (index) {
@@ -542,10 +576,19 @@
}) })
}, },
onDateForm () {
this.$refs.dateForm.validate((valid) => {
if (valid) {
this.confirm(1)
}
})
},
confirm (sendType) { confirm (sendType) {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (sendType === 1) { if (sendType === 1 && !this.dateForm.choiceTime) {
this.isShowDate = true
return false return false
} }
@@ -557,11 +600,13 @@
...this.fileList ...this.fileList
] ]
this.isLoading = true
this.instance.post(`/app/appmasssendingtask/addOrUpdate`, { this.instance.post(`/app/appmasssendingtask/addOrUpdate`, {
...this.form, ...this.form,
id: this.params.id, id: this.params.id,
wxGroups: this.form.wxGroups, wxGroups: this.form.wxGroups,
contents, contents,
choiceTime: this.dateForm.choiceTime,
filterCriteria: this.form.filterCriteria.join(','), filterCriteria: this.form.filterCriteria.join(','),
examines: this.form.examines.length ? this.form.examines.map(v => { examines: this.form.examines.length ? this.form.examines.map(v => {
return { return {
@@ -576,6 +621,10 @@
this.cancel(true) this.cancel(true)
}, 600) }, 600)
} }
this.isLoading = false
}).catch(() => {
this.isLoading = false
}) })
} }
}) })