瀏覽代碼

add:新增关联班级弹窗及商品新增修改字段

Tang 3 年之前
父節點
當前提交
4d1cd8a9d3

+ 21 - 9
src/components/tableList.vue

@@ -235,6 +235,13 @@
                 : scope.row[item.prop].split(",").map(Number).length
             }}
           </span>
+          <span
+            v-else-if="item.scope === 'aboutClassNum'"
+            style="color: blue; cursor: pointer"
+            @click="openClassNumDio(scope.row['goodsId'],scope.row[item.prop])"
+          >
+            {{ scope.row[item.prop] }}
+          </span>
           <span
             v-else-if="item.scope === 'AjumpPeolpe'"
             class="editInfoSty"
@@ -920,10 +927,7 @@
           </span>
           <div v-else-if="item.scope === 'changeCLS'">
             <div
-              v-if="
-                !scope.row['interfacePushId'] &&
-                !scope.row['periodPlush']
-              "
+              v-if="!scope.row['interfacePushId'] && !scope.row['periodPlush']"
             >
               <div v-if="scope.row[item.prop] === 1" style="color: red">
                 有变更<span
@@ -990,11 +994,7 @@
             </template>
           </div>
           <div v-else-if="item.scope === 'rebuy'">
-            <span>{{
-              scope.row[item.prop] === 1
-                ? "是"
-                : ""
-            }}</span>
+            <span>{{ scope.row[item.prop] === 1 ? "是" : "" }}</span>
             <span
               v-if="scope.row[item.prop] === 1"
               style="margin-left: 6px; color: blue; cursor: pointer"
@@ -1743,6 +1743,18 @@ export default {
         return a.sort > b.sort ? -1 : 1;
       }
     },
+    /**
+     *
+     * @param {Number} id 商品ID
+     * @remards 关联班级数量触发事件
+     */
+    openClassNumDio(id, num) {
+      if(!num){
+        this.$message.warning("暂无关联班级")
+        return
+      }
+      this.$emit("openClassNum", id);
+    },
     /**
      * int: 1 节列表-关联章 2 章列表-关联模块 3 模块列表-关联课程 4 课程列表-关联商品 5 题目列表-关联试卷 6 试卷列表-关联商品 7 章卷列表-关联商品 8 模块列表-关联商品
      */

+ 60 - 0
src/views/Marketing/goods/commodityManageMent/add/index.vue

@@ -328,6 +328,9 @@
           <el-button type="primary" @click="openPZ" size="small"
             >播放和拍照设置</el-button
           >
+          <el-button type="primary" @click="openStyle" size="small"
+            >每天学习限制</el-button
+          >
           <el-button type="primary" @click="openJY" size="small"
             >关联讲义</el-button
           >
@@ -804,6 +807,35 @@
         >上架</el-button
       >
     </div>
+    <!-- 每天节学习数量 -->
+    <el-dialog
+      :visible.sync="everyDaySetBox"
+      width="300px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">关联讲义</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="everyDaySetBox = false"
+          />
+        </div>
+      </div>
+      每天最多学习<el-input
+        style="width: 60px"
+        size="mini"
+        v-model="everyDaystyleNum"
+      />节视频
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="everyDaySetBox = false">取 消</el-button>
+        <el-button type="primary" @click="submitEveryDayStyleNumData"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
     <!-- 费用类型 -->
     <el-dialog
       :visible.sync="dialogVisible"
@@ -1493,6 +1525,7 @@ export default {
         studyCount: 1,
         serviceTimeType: "",
         serviceTimeNum: "",
+        sectionMaxNum: "",
       },
 
       eduTypeOptions: [], //教育类型数据
@@ -2037,6 +2070,8 @@ export default {
       examConfigList: [],
       //   题库商品表格数据------------------------------------------------------------------------end
       copySetInfo: [], //备份
+      everyDaySetBox: false,
+      everyDaystyleNum: "",
     };
   },
   watch: {
@@ -2304,6 +2339,31 @@ export default {
       this.handoutsIdTable = this.templateRadio;
       this.jYactiveBoxs = false;
     },
+    /**
+     * 打开每天学习限制窗口
+     */
+    openStyle() {
+      this.everyDaystyleNum = this.listData.sectionMaxNum;
+      this.everyDaySetBox = true;
+    },
+    /**
+     * 提交每天学习限制
+     */
+    submitEveryDayStyleNumData() {
+      if (this.everyDaystyleNum) {
+        var ty = /^([1-9][0-9]*){1,3}$/;
+        if (ty.test(this.everyDaystyleNum)) {
+          this.listData.sectionMaxNum = this.everyDaystyleNum;
+          this.everyDaySetBox = false;
+        } else {
+          this.$message.warning("请输入非零正整数");
+          return;
+        }
+      } else {
+        this.listData.sectionMaxNum = "";
+        this.everyDaySetBox = false;
+      }
+    },
     getTemplateRow(index, row) {
       this.templateRadio = row.handoutsId;
     },

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

@@ -333,6 +333,9 @@
           <el-button type="primary" @click="openPZ" size="small"
             >播放和拍照设置</el-button
           >
+          <el-button type="primary" @click="openStyle" size="small"
+            >每天学习限制</el-button
+          >
           <el-button type="primary" @click="openJY" size="small"
             >关联讲义</el-button
           >
@@ -816,6 +819,35 @@
         }}</el-button
       >
     </div>
+    <!-- 每天节学习数量 -->
+    <el-dialog
+      :visible.sync="everyDaySetBox"
+      width="300px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">关联讲义</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="everyDaySetBox = false"
+          />
+        </div>
+      </div>
+      每天最多学习<el-input
+        style="width: 60px"
+        size="mini"
+        v-model="everyDaystyleNum"
+      />节视频
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="everyDaySetBox = false">取 消</el-button>
+        <el-button type="primary" @click="submitEveryDayStyleNumData"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
     <el-dialog
       :visible.sync="dialogVisible"
       width="400px"
