Bladeren bron

feat: 群发任务停止需求

zhengxy 1 jaar geleden
bovenliggende
commit
33b85a6eaf

+ 3 - 0
project/src/assets/config/interface_api.js

@@ -465,6 +465,9 @@ var api = {
465 465
   license_renewalJobDetail: '/api/license/renewalJobDetail', // 客服许可续期任务 - 任务详情
466 466
   license_cancelRenewalJob: '/api/license/cancelRenewalJob', // 客服许可续期任务 - 关闭任务
467 467
 
468
+  massMsgCancel_setConfig: '/api/massMsgCancel/setConfig', // 客户群发任务停止 - 创建停止群发任务
469
+  massMsgCancel_taskList: '/api/massMsgCancel/taskList', // 客户群发任务停止 - 群发任务停止任务列表
470
+
468 471
 };
469 472
 
470 473
 export { api };

+ 39 - 1
project/src/components/customOperate/employee_bulk_messaging_log.vue

@@ -114,6 +114,9 @@
114 114
             <el-popconfirm @confirm="copyDetail(scope.row)" :title="`确定复制【${scope.row.name}】群发消息?`">
115 115
               <div slot="reference" class="c-00B38A pointer table_button">复制</div>
116 116
             </el-popconfirm>
117
+            <div v-if="scope.row.enable==3" class="pointer table_button c-FF604D" @click="onClickCancelSend(scope.row)">
118
+              停止群发
119
+            </div>
117 120
           </div>
118 121
         </template>
119 122
       </el-table-column>
@@ -418,7 +421,42 @@ export default {
418 421
         }
419 422
       ]
420 423
       this.$exportOrder({ excelDatas, name: `员工群发消息(导出时间:${this.$getDay(0)})` })
421
-    }
424
+    },
425
+
426
+    // 监听点击“停止群发”
427
+    async onClickCancelSend({ name, rule_id }) {
428
+      try {
429
+        await this.$confirm(`确定停止当前群发任务吗?`, `${ name }`, {
430
+          confirmButtonText: '确定',
431
+          cancelButtonText: '取消',
432
+          type: 'warning'
433
+        })
434
+        this.handleCancelSend(rule_id)
435
+      } catch (error) {
436
+        console.log('error => ', error)
437
+      }
438
+    },
439
+    // async handleCancelSend(rule_id) {
440
+    //   try {
441
+    //     this.loading = true
442
+    //     const url = `${this.URL.BASEURL}${this.URL.massMsgCancel_setConfig}`
443
+    //     const params = {
444
+    //       rule_id,
445
+    //       type: 1, // 群发消息类型。1正常群发 2智能群发 3客户群群发
446
+    //     }
447
+    //     const { data: res = {} } = await this.$axios.post(url, params)
448
+    //     if (res && res.errno == 0) {
449
+    //       this.$message.success('操作成功')
450
+    //       this.resetEvent()
451
+    //     } else if (res.errno != 4002) {
452
+    //       this.$message.warning(res.err)
453
+    //     }
454
+    //   } catch (error) {
455
+    //     console.log(error)
456
+    //   } finally {
457
+    //     this.loading = false
458
+    //   }
459
+    // },
422 460
   }
423 461
 }
424 462
 </script>