فهرست منبع

直播sop调整

lmx 3 روز پیش
والد
کامیت
56e4e7fad7
2فایلهای تغییر یافته به همراه33 افزوده شده و 10 حذف شده
  1. 3 1
      src/views/qw/sop/sop.vue
  2. 30 9
      src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

+ 3 - 1
src/views/qw/sop/sop.vue

@@ -1851,8 +1851,10 @@ export default {
           console.log(jsonSetting)
           for(let index=0;index < jsonSetting.length;index++){
            if(!!jsonSetting[index] && jsonSetting[index].contentType == "12") {
+            if(!!hasLiveSetting){
+               return this.$message.error("发送直播间只能一次只能发送一条");
+            }
             hasLiveSetting = true;
-            break;
            }
           }
           if(!!hasLiveSetting && (this.msgForm.courseId!=null && this.msgForm.courseId!='')){

+ 30 - 9
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -56,7 +56,7 @@
                       <el-radio   :label="item.dictValue" v-for="item in sysQwSopAiContentType"  @change="handleContentTypeChange()">{{item.dictLabel}}</el-radio>
                     </el-radio-group>
                   </el-form-item>
-                  <div v-if="item.contentType == 12">
+                  <!-- <div v-if="item.contentType == 12">
                     <el-card class="box-card">
                       <el-form-item label="直播间" >
                         <el-select  v-model="item.liveId"
@@ -85,10 +85,9 @@
                         <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
                       </el-form-item>
                     </el-card>
-                  </div>
+                  </div> -->
                   <el-form-item label="内容" style="margin-bottom: 2%" >
                     <div v-if="item.contentType == 12">
-                      <!--                                           <div >-->
                       <el-card class="box-card">
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
@@ -224,10 +223,9 @@
                         placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
                         @input="handleInputVideoText(item.value,item)"/>
                     </div>
-                    <div v-if="item.contentType == 12">
-                      <!--                                           <div >-->
+                    <!-- <div v-if="item.contentType == 12">
                       <el-card class="box-card">
-                        <el-form-item label="直播间" >
+                        <el-form-item label="直播间3" >
                           <el-select  v-model="item.liveId"
                                       placeholder="请选择直播间" size="mini"
                                       @change="liveChange(item)" >
@@ -254,7 +252,7 @@
                           <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
                         </el-form-item>
                       </el-card>
-                    </div>
+                    </div> -->
                     <div v-if="item.contentType == 8">
                       <el-button type="primary"
                                  style="margin-bottom: 1%"
@@ -903,18 +901,38 @@ export default {
       this.$refs["msgForm"].validate(valid => {
         if (valid) {
 
+         
+
           if (this.msgForm.draftStrategy==1){
 
+          if(!!hasLiveSetting && (this.msgForm.courseId!=null && this.msgForm.courseId!='')){
+              return this.$message.error("直播间不能选取课程");
+          }
+          if(!!hasLiveSetting && (this.msgForm.videoId!=null && this.msgForm.videoId!='')){
+              return this.$message.error("直播间不能选取课节");
+          }
+
             this.msgForm.setting=JSON.stringify(this.setting)
 
+        let jsonSetting = JSON.parse(this.msgForm.setting);
+          let hasLiveSetting = false;
+          console.log(jsonSetting)
+          for(let index=0;index < jsonSetting.length;index++){
+           if(!!jsonSetting[index] && jsonSetting[index].contentType == "12") {
+            if(!!hasLiveSetting){
+               return this.$message.error("发送直播间只能一次只能发送一条");
+            }
+            hasLiveSetting = true;
+           }
+          }
             if (this.setting.length <= 0) {
               return this.$message.error("请添加规则")
             }
-            if (this.msgForm.courseId===null || this.msgForm.courseId===''){
+            if ((this.msgForm.courseId===null || this.msgForm.courseId==='') && !hasLiveSetting){
               return this.$message.error("课程不能为空")
             }
 
-            if (this.msgForm.videoId===null || this.msgForm.videoId===''){
+            if ((this.msgForm.videoId===null || this.msgForm.videoId==='') && !hasLiveSetting){
               return this.$message.error("课节不能为空")
             }
 
@@ -966,6 +984,9 @@ export default {
               if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
                 return this.$message.error("福袋不能为空")
               }
+              if(this.setting[i].contentType == 12 && (this.setting[i].liveId==null || this.setting[i].liveId == "")){
+                return this.$message.error("直播间不能为空");
+              }
             }
           }