协同宣发
This commit is contained in:
		| @@ -20,7 +20,7 @@ | ||||
|                     <el-radio label="2">按网格选择</el-radio> | ||||
|                   </el-radio-group> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="选择群主" v-if="form.sendScope !== '0'" prop="wxGroupsName" style="width: 100%;" :rules="[{ required: true, message: '请选择选择群主', trigger: 'change' }]"> | ||||
|                 <el-form-item label="发送居民" v-if="form.sendScope !== '0'" prop="wxGroupsName" style="width: 100%;" :rules="[{ required: true, message: '请选择发送居民', trigger: 'change' }]"> | ||||
|                   <ai-picker | ||||
|                     :instance="instance" | ||||
|                     multiple | ||||
| @@ -33,11 +33,11 @@ | ||||
|                     @change="onSelcetChange"> | ||||
|                     <div class="AppAnnounceDetail-select"> | ||||
|                       <el-input size="small" class="AppAnnounceDetail-select__input" placeholder="请选择..." disabled v-model="form.wxGroupsName"></el-input> | ||||
|                       <div class="select-left" v-if="form.wxGroups.length"> | ||||
|                         <span v-for="(item, index) in form.wxGroups" :key="index" v-if="index < 9">{{ item.groupOwnerName }}</span> | ||||
|                         <em v-if="form.wxGroups.length > 9">等{{ form.wxGroups.length }}个</em> | ||||
|                       <div class="select-left" v-if="form.executorList.length"> | ||||
|                         <span v-for="(item, index) in form.executorList" :key="index" v-if="index < 9">{{ item.executorName }}</span> | ||||
|                         <em v-if="form.executorList.length > 9">等{{ form.executorList.length }}个</em> | ||||
|                       </div> | ||||
|                       <i v-if="!form.wxGroups.length">请选择</i> | ||||
|                       <i v-if="!form.executorList.length">请选择</i> | ||||
|                       <div class="select-right">{{ form.filterCriteria.length ? '重新选择' : '选择' }}</div> | ||||
|                     </div> | ||||
|                   </ai-picker> | ||||
| @@ -51,6 +51,16 @@ | ||||
|                     </el-tooltip> | ||||
|                   </div> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="居民标签" style="width: 100%" v-if="form.sendScope !== '0'" prop="wxGroupsName"> | ||||
|                   <div class="AppAnnounceDetail-select" @click="isShowTags = true"> | ||||
|                     <el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.filterTagsName"></el-input> | ||||
|                     <div class="select-left" v-if="form.filterTags.length"> | ||||
|                       <span v-for="(item, index) in form.filterTags" :key="index">{{ item.name }}</span> | ||||
|                     </div> | ||||
|                     <i v-if="!form.filterTags.length">请选择</i> | ||||
|                     <div class="select-right">{{ form.filterTags.length ? '重新选择' : '选择' }}</div> | ||||
|                   </div> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="发送内容" prop="content" style="width: 100%;" :rules="[{ required: true, message: '请输入发送内容', trigger: 'blur' }]"> | ||||
|                   <el-input size="small" type="textarea" :rows="6" maxlength="1300" show-word-limit placeholder="请输入文本内容..." v-model="form.content"></el-input> | ||||
|                   <div class="add"> | ||||
| @@ -74,48 +84,48 @@ | ||||
|                       </div> | ||||
|                       <div class="AppAnnounceDetail-content-wrapper"> | ||||
|                         <el-upload | ||||
|                             ref="upload" | ||||
|                             multiple | ||||
|                             :file-list="fileList" | ||||
|                             :show-file-list="false" | ||||
|                             :before-upload="v => handleChange(v, 10, '.jpg,.png,.jpeg')" | ||||
|                             :limit="9" | ||||
|                             action="/app/wxcp/upload/uploadFile" | ||||
|                             accept=".jpg,.png,.jpeg" | ||||
|                             :on-exceed="onExceed" | ||||
|                             :http-request="v => submitUpload(v, '1')"> | ||||
|                           ref="upload" | ||||
|                           multiple | ||||
|                           :file-list="fileList" | ||||
|                           :show-file-list="false" | ||||
|                           :before-upload="v => handleChange(v, 10, '.jpg,.png,.jpeg')" | ||||
|                           :limit="9" | ||||
|                           action="/app/wxcp/upload/uploadFile" | ||||
|                           accept=".jpg,.png,.jpeg" | ||||
|                           :on-exceed="onExceed" | ||||
|                           :http-request="v => submitUpload(v, '1')"> | ||||
|                           <div class="content-item" trigger> | ||||
|                             <img src="https://cdn.cunwuyun.cn/dvcp/announce/big-img.png"/> | ||||
|                             <p>图片</p> | ||||
|                           </div> | ||||
|                         </el-upload> | ||||
|                         <el-upload | ||||
|                             ref="upload" | ||||
|                             multiple | ||||
|                             :file-list="fileList" | ||||
|                             :show-file-list="false" | ||||
|                             :before-upload="v => handleChange(v, 10, '.mp4')" | ||||
|                             :limit="9" | ||||
|                             action="/app/wxcp/upload/uploadFile" | ||||
|                             accept=".mp4" | ||||
|                             :on-exceed="onExceed" | ||||
|                             :http-request="v => submitUpload(v, '2')"> | ||||
|                           ref="upload" | ||||
|                           multiple | ||||
|                           :file-list="fileList" | ||||
|                           :show-file-list="false" | ||||
|                           :before-upload="v => handleChange(v, 10, '.mp4')" | ||||
|                           :limit="9" | ||||
|                           action="/app/wxcp/upload/uploadFile" | ||||
|                           accept=".mp4" | ||||
|                           :on-exceed="onExceed" | ||||
|                           :http-request="v => submitUpload(v, '2')"> | ||||
|                           <div class="content-item" trigger> | ||||
|                             <img src="https://cdn.cunwuyun.cn/dvcp/announce/big-video.png"/> | ||||
|                             <p>视频</p> | ||||
|                           </div> | ||||
|                         </el-upload> | ||||
|                         <el-upload | ||||
|                             ref="upload" | ||||
|                             multiple | ||||
|                             :file-list="fileList" | ||||
|                             :show-file-list="false" | ||||
|                             :before-upload="v => handleChange(v, 20, '.zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt')" | ||||
|                             :limit="9" | ||||
|                             :on-exceed="onExceed" | ||||
|                             action="/app/wxcp/upload/uploadFile" | ||||
|                             accept=".zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt" | ||||
|                             :http-request="v => submitUpload(v, '3')"> | ||||
|                           ref="upload" | ||||
|                           multiple | ||||
|                           :file-list="fileList" | ||||
|                           :show-file-list="false" | ||||
|                           :before-upload="v => handleChange(v, 20, '.zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt')" | ||||
|                           :limit="9" | ||||
|                           :on-exceed="onExceed" | ||||
|                           action="/app/wxcp/upload/uploadFile" | ||||
|                           accept=".zip,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt" | ||||
|                           :http-request="v => submitUpload(v, '3')"> | ||||
|                           <div class="content-item" trigger> | ||||
|                             <img src="https://cdn.cunwuyun.cn/dvcp/announce/folder.png"/> | ||||
|                             <p>文件</p> | ||||
| @@ -134,21 +144,21 @@ | ||||
|                 </el-form-item> | ||||
|                 <el-form-item label="宣发审批" prop="enableExamine" style="width: 100%;" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]"> | ||||
|                   <el-switch | ||||
|                       v-model="form.enableExamine" | ||||
|                       active-value="1" | ||||
|                       inactive-value="0" | ||||
|                       active-text="开启后,创建的群发任务需要审批人进行审批"> | ||||
|                     v-model="form.enableExamine" | ||||
|                     active-value="1" | ||||
|                     inactive-value="0" | ||||
|                     active-text="开启后,创建的群发任务需要审批人进行审批"> | ||||
|                   </el-switch> | ||||
|                 </el-form-item> | ||||
|                 <el-form-item v-if="form.enableExamine === '1'" label="审批人员" prop="examines" style="width: 100%;" :rules="[{ required: true, message: '请选择审批人员', trigger: 'change' }]"> | ||||
|                   <ai-wechat-selecter :instance="instance" v-model="form.examines" @change="onUserChange"> | ||||
|                 <el-form-item v-if="form.enableExamine === '1'" label="审批人员" prop="examineList" style="width: 100%;" :rules="[{ required: true, message: '请选择审批人员', trigger: 'change' }]"> | ||||
|                   <ai-wechat-selecter :instance="instance" v-model="form.examineList" @change="onUserChange"> | ||||
|                     <div class="AppAnnounceDetail-select"> | ||||
|                       <el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.examinesName"></el-input> | ||||
|                       <div class="select-left" v-if="form.examines.length"> | ||||
|                         <span v-for="(item, index) in form.examines" :key="index">{{ item.name }}</span> | ||||
|                       <div class="select-left" v-if="form.examineList.length"> | ||||
|                         <span v-for="(item, index) in form.examineList" :key="index">{{ item.name }}</span> | ||||
|                       </div> | ||||
|                       <i v-if="!form.examines.length">请选择</i> | ||||
|                         <div class="select-right">{{ form.examines.length ? '重新选择' : '选择' }}</div> | ||||
|                       <i v-if="!form.examineList.length">请选择</i> | ||||
|                         <div class="select-right">{{ form.examineList.length ? '重新选择' : '选择' }}</div> | ||||
|                     </div> | ||||
|                   </ai-wechat-selecter> | ||||
|                 </el-form-item> | ||||
| @@ -169,29 +179,29 @@ | ||||
|             <div class="ai-form"> | ||||
|               <el-form-item label="标题" style="width: 100%;" prop="linkTitle" :rules="[{ required: true, message: '请输入标题', trigger: 'blur' }]"> | ||||
|                 <el-input | ||||
|                     size="small" | ||||
|                     placeholder="请输入标题" | ||||
|                     maxlength="42" | ||||
|                     show-word-limit | ||||
|                     v-model="linkForm.linkTitle"> | ||||
|                   size="small" | ||||
|                   placeholder="请输入标题" | ||||
|                   maxlength="42" | ||||
|                   show-word-limit | ||||
|                   v-model="linkForm.linkTitle"> | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="链接" style="width: 100%;" prop="linkUrl" :rules="[{ required: true, message: '请输入链接', trigger: 'blur' }]"> | ||||
|                 <el-input | ||||
|                     size="small" | ||||
|                     placeholder="请输入链接" | ||||
|                     maxlength="682" | ||||
|                     show-word-limit | ||||
|                     v-model="linkForm.linkUrl"> | ||||
|                   size="small" | ||||
|                   placeholder="请输入链接" | ||||
|                   maxlength="682" | ||||
|                   show-word-limit | ||||
|                   v-model="linkForm.linkUrl"> | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="描述" style="width: 100%;" prop="linkDesc"> | ||||
|                 <el-input | ||||
|                     size="small" | ||||
|                     placeholder="请输入描述" | ||||
|                     maxlength="170" | ||||
|                     show-word-limit | ||||
|                     v-model="linkForm.linkDesc"> | ||||
|                   size="small" | ||||
|                   placeholder="请输入描述" | ||||
|                   maxlength="170" | ||||
|                   show-word-limit | ||||
|                   v-model="linkForm.linkDesc"> | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="封面图" prop="linkPicUrl" style="width: 100%;"> | ||||
| @@ -225,6 +235,27 @@ | ||||
|             <el-button @click="onDateForm" type="primary" :loading="isLoading2" style="width: 92px;">确认</el-button> | ||||
|           </div> | ||||
|         </ai-dialog> | ||||
|         <ai-dialog | ||||
|           :visible.sync="isShowTags" | ||||
|           width="800px" | ||||
|           title="标签'" | ||||
|           @close="onClose" | ||||
|           @onConfirm="onTagsConfirm"> | ||||
|           <div class="tags"> | ||||
|             <div class="tag-item" v-for="(item, index) in tags" :key="index"> | ||||
|               <h2>{{ item.name }}</h2> | ||||
|               <div class="tag-item__right"> | ||||
|                 <el-button | ||||
|                   :type="chooseTags.map(v => v.id).indexOf(item.id) === -1 ? '' : 'primary'" | ||||
|                   v-for="(item, index) in item.tagList" | ||||
|                   @click="choose(item)" | ||||
|                   :key="index"> | ||||
|                   {{ item.name }} | ||||
|                 </el-button> | ||||
|               </div> | ||||
|             </div> | ||||
|           </div> | ||||
|         </ai-dialog> | ||||
|       </div> | ||||
|     </template> | ||||
|     <template #footer> | ||||
| @@ -258,6 +289,7 @@ export default { | ||||
|       department: [], | ||||
|       isLoading1: false, | ||||
|       isLoading2: false, | ||||
|       isShowTags: false, | ||||
|       fileList: [], | ||||
|       isShowAddLink: false, | ||||
|       isShowAddMiniapp: false, | ||||
| @@ -277,12 +309,14 @@ export default { | ||||
|         choiceTime: '', | ||||
|         contents: [], | ||||
|         enableExamine: '0', | ||||
|         examines: [], | ||||
|         wxGroups: [], | ||||
|         examineList: [], | ||||
|         executorList: [], | ||||
|         wxGroupsName: '', | ||||
|         sendScope: '0', | ||||
|         sendType: 0, | ||||
|         name: '', | ||||
|         filterTags: [], | ||||
|         filterTagsName: '', | ||||
|         filterCriteria: [], | ||||
|         taskTitle: '', | ||||
|         examinesName: '' | ||||
| @@ -290,6 +324,8 @@ export default { | ||||
|       girdNames: '', | ||||
|       id: '', | ||||
|       tagsList: [], | ||||
|       tags: [], | ||||
|       chooseTags: [], | ||||
|       pickerOptions: { | ||||
|         disabledDate: e => { | ||||
|           return e.getTime() < (Date.now() - 60 * 1000 * 60 * 24) | ||||
| @@ -302,12 +338,7 @@ export default { | ||||
|     ...mapState(['user']), | ||||
|  | ||||
|     groupLen() { | ||||
|       let i = 0 | ||||
|       this.form.wxGroups.forEach(v => { | ||||
|         i = i + v.groupIds.split(',').length | ||||
|       }) | ||||
|  | ||||
|       return i | ||||
|       return this.form.executorList.length | ||||
|     } | ||||
|   }, | ||||
|  | ||||
| @@ -318,11 +349,37 @@ export default { | ||||
|     } else { | ||||
|       this.getWxGroups() | ||||
|     } | ||||
|  | ||||
|     this.getTags() | ||||
|   }, | ||||
|  | ||||
|   methods: { | ||||
|     ...mapActions(['initOpenData', 'transCanvas']), | ||||
|  | ||||
|     choose (e) { | ||||
|       const index = this.chooseTags.map(v => v.id).indexOf(e.id) | ||||
|       if (index === -1) { | ||||
|         this.chooseTags.push(e) | ||||
|       } else { | ||||
|         this.chooseTags.splice(index, 1) | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     getTags () { | ||||
|       this.instance.post(`/app/wxcp/wxcorptag/listAll?size=100`).then(res => { | ||||
|         if (res.code == 0) { | ||||
|           this.tags = res.data.records | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     onTagsConfirm () { | ||||
|       this.form.filterTagsName = this.chooseTags.map(v => v.name).join(',') | ||||
|       this.form.filterTags = [...this.chooseTags] | ||||
|  | ||||
|       this.isShowTags = false | ||||
|     }, | ||||
|  | ||||
|     getInfo(id) { | ||||
|       this.instance.post(`/app/appmasssendingtask/queryDetailById?id=${id}`).then(res => { | ||||
|         if (res.code === 0) { | ||||
| @@ -339,8 +396,8 @@ export default { | ||||
|  | ||||
|           this.dateForm.choiceTime = '' | ||||
|  | ||||
|           if (res.data.examines && res.data.examines.length) { | ||||
|             this.form.examines = res.data.examines.map(v => { | ||||
|           if (res.data.examineList && res.data.examineList.length) { | ||||
|             this.form.examineList = res.data.examineList.map(v => { | ||||
|               return { | ||||
|                 ...v, | ||||
|                 wxOpenUserId: v.examineUserId, | ||||
| @@ -372,13 +429,13 @@ export default { | ||||
|       if (e.length) { | ||||
|         this.form.examinesName = '1' | ||||
|       } else { | ||||
|         this.form.wxGroupsName = '' | ||||
|         this.form.examinesName = '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     onScopeChange(e) { | ||||
|       this.form.filterCriteria = [] | ||||
|       this.form.wxGroups = [] | ||||
|       this.form.executorList = [] | ||||
|       this.girdNames = '' | ||||
|  | ||||
|       if (e === '0') { | ||||
| @@ -403,22 +460,19 @@ export default { | ||||
|         }) | ||||
|       } else { | ||||
|         this.form.wxGroupsName = '' | ||||
|         this.form.wxGroups = [] | ||||
|         this.form.executorList = [] | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     getWxGroups() { | ||||
|       this.instance.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.form.sendScope}`, null, { | ||||
|         data: { | ||||
|           filterCriteria: this.form.filterCriteria.join(',') | ||||
|         }, | ||||
|         headers: {'Content-Type': 'application/json;charset=utf-8'}, | ||||
|         transformRequest: [function (data) { | ||||
|           return data.filterCriteria | ||||
|         }] | ||||
|       this.instance.post(`/app/whchatmomentstask/getSendScope`, { | ||||
|         sendScope: this.form.sendScope, | ||||
|         filterTags: this.form.filterTags.map(v => v.id).join(','), | ||||
|         filterCriteria: this.form.filterCriteria.join(','), | ||||
|         taskType: 0 | ||||
|       }).then(res => { | ||||
|         if (res.code === 0) { | ||||
|           this.form.wxGroups = res.data | ||||
|           this.form.executorList = res.data | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
| @@ -534,7 +588,7 @@ export default { | ||||
|     confirm(sendType) { | ||||
|       this.$refs.form.validate((valid) => { | ||||
|         if (valid) { | ||||
|           if (!this.form.wxGroups.length) { | ||||
|           if (!this.form.executorList.length) { | ||||
|             return this.$message.error('居民群数量不能为0') | ||||
|           } | ||||
|  | ||||
| @@ -556,15 +610,34 @@ export default { | ||||
|           } else { | ||||
|             this.isLoading2 = true | ||||
|           } | ||||
|           this.instance.post(`/app/appmasssendingtask/addOrUpdate`, { | ||||
|  | ||||
|           console.log({ | ||||
|             ...this.form, | ||||
|             id: this.params.id, | ||||
|             wxGroups: this.form.wxGroups, | ||||
|             executorList: this.form.executorList, | ||||
|             contents, | ||||
|             sendType, | ||||
|             filterTags: this.form.filterTags.map(v => v.id).join(','), | ||||
|             choiceTime: this.dateForm.choiceTime, | ||||
|             filterCriteria: this.form.filterCriteria.join(','), | ||||
|             examines: this.form.examines.length ? this.form.examines.map(v => { | ||||
|             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, | ||||
|             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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user