Переглянути джерело

Merge branch 'six' of http://120.79.166.78:19005/zhongzheng-edu/saas_entrepot_admin into seven

Tang 3 роки тому
батько
коміт
03e28029e0

+ 2 - 3
src/views/Marketing/goods/commodityManageMent/add/courseContent/index.vue

@@ -108,8 +108,6 @@
     <popple-set
       :key="Math.random()"
       ref="poppleSet"
-      :tableData="tableData"
-      :auditionList="auditionList"
       @uploadArrays="uploadArrays"
     />
     <course-check ref="courseCheck" @backData="backVideoData" />
@@ -314,7 +312,8 @@ export default {
      * 点击试听函数
      */
     openAudition() {
-      this.$refs.poppleSet.dialogVisible = true;
+      console.log(this.tableData,this.auditionList)
+      this.$refs.poppleSet.openExpand(this.tableData,this.auditionList)
     },
     /**
      * 试听回调数据

+ 6 - 3
src/views/Marketing/goods/commodityManageMent/edit/courseContent/index.vue

@@ -115,8 +115,6 @@
     <popple-set
       :key="Math.random()"
       ref="poppleSet"
-      :tableData="tableData"
-      :auditionList="auditionList"
       @uploadArrays="uploadArrays"
     />
     <course-check ref="courseCheck" @backData="backVideoData" />
@@ -234,6 +232,10 @@ export default {
     getMoreList(id) {
       this.$api.inquireCoursemenuListS({ courseId: id }).then((res) => {
         res.rows.forEach((item) => {
+          item.auditionMinute = this.$methodsTools.secondToDate(
+            item.durationTime,
+            false
+          );
           item.name = item.menuName;
         });
         this.tableData = res.rows;
@@ -366,7 +368,8 @@ export default {
      * 点击试听函数
      */
     openAudition() {
-      this.$refs.poppleSet.dialogVisible = true;
+      console.log(this.tableData, this.auditionList);
+      this.$refs.poppleSet.openExpand(this.tableData, this.auditionList);
     },
     /**
      * 试听回调数据

+ 2 - 0
src/views/Marketing/goods/commodityManageMent/edit/index.vue

@@ -977,6 +977,7 @@ export default {
               item.sort = Number(item.sort);
               return item;
             });
+            data.courseList = []
           } else {
             data.courseList = this.$refs.courseContent.tableData.map((item) => {
               return {
@@ -984,6 +985,7 @@ export default {
                 sort: Number(item.sort),
               };
             });
+            data.menuList = []
           }
         } else {
           data.courseList = [];

+ 50 - 43
src/views/Marketing/goods/commodityManageMent/poppleSet.vue

@@ -3,10 +3,10 @@
     <el-dialog
       :visible.sync="dialogVisible"
       width="60%"
-      @open="openExpand"
       :show-close="false"
       :close-on-click-modal="false"
       destroy-on-close
+      @closed="showPop = false"
     >
       <div slot="title" class="hearders">
         <div class="leftTitle">试听设置</div>
@@ -21,39 +21,39 @@
       <div style="text-align: end">
         <el-button type="text" @click="inits">重置</el-button>
       </div>
-        <el-tree
-          v-if="showPop"
-          ref="trees"
-          :data="datas"
-          :props="layoutTreeProps"
-          :load="loadNode"
-          lazy
-          :default-checked-keys="audition"
-          :show-checkbox="true"
-          :check-strictly="true"
-          @check-change="getCheckedKeys"
-          node-key="onlyId"
-        >
-          <span class="custom-tree-node" slot-scope="{ node }">
-            <span>{{ node.label }}</span>
-            <span v-if="node.checked && node.data.sectionType !== 2"
-              >试听前
-              <el-time-picker
-                style="width: 140px"
-                size="mini"
-                value-format="HH:mm:ss"
-                range-separator="-"
-                v-model="node.data.auditionMinute"
-                :picker-options="{
-                  selectableRange: compTimes(node.data.durationTime),
-                }"
-                placeholder="请选择试听时长"
-                @blur="changeNum(node)"
-              >
-              </el-time-picker>
-            </span>
+      <el-tree
+        v-if="showPop"
+        ref="trees"
+        :data="datas"
+        :props="layoutTreeProps"
+        :load="loadNode"
+        lazy
+        :default-checked-keys="audition"
+        :show-checkbox="true"
+        :check-strictly="true"
+        @check-change="getCheckedKeys"
+        node-key="onlyId"
+      >
+        <span class="custom-tree-node" slot-scope="{ node }">
+          <span>{{ node.label }}</span>
+          <span v-if="node.checked && node.data.sectionType !== 2"
+            >试听前
+            <el-time-picker
+              style="width: 140px"
+              size="mini"
+              value-format="HH:mm:ss"
+              range-separator="-"
+              v-model="node.data.auditionMinute"
+              :picker-options="{
+                selectableRange: compTimes(node.data.durationTime),
+              }"
+              placeholder="请选择试听时长"
+              @blur="changeNum(node)"
+            >
+            </el-time-picker>
           </span>
-        </el-tree>
+        </span>
+      </el-tree>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
         <el-button type="primary" @click="submitTable">确 定</el-button>
@@ -64,9 +64,10 @@
 
 <script>
 export default {
-  props: ["tableData", "auditionList"],
   data() {
     return {
+      tableData: [],
+      auditionitem: [],
       copyData: [],
       showPop: false,
       datas: [],
@@ -170,11 +171,14 @@ export default {
     /**
      * 弹窗打开触发
      */
-    openExpand() {
-      this.showPop = true;
-      if (this.auditionList) {
-        this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
+    openExpand(item, auditionitem) {
+      this.auditionitem = JSON.parse(JSON.stringify(auditionitem));
+      this.tableData = JSON.parse(JSON.stringify(item));
+      if (auditionitem) {
+        this.auditionListCope = JSON.parse(JSON.stringify(auditionitem));
       }
+      this.dialogVisible = true;
+      this.showPop = true;
     },
     /**
      * @param {Objact,Bool} 当前点击数据 当前是否勾选
@@ -240,23 +244,26 @@ export default {
         this.$message.warning("请勾选至少一节的试听时间");
         return;
       }
-      this.auditionListCope.forEach((item) => {
-        if (!item.auditionMinute || item.auditionMinute === "00:00:00") {
+      for (let i = 0; i < this.auditionListCope.length; i++) {
+        if (
+          !this.auditionListCope[i].auditionMinute ||
+          this.auditionListCope[i].auditionMinute === "00:00:00"
+        ) {
           this.$message.warning("不允许填写时长为0的节,请重新输入");
           return;
         }
-      });
+      }
       this.$emit("uploadArrays", this.auditionListCope);
       this.dialogVisible = false;
     },
     loadNode(node, resolve) {
       var self = this;
       if (node.level === 0) {
+        console.log(11)
         if (this.tableData[0].type > 0) {
           this.tableData.forEach((item) => {
             item.TypeId = `${item.type}-${item.menuId}`;
             if (item.type === 3) {
-              console.log(item,'item')
               item.hasChildren = false;
               item.disabled = false;
               item.onlyId = `${item.courseId || 0}-0-0-${item.menuId}`;
@@ -264,7 +271,7 @@ export default {
                 self.getAllSeNum.push(item.onlyId);
               }
               if (self.auditionListCope) {
-                self.auditionListCope.map((items) => {
+                self.auditionListCope.forEach((items) => {
                   if (items.TypeId === item.TypeId) {
                     if (self.audition.indexOf(item.onlyId) === -1) {
                       self.audition.push(item.onlyId);

+ 2 - 2
src/views/education/examManagement/applicationData/byTrainee.vue

@@ -385,7 +385,7 @@
                 : ""
             }}</span>
           </el-form-item>
-          <div v-if="activeInfoType === 1 && infoData.userExamGoodsSupplement.length > 0">
+          <div v-if="activeInfoType === 1 && infoData.userExamGoodsSupplement && infoData.userExamGoodsSupplement.length > 0">
             <el-button type="info" style="margin-bottom: 20px" size="mini"
               >补考商品自带考试次数</el-button
             >
@@ -418,7 +418,7 @@
               > -->
             </div>
           </div>
-          <div v-if="activeInfoType === 2 && infoData.userExamGoodsSupplementVos.length > 0">
+          <div v-if="activeInfoType === 2 && infoData.userExamGoodsSupplementVos && infoData.userExamGoodsSupplementVos.length > 0">
             <el-button type="info" style="margin-bottom: 20px" size="mini"
               >前培商品自带前培次数</el-button
             >