Browse Source

直播间

1
mo 3 years ago
parent
commit
3fee315b5e

+ 10 - 3
src/views/businessManager/shopManager/shopList.vue

@@ -416,11 +416,13 @@
               <Tooltip :content="scope.row.desc" />
             </template>
           </el-table-column>
+          <!--   -->
           <el-table-column
             align="center"
             width="180px"
             label="操作"
-            fixed="right"
+ fixed="right"
+            key="caozuo"
           >
             <template slot-scope="scope">
               <!-- 组合商品没有进货清单按钮 v-permission="'/purchaseLlist'" -->
@@ -494,7 +496,7 @@
 
     <el-dialog
       :title="addString[addType] + '组合商品'"
-      v-if="routeShopStatus"
+v-if="routeShopStatus"
       :visible.sync="routeShopStatus"
       @close="onFormClose('ruleForm')"
       width="1000px"
@@ -1519,6 +1521,8 @@ async  mounted() {
     },
     onShopOperation(type, row) {
       // 添加或修改
+
+
       let params = {
         type: type,
       };
@@ -1535,7 +1539,7 @@ async  mounted() {
       ) {
         this.routeShopStatus = true;
 
-        let form = this.form;
+        let form =this.form ;
         for (let i in form) {
           form[i] = row[i];
         }
@@ -1806,6 +1810,9 @@ async  mounted() {
 };
 </script>
 <style lang="scss" scoped>
+.el-table__fixed-right{
+  height: 100%!important;
+}
 .alert {
   margin-bottom: 22px;
 }

+ 7 - 6
src/views/liveClassManager/index.vue

@@ -365,7 +365,13 @@ export default {
       if (row.popularize) {
         popularize = 0;
         str = "取消推广";
-        this.$confirm(`您是否${str}直播间"${row.roomTitle}"`, "提示", {
+
+      } else {
+        popularize = 1;
+        str = "推广";
+        // this.$refs.popularizeRoom.openDioag(row);
+      }
+       this.$confirm(`您是否${str}直播间"${row.roomTitle}"`, "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning",
@@ -383,11 +389,6 @@ export default {
             }
           })
           .catch(() => {});
-      } else {
-        popularize = 1;
-        str = "推广";
-        this.$refs.popularizeRoom.openDioag(row);
-      }
     },
     setShop(row) {
       this.$router.push({

+ 2 - 2
src/views/liveClassManager/modals/sellShopList.vue

@@ -10,10 +10,10 @@
       <div>
         <descriptions :column="2">
           <descriptions-item label="购买人数:">{{
-            statInfo.totalAmount
+            statInfo.buyNum | moneyFormat
           }}</descriptions-item>
           <descriptions-item label="销售总额:">{{
-            statInfo.buyNum | moneyFormat
+            statInfo.totalAmount
           }}</descriptions-item>
         </descriptions>
         <el-alert

+ 116 - 6
src/views/liveClassManager/newLiveClass.vue

@@ -158,6 +158,75 @@
           </el-form-item>
         </el-row>
         <el-alert
+          title="观看权限配置"
+          type="info"
+          :closable="false"
+          style="margin-bottom: 20px"
+        ></el-alert>
+        <el-row class="row">
+          <el-form-item
+            class="mline"
+            label="推广类型"
+            prop="popularizeType"
+            label-width="120px"
+            :rules="[{ required: true, message: '请选择推广类型' }]"
+          >
+            <el-radio-group v-model="form.popularizeType" @change="changeType">
+              <el-radio label="ALL">全员</el-radio>
+              <el-radio label="ORGAN">分部</el-radio>
+              <el-radio label="SCHOOL">合作单位</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-row>
+        <el-row class="row">
+          <el-form-item
+            v-if="
+              form.popularizeType == 'SCHOOL' || form.popularizeType == 'ORGAN'
+            "
+            label="分部"
+            prop="organIds"
+            :rules="[{ required: true, message: '请选择分部' }]"
+          >
+            <select-all
+              v-model.trim="form.organIds"
+              filterable
+              clearable
+              placeholder="请选择分部"
+              @change="changeSection"
+            >
+              <el-option
+                v-for="(item, index) in selects.branchs"
+                :key="index"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </select-all>
+          </el-form-item>
+        </el-row>
+        <el-row class="row">
+          <el-form-item
+            v-if="form.popularizeType == 'SCHOOL'"
+            label="合作单位"
+            prop="schoolIds"
+            :rules="[{ required: true, message: '请选择合作单位' }]"
+          >
+            <select-all
+              v-model.trim="form.schoolIds"
+              :disabled="form.organIds.length <= 0"
+              filterable
+              clearable
+              multiple
+            >
+              <el-option
+                v-for="(item, index) in cooperationList"
+                :key="index"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </select-all>
+          </el-form-item>
+        </el-row>
+        <el-alert
           title="直播间信息"
           type="info"
           :closable="false"
@@ -219,7 +288,7 @@
             </el-radio-group>
           </el-form-item>
         </el-row>
-        <el-row class="row">
+        <!-- <el-row class="row">
           <el-form-item
             prop="roomConfig.whether_view_shop_cart"
             label-width="120px"
@@ -232,7 +301,7 @@
               <el-radio :label="1">否</el-radio>
             </el-radio-group>
           </el-form-item>
-        </el-row>
+        </el-row> -->
       </el-form>
       <el-row class="row">
         <el-button type="primary" @click="preLook">预览</el-button>
@@ -256,6 +325,7 @@ import preview from "./modals/preview.vue";
 import axios from "axios";
 import { getToken, getTenantId } from "@/utils/auth";
 import { createLiveBroadcast, resetLiveBroadcastRoomList } from "./api";
+import { queryByOrganId } from "@/api/systemManage";
 export default {
   components: { preview },
   data() {
@@ -263,11 +333,14 @@ export default {
       name: "新建直播课",
       preLookVisible: false,
       form: {
+        organIds: [],
+        schoolIds: [],
         roomTitle: "",
         speakerId: "",
         liveStartTime: "",
         liveRemark: "",
         preTemplate: null,
+        popularizeType: "ALL",
         roomConfig: {
           whether_like: 0,
           whether_chat: 0,
@@ -280,14 +353,26 @@ export default {
       remoteLoading: false,
       teacherList: [],
       checkList: [],
+      cooperationList: [],
+      isinit:true
     };
   },
   mounted() {
+    this.$store.dispatch("setBranchs");
     if (this.$route.query.id) {
       this.name = "修改直播间";
       // console.log()
-      this.form = { ...this.$route.query };
+      this.form = { ...this.$route.query, organIds: [],
+        schoolIds: [], };
       this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
+
+      this.form.organIds =
+        this.$route.query.popularizeOrgIds.split(",").map(item=>{return item*1});
+
+      this.form.schoolIds=this.$route.query.popularizeSchoolIds.split(",").map(item=>{return item*1});
+
+      // this.form.popularizeType = "SCHOOL";
+        this.changeSection(this.form.organIds)
       this.remoteMethod(this.$route.query.speakerName);
       this.checkList.push(this.form.preTemplate * 1);
     }
@@ -305,7 +390,6 @@ export default {
       });
     },
     preLook() {
-      console.log(this.form);
       this.$refs.form.validate((flag) => {
         if (flag) {
           this.preLookVisible = true;
@@ -314,14 +398,13 @@ export default {
       });
     },
     setPreTemplate(index) {
-      console.log("调用", index);
       this.$set(this.form, "preTemplate", index);
       if (this.checkList.indexOf(index) == -1) {
         this.checkList.push(index);
       } else {
         this.checkList.splice(this.checkList.indexOf(index), 1);
       }
-      console.log("调用结束", index);
+      // console.log("调用结束", index);
       this.bindCheckBox();
     },
     remoteMethod(query) {
@@ -387,6 +470,8 @@ export default {
       this.$set(this.form, "preTemplate", this.checkList[0] || null);
     },
     async submit() {
+      this.form.popularizeOrgIds = this.form.organIds.join(",");
+      this.form.popularizeSchoolIds = this.form.schoolIds.join(",");
       if (this.$route.query.id) {
         // 修改
         try {
@@ -409,6 +494,31 @@ export default {
       }
       // createLiveBroadcast
     },
+    changeType() {
+      this.$set(this.form, "organIds", []);
+      this.$set(this.form, "schoolIds", []);
+    },
+    async changeSection(val) {
+
+      if(!this.isinit){
+         this.form.schoolIds = [];
+      }
+   console.log('进来了', this.form,(this.form.popularizeType == "SCHOOL" ) )
+      if (this.form.popularizeType == "SCHOOL" && val && val.length > 0) {
+
+        let organId = val.join(",");
+        try {
+          await queryByOrganId({ organId }).then((res) => {
+            if (res.code == 200) {
+              this.cooperationList = res.data;
+            }
+          });
+        } catch (e) {
+          console.log(e);
+        }
+      }
+     this.isinit = false
+    },
   },
 };
 </script>