فهرست منبع

修改IM批量发送消息返回结果业务

wjj 2 ماه پیش
والد
کامیت
6d64ba82ad
1فایلهای تغییر یافته به همراه23 افزوده شده و 17 حذف شده
  1. 23 17
      src/components/course/userCoursePeriod.vue

+ 23 - 17
src/components/course/userCoursePeriod.vue

@@ -110,7 +110,8 @@
                     <el-input v-model="imSendForm.title" placeholder="请输入标题" />
                 </el-form-item>
                 <el-form-item label="发送消息时间" prop="sendTime">
-                    <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="imSendForm.sendTime" type="datetime" placeholder="选择日期时间">
+                    <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="imSendForm.sendTime" type="datetime"
+                        placeholder="选择日期时间">
                     </el-date-picker>
                 </el-form-item>
                 <el-form-item label="有效时长(分钟)" prop="effectiveDuration">
@@ -387,24 +388,29 @@ export default {
     },
     methods: {
         imSubmit() {
-            console.log("imSendForm:",this.imSendForm)
+            console.log("imSendForm:", this.imSendForm)
             this.$refs["imSendForm"].validate(valid => {
-                batchSendCourse(this.imSendForm).then(res=>{
-                    this.imCancel();
-                    this.$message.success('发送成功')
-                })
+                if (valid) {
+                    batchSendCourse(this.imSendForm).then(res => {
+                        if (res.errCode == 0) {
+                            this.imCancel();
+                            this.$message.success('发送成功')
+                        }
+                    })
+                }
+
             });
         },
         handleSend(row) {
             this.imOpen = true;
             this.imSendForm = {
-                userIds:this.userIds,
+                userIds: this.userIds,
                 companyUserId: this.companyUserId,
                 companyId: this.companyId,
-                id:row.id,
-                periodId:row.periodId,
-                courseId:row.courseId,
-                videoId:row.videoId
+                id: row.id,
+                periodId: row.periodId,
+                courseId: row.courseId,
+                videoId: row.videoId
             }
         },
         imCancel() {
@@ -454,11 +460,11 @@ export default {
             this.loading = true;
             const params = { ...this.queryParams };
             params.trainingCampId = null,
-            pagePeriod(params).then(response => {
-                this.periodList = response.rows;
-                this.total = response.total;
-                this.loading = false;
-            });
+                pagePeriod(params).then(response => {
+                    this.periodList = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
         },
         /** 查询左侧列表 */
         getLeftList() {
@@ -717,7 +723,7 @@ export default {
 
 
         handlePeriodSettings(row) {
-            console.log("公司id:",this.companyId,this.companyUserId)
+            console.log("公司id:", this.companyId, this.companyUserId)
             this.periodSettingsData = row;
             this.periodSettingsVisible = true;
             // 初始化课程列表