Prechádzať zdrojové kódy

Merge branch '03/03GRADE' into test

mo 3 rokov pred
rodič
commit
3970c025b8

+ 13 - 0
src/store/modules/permission.js

@@ -387,6 +387,19 @@ function setDetailRoute(accessedRoutes) {
           }
         },
         {
+          name: '网管课',
+          path: 'newPractice',
+          component: () => import('@/views/buildVip/index'),
+          hidden: true,
+          meta: {
+            noCache: '1',
+            title: '网管课申请',
+            belongTopMenu: "/business",
+            activeMenu: '/accompanyManager/accompany',
+            id: 'xx5'
+          }
+        },
+        {
           name: 'vip修改',
           path: 'vipReset',
           component: () => import('@/views/vipClass/vipReset'),

+ 1 - 1
src/views/accompanyManager/accompanyList.vue

@@ -643,7 +643,7 @@ export default {
     },
     newPractice() {
       this.$router.push({
-        path: "/business/buildVip",
+        path: "/business/newPractice",
         query:{courseType:'PRACTICE'}
       });
     },

+ 51 - 13
src/views/buildVip/index.vue

@@ -216,7 +216,7 @@
           <el-form-item label="每课时长" prop="classTime">
             <el-select
               v-model.trim="leftForm.classTime"
-              :disabled="timeTable.length > 0"
+              :disabled="timeTable.length > 0 || classTimeDis"
             >
               <el-option
                 v-for="(item, index) in this.classTimeList"
@@ -850,6 +850,7 @@ export default {
       courseTimeList: [],
       isMusicTheory: false,
       chioseStudent: [],
+      classTimeDis: false,
     };
   },
   computed: {
@@ -894,6 +895,23 @@ export default {
     //   this.$refs["leftForm"].resetFields();
     // }, 100);
     // 判断一下有没有缓存
+    this.$router.beforeEach(async (to, from, next) => {
+      if (this.leftForm?.classOrganId && from.path == "/business/buildVip") {
+        console.log(this.leftForm?.classOrganId);
+        this.$confirm("检测到您有未提交的数据, 离开将丢失该数据!", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          closeOnClickModal: false,
+          type: "warning",
+        })
+          .then(async () => {
+            next();
+          })
+          .catch((err) => {});
+      } else {
+        next();
+      }
+    });
     this.courseType = this.$route.query.courseType;
     if (this.courseType == "PRACTICE") {
       this.title = "网管课申请";
@@ -998,14 +1016,7 @@ export default {
     // }, 100);
     // this.init();
   },
-  async beforeDestroy() {
-    this.$confirm("检测到您有未提交的数据, 是否恢复?", "提示", {
-      confirmButtonText: "确定",
-      cancelButtonText: "取消",
-      closeOnClickModal: false,
-      type: "warning",
-    }).then(async () => {});
-  },
+  async beforeDestroy() {},
   methods: {
     resetFrom() {
       this.leftForm = {
@@ -1115,12 +1126,13 @@ export default {
       return {
         firstDayOfWeek: 1,
         disabledDate: (time) => {
-          if (self.leftForm.courseStart) {
+          if (self.leftForm.courseStart&&self.leftForm.courseEnd) {
             let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
+            let endDate = new Date(self.leftForm.courseEnd.replace(/-/, "/"));
             let nowDate = new Date();
-            let changeDate =
-              date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
-            return time.getTime() < changeDate.getTime();
+            let changeDate =date.getTime() - nowDate.getTime() > 0 ? date : nowDate;
+            let endChangeDate =  endDate.getTime() - nowDate.getTime() > 0 ? endDate : nowDate;
+            return time.getTime() < changeDate.getTime() || time.getTime() > endChangeDate.getTime();
           }
           return;
         },
@@ -1232,6 +1244,8 @@ export default {
       this.rightForm.onlineCourse = "";
       // this.rightForm.onlinePrice = '';
       // this.rightForm.offlinePrice = '';
+      this.centerForm.onlineCourseNum = 0;
+      this.centerForm.offlineCourseNum = 0;
       this.lookList = [];
       this.timeTable = [];
       this.attribute1 = "";
@@ -1249,11 +1263,13 @@ export default {
       this.rightForm.discount = 100;
 
       if (val) {
+        this.classTimeDis = true;
         for (let i in this.courseTypeList) {
           if (this.courseTypeList[i].id == this.leftForm.courseType) {
             // 学生人数
             this.leftForm.classNum = this.courseTypeList[i].studentNum;
             // 每课时长
+
             this.classTimeList =
               this.courseTypeList[i].singleClassMinutes.split(",");
             // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
@@ -1279,6 +1295,7 @@ export default {
             this.leftForm.courseStart = this.activeList[i].coursesStartTime;
             this.leftForm.courseEnd = this.activeList[i].coursesEndTime;
             this.rightForm.discount = this.activeList[i].discount;
+            this.leftForm.classTime = this.activeList[i].singleCourseTime;
             // 获取活动种类并保存
             this.hotType = this.activeList[i].type;
             // 获取买赠必要参数
@@ -1330,9 +1347,30 @@ export default {
           }
         }
       } else {
+        this.classTimeDis = false;
+        for (let i in this.courseTypeList) {
+          if (this.courseTypeList[i].id == this.leftForm.courseType) {
+            // 学生人数
+            this.leftForm.classNum = this.courseTypeList[i].studentNum;
+            // 每课时长
+            this.classTimeList =
+              this.courseTypeList[i].singleClassMinutes.split(",");
+            // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
+            this.leftForm.classTime = this.classTimeList[0];
+            // 线上课单节价格
+            this.rightForm.onlinePrice =
+              this.courseTypeList[i].onlineClassesUnitPrice;
+            // 线下课单节价格
+            this.rightForm.offlinePrice =
+              this.courseTypeList[i].offlineClassesUnitPrice;
+            this.rightForm.discount = this.courseTypeList[i].discount;
+          }
+        }
+        this.leftForm.classTime = null;
         if (this.courseType == "PRACTICE") {
           this.hasOffline = false;
           this.hasOnline = true;
+          this.classTimeList = [25];
         }
       }
       // 重置课程单价

+ 3 - 2
src/views/categroyManager/modals/salaryInfo.vue

@@ -15,6 +15,7 @@
       label-width="150px"
       label-position="right"
       :inline="true"
+      ref="salaryForm"
     >
       <el-row v-if="payForm.courseType == 'VIP'">
         <el-form-item
@@ -82,7 +83,7 @@
         <el-form-item
           label="自定义课时课酬"
            :rules="[{required: true, message: '请输入自定义课时课酬'}]"
-          prop="applyToStudentType"
+          prop="vipOfflineSalarySettlement.settlementValue"
           v-if="
             salaryForm.vipOfflineSalarySettlement.salarySettlementType ==
             'FIXED_SALARY'&&courseTeachModeOffline
@@ -124,7 +125,7 @@
         <el-form-item
          :rules="[{required: true, message: '请输入自定义课时课酬'}]"
           label="自定义课时课酬"
-          prop="applyToStudentType"
+          prop="practiceSalarySettlement.settlementValue"
           v-if="
             salaryForm.practiceSalarySettlement.salarySettlementType ==
             'FIXED_SALARY'&&payForm.courseType == 'PRACTICE'

+ 24 - 16
src/views/categroyManager/vipNewActive.vue

@@ -36,6 +36,7 @@
         :isDisabled="isDisabled || statuss != 'DRAFT'"
       />
       <salaryInfo
+        ref="salaryInfo"
         :salaryForm="salaryForm"
         v-if="active == 3"
         :activeType="baseForm.activityType"
@@ -98,7 +99,7 @@ import {
 import cleanDeep from "clean-deep";
 const payBaseForm = {
   courseType: "",
-  vipGroupCategoryIdList: '',
+  vipGroupCategoryIdList: "",
   applyToStudentType: [],
   teachMode: null,
   allowOnlineToOffline: "",
@@ -185,9 +186,9 @@ export default {
       this.baseForm.id = this.$route.query.id;
       const rusult = await getVipGroupActivity({ id: this.$route.query.id });
       this.formatDetail(rusult.data);
-    }else{
-      this.payInfo = {...payBaseForm}
-      this.salaryForm = {...baseSalaryForm}
+    } else {
+      this.payInfo = { ...payBaseForm };
+      this.salaryForm = { ...baseSalaryForm };
     }
   },
   methods: {
@@ -237,14 +238,14 @@ export default {
     changeCourseType(val) {
       // this.$emit("changeCourseType", val);
       if (val == "PRACTICE") {
-        this.$set(this.payForm, "vipGroupCategoryIdList", '');
+        this.$set(this.payForm, "vipGroupCategoryIdList", "");
         this.$set(this.payForm, "teachMode", "");
         this.$set(this.payForm, "singleCourseTime", 25);
         this.$set(this.payForm, "allowOnlineToOffline", []);
       } else {
         this.$set(this.payForm, "singleCourseTime", 45);
         this.$set(this.payForm, "allowOnlineToOffline", []);
-        this.$set(this.payForm, "vipGroupCategoryIdList", '');
+        this.$set(this.payForm, "vipGroupCategoryIdList", "");
         this.$set(this.payForm, "teachMode", "");
       }
       // vip
@@ -272,9 +273,13 @@ export default {
       this.salaryForm = { ...baseSalaryForm };
       this.$forceUpdate();
     },
-    submit() {
-      this.baseForm.status = "PROGRESS";
-      this.submitDataFormat("PROGRESS");
+    async submit() {
+      this.$refs.salaryInfo.$refs.salaryForm.validate((flag) => {
+        if (flag) {
+          this.baseForm.status = "PROGRESS";
+          this.submitDataFormat("PROGRESS");
+        }
+      });
     },
     save() {
       this.baseForm.status = "DRAFT";
@@ -294,7 +299,9 @@ export default {
         endTime = this.baseForm.activeTime[1];
       }
       let organId = this.baseForm.organ.join(",");
-      this.baseForm.studentMaxUsedTimes?this.baseForm.studentMaxUsedTimes:this.baseForm.studentMaxUsedTimes=-1
+      this.baseForm.studentMaxUsedTimes
+        ? this.baseForm.studentMaxUsedTimes
+        : (this.baseForm.studentMaxUsedTimes = -1);
       for (let item in this.salaryForm) {
         if (this.salaryForm[item].salarySettlementType == "TEACHER_DEFAULT") {
           this.salaryForm[item].settlementValue = null;
@@ -326,7 +333,7 @@ export default {
                   id: res.data.id,
                 }),
               });
-              this.formatDetail(res.data)
+              this.formatDetail(res.data);
             } else {
               localStorage.removeItem("newVip");
               localStorage.removeItem(`newPractice`);
@@ -411,11 +418,11 @@ export default {
       //     }),)
       this.payForm = {
         courseType: data.courseType,
-        vipGroupCategoryIdList: data.vipGroupCategoryIdList?data.vipGroupCategoryIdList
-          .split(",")
-          .map((id) => {
-            return Number(id);
-          })[0]:null,
+        vipGroupCategoryIdList: data.vipGroupCategoryIdList
+          ? data.vipGroupCategoryIdList.split(",").map((id) => {
+              return Number(id);
+            })[0]
+          : null,
         teachMode: data.teachMode + "",
         allowOnlineToOffline: data.allowOnlineToOffline + "",
         singleCourseTime: data.singleCourseTime,
@@ -434,6 +441,7 @@ export default {
         giveCourseNum: data.giveCourseNum,
         giveMemberRankId: data.giveMemberRankId,
         givePeriod: data.givePeriodEnum,
+        giveMemberTime: data.giveMemberTime ? data.giveMemberTime : null,
       };
       // 格式化缴费金额
       if (data.salarySettlementJson && data.salarySettlementJson != "null") {

+ 1 - 1
src/views/vipClass/vipList.vue

@@ -344,7 +344,7 @@
                   >修改</el-button
                 >
                 <el-button type='text'  v-if="
-                    scope.row.vipGroupActivityId <=0 &&
+                    scope.row.vipGroupCategoryName =='乐理课' &&
                     permission('vipGroupManage/update')&&scope.row.status==1" @click="isStartCourse(scope.row)">确认成课</el-button>
               </div>
             </template>