@@ -2033,6 +2065,8 @@ export default {
       examConfigList: [],
       //   题库商品表格数据------------------------------------------------------------------------end
       noStudent: true,
+      everyDaySetBox: false,
+      everyDaystyleNum: "",
     };
   },
   created() {
@@ -2298,6 +2332,31 @@ export default {
       this.handoutsIdTable = this.templateRadio;
       this.jYactiveBoxs = false;
     },
+    /**
+     * 打开每天学习限制窗口
+     */
+    openStyle() {
+      this.everyDaystyleNum = this.listData.sectionMaxNum;
+      this.everyDaySetBox = true;
+    },
+    /**
+     * 提交每天学习限制
+     */
+    submitEveryDayStyleNumData() {
+      if (this.everyDaystyleNum) {
+        var ty = /^([1-9][0-9]*){1,3}$/;
+        if (ty.test(this.everyDaystyleNum)) {
+          this.listData.sectionMaxNum = this.everyDaystyleNum;
+          this.everyDaySetBox = false;
+        } else {
+          this.$message.warning("请输入非零正整数");
+          return;
+        }
+      } else {
+        this.listData.sectionMaxNum = "";
+        this.everyDaySetBox = false;
+      }
+    },
     getTemplateRow(index, row) {
       this.templateRadio = row.handoutsId;
     },

+ 106 - 0
src/views/Marketing/goods/courseInquiryList/classNumBox.vue

@@ -0,0 +1,106 @@
+<template>
+  <div id="classNumBox">
+    <el-table
+      v-loading="loading"
+      ref="multipleTable2"
+      :data="tableData"
+      border
+      :header-cell-style="{
+        'background-color': '#eee',
+        padding: '8px',
+        color: '#333',
+      }"
+    >
+      <el-table-column
+        v-for="(item, index) in tableSet"
+        :width="item.width"
+        :key="index"
+        :label="item.label"
+        align="center"
+        header-align="center"
+      >
+        <template slot-scope="scope">
+          <span v-if="item.scope === 'time'">{{
+            $methodsTools.onlyForma(scope.row[item.prop])
+          }}</span
+          ><span v-else>{{ scope.row[item.prop] }}</span></template
+        >
+      </el-table-column>
+    </el-table>
+    <pagination
+      :total="total"
+      :pageSize="formData.pageSize"
+      :currentPage="formData.pageNum"
+      @handleSizeChange="handleSizeChange"
+      @handleCurrentChange="handleCurrentChange"
+    />
+  </div>
+</template>
+
+<script>
+import pagination from "@/components/pagination";
+export default {
+  components: {
+    pagination,
+  },
+  data() {
+    return {
+      loading: false,
+      tableSet: [
+        {
+          label: "班级名称",
+          prop: "className",
+        },
+        {
+          label: "报名开始时间(班级有效期开始时间)",
+          prop: "classStartTime",
+          scope: "time",
+        },
+        {
+          label: "报名结束时间(班级有效期结束时间)",
+          prop: "classEndTime",
+          scope: "time",
+        },
+      ],
+      tableData: [],
+      formData: {
+        status: "0,1",
+        pageSize: 10,
+        pageNum: 1,
+      },
+      total: 0, //一共多少条
+    };
+  },
+  mounted() {
+    this.init();
+  },
+  methods: {
+    init() {
+      this.loading = true;
+      let data = JSON.parse(JSON.stringify(this.formData));
+      data.goodsId = this.$parent.$parent.goodsId;
+      this.$api
+        .inquireGradegradeList(data)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.init();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.init();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+</style>

+ 41 - 7
src/views/Marketing/goods/courseInquiryList/index.vue

@@ -13,6 +13,7 @@
       :tableData="tableData"
       :navText="navText"
       :loading="loading"
+      @openClassNum="openClassNum"
     >
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="msgInfo(props.scope.row)"
@@ -154,6 +155,28 @@
         <el-button @click="close">取 消</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      :visible.sync="classBox"
+      v-if="classBox"
+      width="1000px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">关联班级</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="classBox = false"
+          />
+        </div>
+      </div>
+      <class-num-box />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="classBox = false">取 消</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -161,10 +184,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
-import { login } from "../../../../api/login";
+import classNumBox from "./classNumBox";
 export default {
   name: "CourseInquiryList",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, classNumBox },
   data() {
     return {
       loading: false, //当前表单加载是否加载动画
@@ -222,11 +245,6 @@ export default {
           hidden: true,
           scope: "InfoMore",
         },
-        {
-          label: "专业",
-          prop: "categoryName",
-          hidden: true,
-        },
         {
           label: "商品编码",
           prop: "code",
@@ -253,6 +271,12 @@ export default {
           prop: "sectionNum",
           hidden: true,
         },
+        {
+          label: "关联班级数量",
+          prop: "gradeNum",
+          hidden: true,
+          scope: "aboutClassNum",
+        },
         {
           label: "学习服务期",
           prop1: "studyStartTime",
@@ -273,6 +297,8 @@ export default {
         "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
       uidzb: "egsxlptzdq",
       vidzb: "",
+      classBox: false,
+      goodsId: "",
     };
   },
   mounted() {
@@ -282,6 +308,14 @@ export default {
     this.search();
   },
   methods: {
+    /**
+     *
+     * @param {Number} id 商品ID
+     */
+    openClassNum(id) {
+      this.goodsId = id;
+      this.classBox = true;
+    },
     getTypeName(type) {
       let ast = "";
       switch (type) {