Browse Source

feat: 客户朋友圈 - 停止群发任务

zhengxy 1 year ago
parent
commit
d20f9f9174

+ 1 - 1
project/src/components/assembly/cancelSendListDialog.vue

@@ -56,7 +56,7 @@ export default {
56 56
       type: Boolean,
57 57
       default: () => false
58 58
     },
59
-    // 群发消息类型。1正常群发 2智能群发 3客户群群发
59
+    // 群发消息类型。1正常群发 2智能群发 3客户群群发 4客户朋友圈
60 60
     listType: {
61 61
       type: Number | String,
62 62
       default: () => ''

+ 68 - 2
project/src/components/customOperate/friendsCircle/QWfc.vue

@@ -16,6 +16,7 @@
16 16
         <div class="totalCustom">共<span>{{total}}</span>条朋友圈</div>
17 17
       </div>
18 18
       <div class="flex">
19
+        <el-button type="primary" plain size="mini" @click="onClickCancelSendList">停止群发记录</el-button>
19 20
         <el-button type="primary" plain size="mini" @click="init(1,'export')">导出Excel</el-button>
20 21
       </div>
21 22
     </div>
@@ -189,7 +190,7 @@
189 190
       </el-table-column>
190 191
       <el-table-column label="操作" min-width="150" align="center" fixed="right">
191 192
         <template slot-scope="scope">
192
-          <div class="flex" style="justify-content:center">
193
+          <div class="flex" style="justify-content:center;flex-wrap: wrap;">
193 194
             <el-popconfirm @confirm="remindClick(scope.row.rule_id)" :title="'猎羽将提醒未发送朋友圈的'+scope.row.unpublished_count+'名员工发朋友圈,是否确认提醒 ?'">
194 195
               <div slot="reference" v-if="scope.row.status==1||scope.row.status==2||scope.row.status==3" class="c-00B38A pointer table_button lMar5">提醒</div>
195 196
             </el-popconfirm>
@@ -200,6 +201,10 @@
200 201
             <el-popconfirm @confirm="copyDetail(scope.row)" :title="`确定复制【${scope.row.name}】朋友圈?`">
201 202
               <div slot="reference" class="lMar5 c-00B38A pointer table_button">复制</div>
202 203
             </el-popconfirm>
204
+
205
+            <div v-if="scope.row.status == 4" class="pointer table_button c-FF604D lMar5" @click="onClickCancelSend(scope.row)">
206
+              停止群发
207
+            </div>
203 208
           </div>
204 209
         </template>
205 210
       </el-table-column>
@@ -225,6 +230,14 @@
225 230
     />
226 231
     <!-- E 查看视频 -->
227 232
 
233
+    <!-- S 停止群发记录 -->
234
+    <cancelSendListDialog
235
+      :dialogVisible="cancelSendDialogVisible"
236
+      :listType="cancelSendListType"
237
+      @close="onCloseCancelSendDialog"
238
+    />
239
+    <!-- E 停止群发记录 -->
240
+
228 241
   </div>
229 242
 </template>
230 243
 
@@ -234,9 +247,18 @@ import selfChannel from '@/components/assembly/screen/channel.vue'
234 247
 import createFriendsCircle from '../createFriendsCircle.vue'
235 248
 import detial from './QWdetial.vue'
236 249
 import videoDialog from './videoDialog.vue'
250
+import cancelSendListDialog from '@/components/assembly/cancelSendListDialog.vue'
251
+
237 252
 export default {
238 253
   name: "customerFriendsCircle",
239
-  components: { datePicker, selfChannel, detial, createFriendsCircle, videoDialog },
254
+  components: {
255
+    datePicker,
256
+    selfChannel,
257
+    detial,
258
+    createFriendsCircle,
259
+    videoDialog,
260
+    cancelSendListDialog,
261
+  },
240 262
   watch: {
241 263
     tableData: {  // tableData是表格数据
242 264
       handler () {
@@ -277,6 +299,9 @@ export default {
277 299
 
278 300
       videoDialogVisible: false,
279 301
       currentVideoLink: '',
302
+
303
+      cancelSendListType: 4, // 停止群发任务 群发消息类型。1正常群发 2智能群发 3客户群群发 4朋友圈
304
+      cancelSendDialogVisible: false,
280 305
     }
281 306
   },
282 307
   created () {
@@ -510,6 +535,47 @@ export default {
510 535
       this.currentVideoLink = ''
511 536
       this.videoDialogVisible = false
512 537
     },
538
+
539
+    // 监听点击“停止群发”
540
+    async onClickCancelSend({ name, rule_id }) {
541
+      try {
542
+        await this.$confirm(`确定停止当前群发任务吗?`, `${ name }`, {
543
+          confirmButtonText: '确定',
544
+          cancelButtonText: '取消',
545
+          type: 'warning'
546
+        })
547
+        this.handleCancelSend(rule_id)
548
+      } catch (error) {
549
+        console.log('error => ', error)
550
+      }
551
+    },
552
+    async handleCancelSend(rule_id) {
553
+      try {
554
+        this.loading = true
555
+        const url = `${this.URL.BASEURL}${this.URL.massMsgCancel_setConfig}`
556
+        const params = {
557
+          rule_id,
558
+          type: this.cancelSendListType,
559
+        }
560
+        const { data: res = {} } = await this.$axios.post(url, params)
561
+        if (res && res.errno == 0) {
562
+          this.$message.success('操作成功')
563
+          this.init(this.page)
564
+        } else if (res.errno != 4002) {
565
+          this.$message.warning(res.err)
566
+        }
567
+      } catch (error) {
568
+        console.log(error)
569
+      } finally {
570
+        this.loading = false
571
+      }
572
+    },
573
+    onClickCancelSendList() {
574
+      this.cancelSendDialogVisible = true
575
+    },
576
+    onCloseCancelSendDialog() {
577
+      this.cancelSendDialogVisible = false
578
+    },
513 579
   },
514 580
 }
515 581
 </script>