Selaa lähdekoodia

add:新需求增加以及优化

Tang 3 vuotta sitten
vanhempi
commit
87b228b88d

+ 141 - 39
src/views/Marketing/goods/commodityManageMent/add/index.vue

@@ -519,11 +519,53 @@
             ></el-input>
           </el-form-item>
           <el-form-item
-            label="学习有效期"
+            label="学习服务期"
             style="margin-top: 12px"
-            prop="studyTimeArrays"
+            :prop="
+              listData.serviceTimeType
+                ? listData.serviceTimeType === 4
+                  ? 'studyTimeArrays'
+                  : 'serviceTimeNum'
+                : 'serviceTimeType'
+            "
           >
+            <el-select
+              v-model="listData.serviceTimeType"
+              placeholder="请选择学习服务器类型"
+              @change="initServiceFun"
+            >
+              <el-option
+                v-for="(item, index) in styleType"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <span
+              v-if="
+                listData.serviceTimeType === 1 ||
+                listData.serviceTimeType === 2 ||
+                listData.serviceTimeType === 3
+              "
+              ><span style="margin: 0px 6px">购买那刻开始计算</span
+              ><el-input
+                class="timeInputSty"
+                v-model="listData.serviceTimeNum"
+              ></el-input
+              ><span style="margin-left: 6px">{{
+                listData.serviceTimeType === 1
+                  ? "年"
+                  : listData.serviceTimeType === 2
+                  ? "月"
+                  : listData.serviceTimeType === 3
+                  ? "天"
+                  : ""
+              }}</span></span
+            >
+
             <el-date-picker
+              v-if="listData.serviceTimeType === 4"
               v-model="listData.studyTimeArrays"
               type="datetimerange"
               value-format="timestamp"
@@ -532,8 +574,9 @@
               end-placeholder="结束日期"
               @change="changeDataTimeStudy(listData.studyTimeArrays)"
             >
-            </el-date-picker></el-form-item
-        ></el-form>
+            </el-date-picker
+          ></el-form-item>
+        </el-form>
       </div>
       <div v-if="listData.goodsType === 3">
         <h5 class="fengs">关联商品和补考次数</h5>
@@ -633,6 +676,7 @@
           </el-col>
         </el-row>
       </div>
+      <!-- 颁发证书 -->
       <div v-if="listData.goodsType === 1 || listData.goodsType === 2">
         <h5
           class="fengs"
@@ -760,6 +804,7 @@
         >上架</el-button
       >
     </div>
+    <!-- 费用类型 -->
     <el-dialog
       :visible.sync="dialogVisible"
       width="400px"
@@ -812,6 +857,7 @@
         >
       </span>
     </el-dialog>
+    <!-- 添加课程 -->
     <el-dialog
       @opened="prepareEnd"
       :visible.sync="dialogVisibleTableBoxs"
@@ -900,6 +946,7 @@
         >
       </span>
     </el-dialog>
+    <!-- 添加题卷 -->
     <el-dialog
       @opened="prepareEnd"
       :visible.sync="dialogVisibleTableBoxs2"
@@ -997,6 +1044,7 @@
         <el-button type="primary" @click="submitTab2">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 选择讲义 -->
     <el-dialog
       :visible.sync="aboutJYBox"
       width="400px"
@@ -1027,6 +1075,7 @@
         <el-button type="primary" @click="submitJYs">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 关联讲义列表 -->
     <el-dialog
       :visible.sync="jYactiveBoxs"
       width="880px"
@@ -1150,6 +1199,7 @@
         <el-button type="primary" @click="activejY">确 定</el-button>
       </span>
     </el-dialog>
+    <!-- 播放和拍照设置 -->
     <el-dialog
       :visible.sync="dialogPhoto"
       width="980px"
@@ -1282,6 +1332,7 @@
       :examConfigList="examConfigList"
       @uploadArrays="uploadArraysTK"
     />
+    <!-- 关联商品 -->
     <el-dialog
       :visible.sync="activeGoodsBoxs"
       width="750px"
