Ver Fonte

直播sop发送

lmx há 1 dia atrás
pai
commit
895d9036a5

+ 33 - 6
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -45,6 +45,19 @@
               :value="parseInt(dict.dictValue)"
             />
           </el-select>
+        </el-form-item>
+         <el-form-item label="选择直播间">
+             <el-select  v-model="msgForm.liveId"
+                                      placeholder="请选择直播间" size="mini"
+                                       style=" margin-right: 10px;"
+                                      @change="liveChangemsgForm(msgForm.liveId)" clearable >
+                            <el-option
+                              v-for="dict in liveList"
+                              :key="dict.liveId"
+                              :label="dict.liveName"
+                              :value="dict.liveId"
+                            />
+              </el-select>
         </el-form-item>
         <el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1"  >
           <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
@@ -92,7 +105,7 @@
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
                                       placeholder="请选择直播间" size="mini"
-                                      @change="liveChange(item)" >
+                                      @change="liveChange(item)" :disabled="liveDisabled()">
                             <el-option
                               v-for="dict in liveList"
                               :key="dict.liveId"
@@ -103,11 +116,11 @@
                         </el-form-item>
 
                         <el-form-item label="标题" prop="miniprogramTitle">
-                          <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
+                          <el-input :disabled="liveDisabled()" v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
                                     type="textarea"   />
                         </el-form-item>
                         <el-form-item label="封面" prop="miniprogramPicUrl">
-                          <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          <ImageUpload :disabled="liveDisabled()" v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
                           <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
@@ -474,6 +487,7 @@ export default {
       form: {},
       setting:[{contentType:'1', value: '',}],
       msgForm:{
+        liveId:null,
         videoId:null,
         courseId:null,
         courseType:null,
@@ -880,6 +894,7 @@ export default {
 
     resetSendMsgSop() {
       this.msgForm = {
+        liveId:null,
         videoId:null,
         courseId:null,
         courseType:null,
@@ -928,11 +943,11 @@ export default {
             if (this.setting.length <= 0) {
               return this.$message.error("请添加规则")
             }
-            if ((this.msgForm.courseId===null || this.msgForm.courseId==='') && !hasLiveSetting){
+            if ((this.msgForm.courseId===null || this.msgForm.courseId==='') && !hasLiveSetting && this.msgForm.liveId===null){
               return this.$message.error("课程不能为空")
             }
 
-            if ((this.msgForm.videoId===null || this.msgForm.videoId==='') && !hasLiveSetting){
+            if ((this.msgForm.videoId===null || this.msgForm.videoId==='') && !hasLiveSetting && this.msgForm.liveId===null){
               return this.$message.error("课节不能为空")
             }
 
@@ -1017,7 +1032,19 @@ export default {
       this.sendMsgOpen.open = false;
       this.resetSendMsgSop();
     },
-
+    liveChangemsgForm(liveId){
+      console.log(liveId);
+      console.log(this.setting);
+      if(!!liveId){
+        for(let i =0;i<this.setting.length;i++){
+           this.$set(this.setting[i], 'liveId', liveId);
+           this.liveChange(this.setting[i]);
+        }
+      }
+    },
+    liveDisabled(){
+      return !!this.msgForm && !!this.msgForm.liveId ;
+    }
   }
 };
 </script>

+ 61 - 5
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -266,6 +266,28 @@
               :value="parseInt(dict.dictValue)"
             />
           </el-select>
+           
+        </el-form-item>
+        <el-form-item label="选择直播间">
+             <el-select  v-model="msgForm.liveId"
+                                      placeholder="请选择直播间" size="mini"
+                                       style=" margin-right: 10px;"
+                                      @change="liveChangemsgForm(msgForm.liveId)" clearable >
+                            <el-option
+                              v-for="dict in liveList"
+                              :key="dict.liveId"
+                              :label="dict.liveName"
+                              :value="dict.liveId"
+                            />
+              </el-select> 
+            <!-- <el-select  v-model="msgForm.liveMsgType" placeholder="请选择直播间消息类型" size="mini" style=" margin-right: 10px;" clearable>
+            <el-option
+              v-for="dict in sysFsSopWatchStatus"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select> -->
         </el-form-item>
         <el-form-item label="规则" prop="setting"  >
           <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
@@ -390,7 +412,7 @@
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
                                       placeholder="请选择直播间" size="mini"
-                                      @change="liveChange(item)" >
+                                      @change="liveChange(item)" :disabled="liveDisabled()" >
                             <el-option
                               v-for="dict in liveList"
                               :key="dict.liveId"
@@ -401,11 +423,11 @@
                         </el-form-item>
 
                         <el-form-item label="标题" prop="miniprogramTitle">
-                          <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
+                          <el-input :disabled="liveDisabled()" v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
                                     type="textarea"   />
                         </el-form-item>
                         <el-form-item label="封面" prop="miniprogramPicUrl">
-                          <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          <ImageUpload :disabled="liveDisabled()" v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
                           <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
@@ -715,6 +737,8 @@ export default {
       updateLogsInfoFrom:{},
       setting:[{contentType:'1', value: '',}],
       msgForm:{
+        liveId:null,
+        // liveMsgType:null,
         videoId:null,
         courseId:null,
         courseType:null,
@@ -1297,6 +1321,8 @@ export default {
 
     resetSendMsgSop() {
       this.msgForm = {
+        liveId:null,
+        // liveMsgType:null,
         videoId:null,
         courseId:null,
         courseType:null,
@@ -1374,14 +1400,31 @@ export default {
           this.msgForm.corpId=this.queryParams.corpIdParam;
           this.msgForm.filterMode=this.queryParams.filterMode;
 
+          let hasLiveSetting = false;
+          let jsonSetting = JSON.parse(this.msgForm.setting);
+          for(let index=0;index < jsonSetting.length;index++){
+           if(!!jsonSetting[index] && jsonSetting[index].contentType == "12") {
+            if(!!hasLiveSetting){
+               return this.$message.error("发送直播间只能一次只能发送一条");
+            }
+            hasLiveSetting = true;
+           }
+          }
+          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("直播间不能选取课节");
+          }
+
           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 && this.msgForm.liveId===null){
             return this.$message.error("课程不能为空")
           }
 
-          if (this.msgForm.videoId===null || this.msgForm.videoId===''){
+          if ((this.msgForm.videoId===null || this.msgForm.videoId==='') && !hasLiveSetting && this.msgForm.liveId===null){
             return this.$message.error("课节不能为空")
           }
 
@@ -1544,6 +1587,19 @@ export default {
       this.videoNumOptions.open = false;
 
     },
+    liveChangemsgForm(liveId){
+      console.log(liveId);
+      console.log(this.setting);
+      if(!!liveId){
+        for(let i =0;i<this.setting.length;i++){
+           this.$set(this.setting[i], 'liveId', liveId);
+           this.liveChange(this.setting[i]);
+        }
+      }
+    },
+    liveDisabled(){
+      return !!this.msgForm && !!this.msgForm.liveId ;
+    }
   }
 };
 </script>