@@ -1388,6 +1439,24 @@ export default {
       }
     };
     return {
+      styleType: [
+        {
+          label: "按年限",
+          value: 1,
+        },
+        {
+          label: "按月限",
+          value: 2,
+        },
+        {
+          label: "按天限",
+          value: 3,
+        },
+        {
+          label: "按具体时间区间",
+          value: 4,
+        },
+      ],
       disabledBtn: false,
       photoVideoList: {
         playConfig: {
@@ -1422,6 +1491,8 @@ export default {
         studyTimeArrays: [],
         timeArrays: [],
         studyCount: 1,
+        serviceTimeType: "",
+        serviceTimeNum: "",
       },
 
       eduTypeOptions: [], //教育类型数据
@@ -1623,6 +1694,31 @@ export default {
             trigger: ["blur", "change"],
           },
         ],
+        serviceTimeType: [
+          {
+            required: true,
+            message: "请选择学习服务期类型",
+            trigger: "change",
+          },
+        ],
+        serviceTimeNum: [
+          {
+            required: true,
+            message: "请输入非零正整数",
+            trigger: "blur",
+          },
+          {
+            validator(rule, value, callback) {
+              var reg = /^([1-9][0-9]*){1,3}$/;
+              if (reg.test(value)) {
+                callback();
+              } else {
+                callback(new Error("请输入非零正整数"));
+              }
+            },
+            trigger: "blur",
+          },
+        ],
         studyTimeArrays: [
           {
             required: true,
@@ -1963,6 +2059,13 @@ export default {
     this.getDict();
   },
   methods: {
+    /**
+     * 重置学习服务期时间值
+     */
+    initServiceFun() {
+      this.listData.serviceTimeNum = "";
+      this.listData.studyTimeArrays = [];
+    },
     judgeResult1(v) {
       if (
         Number(this.listData.lowestPrice) &&
@@ -1985,21 +2088,12 @@ export default {
     },
     changeTypes() {
       this.listData.studyCount = 1;
-      if (this.listData.goodsType === 3 || this.listData.goodsType === 4) {
-        this.listData.timeArrays = [
-          new Date().getTime(),
-          new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
-        ];
-      } else {
-        this.listData.timeArrays = [
-          new Date().getTime(),
-          new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
-        ];
-        this.listData.studyTimeArrays = [
-          new Date().getTime(),
-          new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
-        ];
-      }
+      this.listData.timeArrays = [
+        new Date().getTime(),
+        new Date().getTime() + 365 * 1 * 24 * 3600 * 1000,
+      ];
+      this.listData.serviceTimeType = "";
+      this.initServiceFun();
     },
     zhText(param) {
       const { columns, data } = param;
@@ -2451,29 +2545,31 @@ export default {
         datas.goodsStatus = 0;
       }
       if (datas.goodsType === 1 || datas.goodsType === 2) {
-        if (!datas.studyTimeArrays.length) {
-          this.$message.warning("请选择学习有效期");
-          this.disabledBtn = false;
-          return;
-        } else {
-          if (
-            this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
-            this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
-          ) {
-            this.$message.warning(
-              "商品有效期范围必须包含在学习有效期范围内,请重新调整"
-            );
+        if (datas.serviceTimeType === 4) {
+          if (!datas.studyTimeArrays.length) {
+            this.$message.warning("请选择学习有效期");
             this.disabledBtn = false;
             return;
+          } else {
+            if (
+              this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
+              this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
+            ) {
+              this.$message.warning(
+                "商品有效期范围必须包含在学习有效期范围内,请重新调整"
+              );
+              this.disabledBtn = false;
+              return;
+            }
+            datas.studyStartTime = this.$methodsTools.time10to13(
+              this.listData.studyTimeArrays[0],
+              1
+            );
+            datas.studyEndTime = this.$methodsTools.time10to13(
+              this.listData.studyTimeArrays[1],
+              1
+            );
           }
-          datas.studyStartTime = this.$methodsTools.time10to13(
-            this.listData.studyTimeArrays[0],
-            1
-          );
-          datas.studyEndTime = this.$methodsTools.time10to13(
-            this.listData.studyTimeArrays[1],
-            1
-          );
         }
       }
       this.courTypeOptions.map((item) => {
@@ -3237,6 +3333,12 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.timeInputSty {
+  width: 70px;
+  /deep/.el-input__inner {
+    text-align: center;
+  }
+}
 /deep/ .cenSty > .el-input__inner {
   text-align: center;
 }

+ 126 - 24
src/views/Marketing/goods/commodityManageMent/edit/index.vue

@@ -524,13 +524,55 @@
               v-model="listData.studyCount"
             ></el-input>
           </el-form-item>
+
           <el-form-item
-            label="学习有效期"
-            required
+            label="学习服务期"
             style="margin-top: 12px"
-            prop="studyTimeArrays"
+            :prop="
+              listData.serviceTimeType
+                ? listData.serviceTimeType === 4
+                  ? 'studyTimeArrays'
+                  : 'serviceTimeNum'
+                : 'serviceTimeType'
+            "
           >
+            <el-select
+              v-model="listData.serviceTimeType"
+              placeholder="请选择学习服务器类型"
+              @change="initServiceFun"
+            >
+              <el-option
+                v-for="(item, index) in styleType"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <span
+              v-if="
+                listData.serviceTimeType === 1 ||
+                listData.serviceTimeType === 2 ||
+                listData.serviceTimeType === 3
+              "
+              ><span style="margin: 0px 6px">购买那刻开始计算</span
+              ><el-input
+                class="timeInputSty"
+                v-model="listData.serviceTimeNum"
+              ></el-input
+              ><span style="margin-left: 6px">{{
+                listData.serviceTimeType === 1
+                  ? "年"
+                  : listData.serviceTimeType === 2
+                  ? "月"
+                  : listData.serviceTimeType === 3
+                  ? "天"
+                  : ""
+              }}</span></span
+            >
+
             <el-date-picker
+              v-if="listData.serviceTimeType === 4"
               v-model="listData.studyTimeArrays"
               type="datetimerange"
               value-format="timestamp"
@@ -539,7 +581,7 @@
               end-placeholder="结束日期"
               @change="changeDataTimeStudy(listData.studyTimeArrays)"
             >
-            </el-date-picker> </el-form-item
+            </el-date-picker></el-form-item
         ></el-form>
       </div>
       <div v-if="listData.goodsType === 3">
@@ -1403,6 +1445,24 @@ export default {
       }
     };
     return {
+      styleType: [
+        {
+          label: "按年限",
+          value: 1,
+        },
+        {
+          label: "按月限",
+          value: 2,
+        },
+        {
+          label: "按天限",
+          value: 3,
+        },
+        {
+          label: "按具体时间区间",
+          value: 4,
+        },
+      ],
       copyNums: "", //备份学习机会 - 用途在于 如果出现修改学习机会 不能小于当前值
       disabledBtn: false,
       photoVideoList: {
@@ -1435,6 +1495,8 @@ export default {
         certificateIds: [],
         makeGoodsId: "",
         timeArrays: [],
+        serviceTimeType: "",
+        serviceTimeNum: "",
       },
 
       eduTypeOptions: [], //教育类型数据
@@ -1651,6 +1713,31 @@ export default {
             trigger: ["blur", "change"],
           },
         ],
+        serviceTimeType: [
+          {
+            required: true,
+            message: "请选择学习服务期类型",
+            trigger: "change",
+          },
+        ],
+        serviceTimeNum: [
+          {
+            required: true,
+            message: "请输入非零正整数",
+            trigger: "blur",
+          },
+          {
+            validator(rule, value, callback) {
+              var reg = /^([1-9][0-9]*){1,3}$/;
+              if (reg.test(value)) {
+                callback();
+              } else {
+                callback(new Error("请输入非零正整数"));
+              }
+            },
+            trigger: "blur",
+          },
+        ],
         studyTimeArrays: [
           {
             required: true,
@@ -1970,6 +2057,13 @@ export default {
     this.getJyData();
   },
   methods: {
+    /**
+     * 重置学习服务期时间值
+     */
+    initServiceFun() {
+      this.listData.serviceTimeNum = "";
+      this.listData.studyTimeArrays = [];
+    },
     judgeResult1(v) {
       if (
         Number(this.listData.lowestPrice) &&
@@ -2658,29 +2752,31 @@ export default {
         }
       }
       if (datas.goodsType === 1 || datas.goodsType === 2) {
-        if (!datas.studyTimeArrays.length) {
-          this.$message.warning("请选择学习有效期");
-          this.disabledBtn = false;
-          return;
-        } else {
-          if (
-            this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
-            this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
-          ) {
-            this.$message.warning(
-              "商品有效期范围必须包含在学习有效期范围内,请重新调整"
-            );
+        if (datas.serviceTimeType === 4) {
+          if (!datas.studyTimeArrays.length) {
+            this.$message.warning("请选择学习有效期");
             this.disabledBtn = false;
             return;
+          } else {
+            if (
+              this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
+              this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
+            ) {
+              this.$message.warning(
+                "商品有效期范围必须包含在学习有效期范围内,请重新调整"
+              );
+              this.disabledBtn = false;
+              return;
+            }
+            datas.studyStartTime = this.$methodsTools.time10to13(
+              this.listData.studyTimeArrays[0],
+              1
+            );
+            datas.studyEndTime = this.$methodsTools.time10to13(
+              this.listData.studyTimeArrays[1],
+              1
+            );
           }
-          datas.studyStartTime = this.$methodsTools.time10to13(
-            this.listData.studyTimeArrays[0],
-            1
-          );
-          datas.studyEndTime = this.$methodsTools.time10to13(
-            this.listData.studyTimeArrays[1],
-            1
-          );
         }
       }
       this.courTypeOptions.map((item) => {
@@ -3464,6 +3560,12 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.timeInputSty {
+  width: 70px;
+  /deep/.el-input__inner {
+    text-align: center;
+  }
+}
 /deep/ .cenSty > .el-input__inner {
   text-align: center;
 }

+ 1 - 1
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -223,7 +223,7 @@ export default {
           hidden: true,
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           scope: "TimeLists",

+ 1 - 1
src/views/Marketing/goods/courseInquiryList/index.vue

@@ -254,7 +254,7 @@ export default {
           hidden: true,
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           scope: "TimeLists",

+ 1 - 1
src/views/Marketing/order/orderList/details/goodsManage.vue

@@ -320,7 +320,7 @@ export default {
           scope: "table",
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop: "studentTime",
           scope: "startEndTime",
         },

+ 1 - 1
src/views/education/classManageMent/classHours/index.vue

@@ -265,7 +265,7 @@ export default {
           width: "160px",
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           hidden: true,

+ 0 - 20
src/views/education/classManageMent/classList/addClass/index.vue

@@ -113,18 +113,6 @@
               @change="changeDataTimeStudy(listData.timeList)"
             >
             </el-date-picker>
-            <el-tooltip class="item" effect="dark" placement="right">
-              <div slot="content">
-                商品学习有效期:{{ $methodsTools.onlyForma(timeArrays[0]) }}
-                至
-                {{ $methodsTools.onlyForma(timeArrays[1]) }}
-              </div>
-              <i
-                style="margin-left: 10px; font-size: 20px; color: #e6a23c"
-                v-show="timeArrays.length"
-                class="el-icon-warning"
-              ></i>
-            </el-tooltip>
           </el-form-item>
           <el-form-item label="考期" prop="examineId">
             <el-select
@@ -515,14 +503,6 @@ export default {
     },
     changeDataTimeStudy(arr) {
       if (arr) {
-        if (
-          this.timeArrays &&
-          (parseInt(arr[0] / 1000) < this.timeArrays[0] ||
-            parseInt(arr[1] / 1000) > this.timeArrays[1])
-        ) {
-          this.$message.warning("超出商品学习有效期,请重新选择");
-          this.listData.timeList = [];
-        }
         if (arr[0] === arr[1]) {
           this.$message.warning("开始时间与结束时间不允许相同");
           this.listData.timeList = [];

+ 13 - 18
src/views/education/classManageMent/classList/manageClass/baseInfo.vue

@@ -24,19 +24,6 @@
                 <div>学时:{{ listData.goodsList[0].classHours }}</div>
                 <div>年份:{{ listData.goodsList[0].year }}</div>
                 <div>商品名称:{{ listData.goodsList[0].goodsName }}</div>
-                <div>
-                  学习有效期:{{
-                    $methodsTools.onlyForma(
-                      listData.goodsList[0].studyStartTime,
-                      false
-                    )
-                  }}-{{
-                    $methodsTools.onlyForma(
-                      listData.goodsList[0].studyEndTime,
-                      false
-                    )
-                  }}
-                </div>
               </div>
             </el-form-item>
           </el-col>
@@ -164,7 +151,7 @@
                 :disabled="classEndStatus"
               >
               </el-date-picker>
-              <el-tooltip class="item" effect="dark" placement="right">
+              <!-- <el-tooltip class="item" effect="dark" placement="right">
                 <div slot="content">
                   商品学习有效期:{{
                     $methodsTools.onlyForma(
@@ -181,7 +168,7 @@
                   v-show="timeArrays.length"
                   class="el-icon-warning"
                 ></i>
-              </el-tooltip>
+              </el-tooltip> -->
             </el-form-item>
             <el-form-item label="考期" prop="examineId">
               <el-select
@@ -255,7 +242,8 @@
                 <el-select
                   v-model="listData.interfacePushId"
                   placeholder="请选择官方信息推送"
-                  disabled
+                  :disabled="copyData.interfacePushId"
+                  clearable
                 >
                   <el-option
                     v-for="(item, index) in type1List"
@@ -270,7 +258,8 @@
                 <el-select
                   v-model="listData.interfacePeriodId"
                   placeholder="请选择官方学时推送"
-                  disabled
+                  :disabled="copyData.interfacePeriodId"
+                  clearable
                 >
                   <el-option
                     v-for="(item, index) in type3List"
@@ -285,7 +274,8 @@
                 <el-select
                   v-model="listData.interfaceAccountId"
                   placeholder="请选择官方学习账号开通"
-                  disabled
+                  :disabled="copyData.interfaceAccountId"
+                  clearable
                 >
                   <el-option
                     v-for="(item, index) in type2List"
@@ -332,6 +322,7 @@ import { mapGetters } from "vuex";
 export default {
   data() {
     return {
+      copyData:{},
       classStartStatus: false,
       classEndStatus: false,
       minNums: 0,
@@ -489,6 +480,7 @@ export default {
             ];
           }
           this.minNums = res.data.studentNum;
+          this.copyData = JSON.parse(JSON.stringify(res.data))
           this.listData = res.data;
         })
         .finally(() => {
@@ -585,6 +577,9 @@ export default {
       if (data.learningStatus === 3) {
         data.learningTimeStart = this.listData.learningTimeStart / 1000;
       }
+      if(!data.interfaceAccountId){
+        delete data.officialLearningUrl
+      }
       delete data.goodsList;
       this.$api.editGradegrade(data).then((res) => {
         this.$message.success("修改成功");

+ 1 - 1
src/views/education/classManageMent/learningHoursRecordList/index.vue

@@ -267,7 +267,7 @@ export default {
           hidden: true,
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           scope: "TimeLists",

+ 1 - 1
src/views/education/classManageMent/listOfhoursToBeReviewed/index.vue

@@ -187,7 +187,7 @@ export default {
           scope: "aTimeList",
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           hidden: true,

+ 1 - 1
src/views/education/classManageMent/studentMenu/index.vue

@@ -654,7 +654,7 @@ export default {
           scope: "statusPeriods",
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           hidden: true,

+ 1 - 1
src/views/education/studentManageMent/studentXQ/studyRecord.vue

@@ -271,7 +271,7 @@ export default {
           width: "140px",
         },
         {
-          label: "学习有效期",
+          label: "学习服务期",
           prop1: "studyStartTime",
           prop2: "studyEndTime",
           scope: "moreTime",