Browse Source

修改活动

lex 1 year ago
parent
commit
e98c219d72

+ 175 - 144
src/views/buildVip/index.vue

@@ -181,7 +181,7 @@
               clearable
               :disabled="
                 !leftForm.students ||
-                (leftForm.students && leftForm.students.length <= 0)
+                  (leftForm.students && leftForm.students.length <= 0)
               "
               @change="chioseActive"
             >
@@ -200,8 +200,8 @@
               clearable
               :disabled="
                 !leftForm.courseType ||
-                !leftForm.students ||
-                (leftForm.students && leftForm.students.length <= 0)
+                  !leftForm.students ||
+                  (leftForm.students && leftForm.students.length <= 0)
               "
               @change="chioseActive"
             >
@@ -307,7 +307,9 @@
               @input="onCourseNumChange('online')"
               type="number"
             >
-              <template slot="append">节</template>
+              <template slot="append"
+                >节</template
+              >
             </el-input>
           </el-form-item>
           <el-form-item v-if="hasOffline" label="线下课数">
@@ -317,13 +319,17 @@
               @input="onCourseNumChange('offline')"
               type="number"
             >
-              <template slot="append">节</template>
+              <template slot="append"
+                >节</template
+              >
             </el-input>
           </el-form-item>
 
           <el-form-item label="待排课数">
             <el-input v-model.trim="allCourseCount" disabled>
-              <template slot="append">节</template>
+              <template slot="append"
+                >节</template
+              >
             </el-input>
           </el-form-item>
           <!-- <el-form-item
@@ -418,20 +424,30 @@
         >
           <el-form-item label="折扣">
             <el-input v-model.trim="rightForm.discount" disabled>
-              <template slot="append">%</template>
+              <template slot="append"
+                >%</template
+              >
             </el-input>
           </el-form-item>
           <el-form-item v-if="courseType == 'PRACTICE'" label="网管课酬">
             <el-input v-model.trim="rightForm.onlineCourse" :disabled="true">
-              <template slot="append" v-if="!isMusicTheory">元/节</template>
-              <template slot="append" v-else>元/人</template>
+              <template slot="append" v-if="!isMusicTheory"
+                >元/节</template
+              >
+              <template slot="append" v-else
+                >元/人</template
+              >
             </el-input>
             <!--  || onlineSalary!='TEACHER_DEFAULT' salaryReadonlyFlag==0 -->
           </el-form-item>
           <el-form-item v-else label="VIP课课酬">
             <el-input v-model.trim="rightForm.offlineCourse" :disabled="true">
-              <template slot="append" v-if="!isMusicTheory">元/节</template>
-              <template slot="append" v-else>元/人</template>
+              <template slot="append" v-if="!isMusicTheory"
+                >元/节</template
+              >
+              <template slot="append" v-else
+                >元/人</template
+              >
             </el-input>
             <!--  || offlineSalary!='TEACHER_DEFAULT' salaryReadonlyFlag==0 -->
           </el-form-item>
@@ -463,7 +479,7 @@
             <el-table-column
               align="center"
               prop="studentId"
-              v-if="hasOnline"
+              v-if="hasOnline && !fixedCourseNumFlag"
               label="线上课单价"
             >
               <template slot-scope="scope">
@@ -482,7 +498,7 @@
             <el-table-column
               align="center"
               prop="studentId"
-              v-if="hasOffline"
+              v-if="hasOffline && !fixedCourseNumFlag"
               label="线下课单价"
             >
               <template slot-scope="scope">
@@ -628,7 +644,7 @@
             :picker-options="{
               start: '04:30',
               step: '00:05',
-              end: '23:30',
+              end: '23:30'
             }"
             placeholder="选择时间"
           />
@@ -676,7 +692,7 @@ import {
   getSubject,
   getPracticeApplySubjects,
   getOrganRole,
-  getAgreement,
+  getAgreement
 } from "@/api/buildTeam";
 import {
   vipGroupCategory,
@@ -687,7 +703,7 @@ import {
   getPracticeGroupCostCount,
   createPractice,
   getPracticeGroupSellPrice,
-  getOnlineMun,
+  getOnlineMun
 } from "@/api/vipSeting";
 import { getTeachSchool, getTeacherBySubject } from "@/api/teacherManager";
 import axios from "axios";
@@ -724,7 +740,7 @@ export default {
         educationalTeacherId: "",
         students: [],
 
-        classOrganId: "", // 课程分部
+        classOrganId: "" // 课程分部
       },
       activeStudentList: [],
       studentLimit: 0,
@@ -733,13 +749,13 @@ export default {
         allCourseNum: "",
         onlineCourseNum: 0,
         offlineCourseNum: 0,
-        radio: "",
+        radio: ""
       },
       maskForm: {
         type: "",
         week: "",
         startTime: "",
-        endTime: "",
+        endTime: ""
       },
       rightForm: {
         onlineCourse: "",
@@ -747,7 +763,7 @@ export default {
         onlinePrice: "",
         offlinePrice: "",
         allPrice: "",
-        discount: 100,
+        discount: 100
       },
       remoteLoading: false,
       computationalBtn: false,
@@ -765,6 +781,7 @@ export default {
       attribute1: "",
       attribute2: "",
       attribute3: "",
+      fixedCourseNumFlag: null,
       maxCourseNum: 0,
       minCourseNum: 0,
       salaryReadonlyFlag: "", // 老师课酬是否可配
@@ -782,7 +799,7 @@ export default {
         "星期三",
         "星期四",
         "星期五",
-        "星期六",
+        "星期六"
       ],
       scetionList: [],
       isGiveClass: false,
@@ -801,50 +818,50 @@ export default {
           {
             required: true,
             message: "请输入名称",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         teacher: [
           {
             required: true,
             message: "请选择老师",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         educationalTeacherId: [
           {
             required: true,
             message: "请选择乐团主管",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         classOrganId: [
           {
             required: true,
             message: "请选择课程分部",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         subject: [
           {
             required: true,
             message: "请选择科目",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         courseType: [
           {
             required: true,
             message: "请选择课程形式",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         students: [
           {
             required: true,
             message: "请选择上课学生",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         // activeType: [
         //   {
@@ -857,23 +874,23 @@ export default {
           {
             required: true,
             message: "请选择报名开始时间",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         signUpEnd: [
           {
             required: true,
             message: "请选择报名结束时间",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         classTime: [
           {
             required: true,
             message: "请选择报每课时长",
-            trigger: "change",
-          },
-        ],
+            trigger: "change"
+          }
+        ]
       },
       id: "",
       studentList: [],
@@ -883,7 +900,7 @@ export default {
       classTimeDis: false,
       studentRuleNum: 0,
       isFirst: false,
-      submitList:[]
+      submitList: []
     };
   },
   computed: {
@@ -913,7 +930,7 @@ export default {
       //   return parseInt(offline) + parseInt(online) + "+" + giveNum || "";
       // }
       return parseInt(offline) + parseInt(online) || "";
-    },
+    }
   },
   created() {
     // this.init();
@@ -955,12 +972,12 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         closeOnClickModal: false,
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           next();
         })
-        .catch((err) => {});
+        .catch(err => {});
     } else {
       next();
     }
@@ -986,7 +1003,7 @@ export default {
         educationalTeacherId: "",
         students: [],
 
-        classOrganId: "", // 课程分部
+        classOrganId: "" // 课程分部
       };
       this.activeStudentList = [];
       this.studentLimit = 0;
@@ -995,13 +1012,13 @@ export default {
         allCourseNum: "",
         onlineCourseNum: 0,
         offlineCourseNum: 0,
-        radio: "",
+        radio: ""
       };
       this.maskForm = {
         type: "",
         week: "",
         startTime: "",
-        endTime: "",
+        endTime: ""
       };
       this.rightForm = {
         onlineCourse: "",
@@ -1009,7 +1026,7 @@ export default {
         onlinePrice: "",
         offlinePrice: "",
         allPrice: "",
-        discount: 100,
+        discount: 100
       };
       this.hasOnline = true;
       this.hasOffline = true;
@@ -1019,6 +1036,7 @@ export default {
       this.attribute1 = "";
       this.attribute2 = "";
       this.attribute3 = "";
+      this.fixedCourseNumFlag = null;
       this.maxCourseNum = 0;
       this.minCourseNum = 0;
       this.salaryReadonlyFlag = ""; // 老师课酬是否可配
@@ -1036,7 +1054,7 @@ export default {
       try {
         const res = await getAgreement();
         if (!res.data) {
-           this.submitList.push("agreement");
+          this.submitList.push("agreement");
           // this.$bus.$emit("showguide", ["agreement"]);
         }
       } catch (e) {}
@@ -1056,26 +1074,26 @@ export default {
         this.searchForm = this.$route.query.searchForm;
       }
       // 获取所有科目的接口
-     this.submitList =[]
+      this.submitList = [];
       await this.$store.dispatch("setBranchs");
       await this.getAgreement();
       if (this.selects.branchs.length <= 0) {
-        submitList.push("organ")
+        submitList.push("organ");
         // this.$bus.$emit("showguide", ["organ"]);
       }
-       if (this.submitList.length > 0) {
+      if (this.submitList.length > 0) {
         this.$bus.$emit("showguide", this.submitList);
       }
       if (this.courseType == "PRACTICE") {
-        getPracticeApplySubjects().then((res) => {
+        getPracticeApplySubjects().then(res => {
           if (res.code == 200) {
             this.subjectList = res.data;
           }
         });
       } else {
         getSubject({
-          tenantId: 1,
-        }).then((res) => {
+          tenantId: 1
+        }).then(res => {
           if (res.code == 200) {
             this.subjectList = res.data;
           }
@@ -1119,7 +1137,7 @@ export default {
       let self = this;
       return {
         firstDayOfWeek: 1,
-        disabledDate: (time) => {
+        disabledDate: time => {
           if (self.leftForm.courseStart && self.leftForm.courseEnd) {
             let date = new Date(self.leftForm.courseStart.replace(/-/, "/"));
             let endDate = new Date(self.leftForm.courseEnd.replace(/-/, "/"));
@@ -1134,7 +1152,7 @@ export default {
             );
           }
           return;
-        },
+        }
       };
     },
     beginDate() {
@@ -1143,7 +1161,7 @@ export default {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime(); //开始时间不选时,结束时间最大值小于等于当天
-        },
+        }
       };
     },
 
@@ -1161,7 +1179,7 @@ export default {
             return time.getTime() > Date.now();
             //开始时间不选时,结束时间最大值小于等于当天
           }
-        },
+        }
       };
     },
     changeSubject(val) {
@@ -1171,8 +1189,8 @@ export default {
       // 根据科目id获取相应的老师
       findTeacherByOrganId({
         subjectIds: val,
-        organId: this.leftForm.classOrganId,
-      }).then((res) => {
+        organId: this.leftForm.classOrganId
+      }).then(res => {
         if (res.code == 200) {
           this.teacherList = res.data;
           if (this.teacherList.length <= 0) {
@@ -1205,16 +1223,19 @@ export default {
           this.leftForm.classNum = this.courseTypeList[i].studentNum;
           this.studentLimit = this.courseTypeList[i].studentNum;
           // 每课时长
-          this.classTimeList =
-            this.courseTypeList[i].singleClassMinutes.split(",");
+          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.onlinePrice = this.courseTypeList[
+            i
+          ].onlineClassesUnitPrice;
           // 线下课单节价格
-          this.rightForm.offlinePrice =
-            this.courseTypeList[i].offlineClassesUnitPrice;
+          this.rightForm.offlinePrice = this.courseTypeList[
+            i
+          ].offlineClassesUnitPrice;
 
           if (
             this.rightForm.onlinePrice <= 0 ||
@@ -1227,7 +1248,7 @@ export default {
         }
       }
       this.activeStudentList = [];
-      this.studentList.forEach((stu) => {
+      this.studentList.forEach(stu => {
         if (
           Array.isArray(this.chioseStudent)
             ? this.chioseStudent.indexOf(stu.userId) != -1
@@ -1241,7 +1262,7 @@ export default {
             userName: stu.username,
             onlineClassesUnitPrice: this.rightForm.onlinePrice,
             offlineClassesUnitPrice: this.rightForm.offlinePrice,
-            paymentPrice: "",
+            paymentPrice: ""
           });
         }
       });
@@ -1260,6 +1281,7 @@ export default {
       this.attribute1 = "";
       this.attribute2 = "";
       this.attribute3 = "";
+      this.fixedCourseNumFlag = null; // 是否限制课时数
       this.rightForm.discount = 100;
       this.giveNum = 0;
       this.isGiveClass = false;
@@ -1278,16 +1300,19 @@ export default {
             this.leftForm.classNum = this.courseTypeList[i].studentNum;
             // 每课时长
 
-            this.classTimeList =
-              this.courseTypeList[i].singleClassMinutes.split(",");
+            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.onlinePrice = this.courseTypeList[
+              i
+            ].onlineClassesUnitPrice;
             // 线下课单节价格
-            this.rightForm.offlinePrice =
-              this.courseTypeList[i].offlineClassesUnitPrice;
+            this.rightForm.offlinePrice = this.courseTypeList[
+              i
+            ].offlineClassesUnitPrice;
             this.rightForm.discount = this.courseTypeList[i].discount;
           }
         }
@@ -1310,6 +1335,9 @@ export default {
             this.attribute1 = this.activeList[i].attribute1;
             this.attribute2 = this.activeList[i].attribute2;
             this.attribute3 = this.activeList[i].attribute3;
+
+            // 固定课酬作用
+            this.fixedCourseNumFlag = this.activeList[i].fixedCourseNumFlag;
             // 存储课酬是否可配置
             this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag;
             this.paymentReadonlyFlag = this.activeList[i].paymentReadonlyFlag;
@@ -1328,7 +1356,7 @@ export default {
 
             this.activeStudentList = [];
 
-            this.studentList.forEach((stu) => {
+            this.studentList.forEach(stu => {
               if (
                 Array.isArray(this.chioseStudent)
                   ? this.chioseStudent.indexOf(stu.userId) != -1
@@ -1342,7 +1370,7 @@ export default {
                   userName: stu.username,
                   onlineClassesUnitPrice: this.rightForm.onlinePrice,
                   offlineClassesUnitPrice: this.rightForm.offlinePrice,
-                  paymentPrice: "",
+                  paymentPrice: ""
                 });
               }
             });
@@ -1355,16 +1383,19 @@ export default {
             // 学生人数
             this.leftForm.classNum = this.courseTypeList[i].studentNum;
             // 每课时长
-            this.classTimeList =
-              this.courseTypeList[i].singleClassMinutes.split(",");
+            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.onlinePrice = this.courseTypeList[
+              i
+            ].onlineClassesUnitPrice;
             // 线下课单节价格
-            this.rightForm.offlinePrice =
-              this.courseTypeList[i].offlineClassesUnitPrice;
+            this.rightForm.offlinePrice = this.courseTypeList[
+              i
+            ].offlineClassesUnitPrice;
             this.rightForm.discount = this.courseTypeList[i].discount;
           }
         }
@@ -1439,7 +1470,7 @@ export default {
             startTime: startTime,
             endTime: endTime,
             time: startTime + "-" + endTime,
-            id: Date.now(),
+            id: Date.now()
           });
         } else {
           this.$message.error("该时间段已排课请重选时间");
@@ -1453,7 +1484,7 @@ export default {
           startTime: startTime,
           endTime: endTime,
           time: startTime + "-" + endTime,
-          id: Date.now(),
+          id: Date.now()
         });
       }
       // let courseType = this.maskForm.type;
@@ -1566,13 +1597,13 @@ export default {
         if (this.lookList[i].type == "线上课") {
           onlineList.push({
             week: this.lookList[i].weekDay,
-            date: this.lookList[i],
+            date: this.lookList[i]
           });
         }
         if (this.lookList[i].type == "线下课") {
           offlineList.push({
             week: this.lookList[i].weekDay,
-            date: this.lookList[i],
+            date: this.lookList[i]
           });
         }
       }
@@ -1605,7 +1636,7 @@ export default {
             actualTeacherId: this.leftForm.teacher,
             startClassTimeStr: onlineList[i].date.startTime,
             endClassTimeStr: onlineList[i].date.endTime,
-            teachMode: "ONLINE",
+            teachMode: "ONLINE"
           });
           online--;
           if (online == 0) break;
@@ -1631,7 +1662,7 @@ export default {
             actualTeacherId: this.leftForm.teacher,
             startClassTimeStr: offlineList[i].date.startTime,
             endClassTimeStr: offlineList[i].date.endTime,
-            teachMode: "OFFLINE",
+            teachMode: "OFFLINE"
           });
           offline--;
           if (offline == 0) break;
@@ -1710,7 +1741,7 @@ export default {
       let onlineTeacherSalary = this.rightForm.onlineCourse || null;
       let offlineTeacherSalary = this.rightForm.offlineCourse || null;
       let studentId = this.activeStudentList
-        .map((stu) => {
+        .map(stu => {
           return stu.studentId;
         })
         .join(",");
@@ -1728,13 +1759,13 @@ export default {
           giveTeachMode,
           singleClassMinutes,
           organId: this.leftForm?.classOrganId,
-          studentId,
-        }).then((res) => {
+          studentId
+        }).then(res => {
           if (res.code == 200) {
             this.rightForm.onlineCourse = res.data.onlineTeacherSalary;
             this.rightForm.offlineCourse = res.data.offlineTeacherSalary;
             this.rightForm.allPrice = res.data.totalPrice;
-            this.activeStudentList.forEach((stu) => {
+            this.activeStudentList.forEach(stu => {
               stu.paymentPrice = res.data.totalPrice;
             });
           }
@@ -1753,13 +1784,13 @@ export default {
           studentIdList: userId,
           giveTeachMode,
           singleClassMinutes,
-          studentIdList: studentId,
-        }).then((res) => {
+          studentIdList: studentId
+        }).then(res => {
           if (res.code == 200) {
             this.rightForm.onlineCourse = res.data.onlineTeacherSalary;
             this.rightForm.offlineCourse = res.data.offlineTeacherSalary;
             this.rightForm.allPrice = res.data.totalPrice;
-            this.activeStudentList.forEach((stu) => {
+            this.activeStudentList.forEach(stu => {
               stu.paymentPrice = res.data.totalPrice;
             });
           }
@@ -1863,7 +1894,7 @@ export default {
           educationalTeacherId: this.leftForm.educationalTeacherId,
           organId: this.leftForm.classOrganId,
           firstStudentId: this.leftForm.students[0] || null,
-          allCourseNum: online,
+          allCourseNum: online
         };
       } else {
         studentIdList = this.leftForm.students.join(",") || null;
@@ -1891,12 +1922,12 @@ export default {
           subjectIdList: this.leftForm.subject,
           educationalTeacherId: this.leftForm.educationalTeacherId,
           organId: this.leftForm.classOrganId,
-          firstStudentId: this.leftForm.students[0] || null,
+          firstStudentId: this.leftForm.students[0] || null
         };
       }
 
       if (this.courseType == "PRACTICE") {
-        createPractice(obj).then((res) => {
+        createPractice(obj).then(res => {
           if (res.code == 200) {
             this.resetFrom();
             if (res.data == "ING") {
@@ -1905,7 +1936,7 @@ export default {
                 "提示",
                 {
                   confirmButtonText: "确定",
-                  type: "warning",
+                  type: "warning"
                 }
               ).then(() => {
                 this.$message.success("提交成功");
@@ -1914,8 +1945,8 @@ export default {
                   path: "/vipManager/vipList",
                   query: {
                     rules: this.rules,
-                    searchForm: this.searchForm,
-                  },
+                    searchForm: this.searchForm
+                  }
                 });
               });
             } else {
@@ -1926,10 +1957,10 @@ export default {
           if (res.code == 206) {
             this.$confirm(res.msg, "提示", {
               confirmButtonText: "确定",
-              type: "warning",
+              type: "warning"
             }).then(() => {
               obj.allowOverstepActivityStudentNum = 1;
-              createPractice(obj).then((res) => {
+              createPractice(obj).then(res => {
                 if (res.code == 200) {
                   this.resetFrom();
                   this.$message.success("提交成功");
@@ -1941,7 +1972,7 @@ export default {
         });
       } else {
         // 新增
-        createVip(obj).then((res) => {
+        createVip(obj).then(res => {
           if (res.code == 200) {
             this.resetFrom();
             if (res.data == "ING") {
@@ -1950,7 +1981,7 @@ export default {
                 "提示",
                 {
                   confirmButtonText: "确定",
-                  type: "warning",
+                  type: "warning"
                 }
               ).then(() => {
                 this.$message.success("提交成功");
@@ -1959,8 +1990,8 @@ export default {
                   path: "/vipManager/vipList",
                   query: {
                     rules: this.rules,
-                    searchForm: this.searchForm,
-                  },
+                    searchForm: this.searchForm
+                  }
                 });
               });
             } else {
@@ -1970,18 +2001,18 @@ export default {
                 path: "/vipManager/vipList",
                 query: {
                   rules: this.rules,
-                  searchForm: this.searchForm,
-                },
+                  searchForm: this.searchForm
+                }
               });
             }
           }
           if (res.code == 206) {
             this.$confirm(res.msg, "提示", {
               confirmButtonText: "确定",
-              type: "warning",
+              type: "warning"
             }).then(() => {
               obj.allowOverstepActivityStudentNum = 1;
-              createVip(obj).then((res) => {
+              createVip(obj).then(res => {
                 if (res.code == 200) {
                   this.resetFrom();
                   this.$message.success("提交成功");
@@ -1990,8 +2021,8 @@ export default {
                     path: "/vipManager/vipList",
                     query: {
                       rules: this.rules,
-                      searchForm: this.searchForm,
-                    },
+                      searchForm: this.searchForm
+                    }
                   });
                 }
               });
@@ -2008,8 +2039,8 @@ export default {
       // this.leftForm.courseType = "";
       if (val) {
         getTeachSchool({
-          userId: val,
-        }).then((res) => {
+          userId: val
+        }).then(res => {
           if (res.code == 200) {
             this.scetionList = res.data;
             //         if(this.scetionList.length <=0){
@@ -2085,8 +2116,8 @@ export default {
       if (val) {
         this.getOrganStudentList(val);
         vipGroupCategory({
-          organId: val,
-        }).then((res) => {
+          organId: val
+        }).then(res => {
           if (res.code == 200) {
             this.courseTypeList = res.data;
           }
@@ -2094,7 +2125,7 @@ export default {
         // 获取乐团主管
         try {
           const ruselt = await getOrganRole({
-            id: val,
+            id: val
           });
           this.educationList = ruselt?.data?.EDUCATION;
           if (!this.educationList || this.educationList.length <= 0) {
@@ -2107,7 +2138,7 @@ export default {
         // 乐团主管
         // 如果是网管课 则获取网管课单价
         if (this.courseType == "PRACTICE") {
-          getPracticeGroupSellPrice({ organId: val }).then((res) => {
+          getPracticeGroupSellPrice({ organId: val }).then(res => {
             if (res.code == 200) {
               this.rightForm.onlinePrice = res.data.singleClassMinutesPrice;
             }
@@ -2119,12 +2150,12 @@ export default {
       if (this.courseType) {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
-          path: "/accompanyManager/accompany",
+          path: "/accompanyManager/accompany"
         });
       } else {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
-          path: "/vipManager/vipList",
+          path: "/vipManager/vipList"
         });
       }
     },
@@ -2138,7 +2169,7 @@ export default {
       //   return;
       // }
 
-      this.$refs["leftForm"].validate((vali) => {
+      this.$refs["leftForm"].validate(vali => {
         if (vali) {
           let centerForm = this.centerForm;
           if (this.maxCourseNum > 0 && this.minCourseNum > 0) {
@@ -2203,8 +2234,8 @@ export default {
       if (organId) {
         queryOrganStudentList({
           rows: 50,
-          organId: organId,
-        }).then((res) => {
+          organId: organId
+        }).then(res => {
           if (res.code == 200) {
             this.studentList = res.data.rows;
           }
@@ -2220,24 +2251,24 @@ export default {
           method: "get",
           headers: {
             Authorization: getToken(),
-            tenantId: getTenantId(),
+            tenantId: getTenantId()
           },
           params: {
             rows: 9999,
             search: query,
-            organId: this.leftForm.classOrganId,
+            organId: this.leftForm.classOrganId
           },
-          url,
+          url
         };
         this.remoteLoading = true;
         // this.studentList = []
-        axios(options).then((res) => {
+        axios(options).then(res => {
           this.remoteLoading = false;
           let result = res.data;
           if (result.code == 200) {
             // Array.prototype.splice.apply(this.studentList, result.data.rows);
             if (result.data.rows && result.data.rows.length > 0) {
-              result.data.rows.forEach((item) => {
+              result.data.rows.forEach(item => {
                 this.studentList.unshift(item);
               });
               this.studentList = this.deweight(this.studentList, "userId");
@@ -2261,14 +2292,14 @@ export default {
       this.activeStudentList = [];
       this.chioseStudent = val;
       let discount = this.rightForm.discount ? this.rightForm.discount : 100;
-      this.studentList.forEach((stu) => {
+      this.studentList.forEach(stu => {
         if (val.indexOf(stu.userId) != -1) {
           this.activeStudentList.push({
             studentId: stu.userId,
             userName: stu.username,
             onlineClassesUnitPrice: this.rightForm.onlinePrice,
             offlineClassesUnitPrice: this.rightForm.offlinePrice,
-            paymentPrice: "",
+            paymentPrice: ""
           });
         }
       });
@@ -2284,8 +2315,8 @@ export default {
           categoryId: this.leftForm.courseType,
           teacherId: this.leftForm.teacher,
           studentIds,
-          activityChannel: 2,
-        }).then((res) => {
+          activityChannel: 2
+        }).then(res => {
           if (res.code == 200) {
             this.activeList = res.data;
           }
@@ -2298,14 +2329,14 @@ export default {
       this.activeStudentList = [];
       this.chioseStudent = val;
       let discount = this.rightForm.discount ? this.rightForm.discount : 100;
-      this.studentList.forEach((stu) => {
+      this.studentList.forEach(stu => {
         if (val == stu.userId) {
           this.activeStudentList.push({
             studentId: stu.userId,
             userName: stu.username,
             onlineClassesUnitPrice: this.rightForm.onlinePrice,
             offlineClassesUnitPrice: this.rightForm.offlinePrice,
-            paymentPrice: "",
+            paymentPrice: ""
           });
         }
       });
@@ -2317,8 +2348,8 @@ export default {
           teacherId: this.leftForm.teacher,
           studentIds,
           courseType: this.courseType,
-          activityChannel: 2,
-        }).then((res) => {
+          activityChannel: 2
+        }).then(res => {
           if (res.code == 200) {
             this.activeList = res.data;
             this.classTimeList = [25];
@@ -2330,9 +2361,9 @@ export default {
     // 制定属性去重
     deweight(arr, key) {
       let res = [];
-      arr.forEach((item) => {
+      arr.forEach(item => {
         let list = [];
-        res.forEach((resitem) => {
+        res.forEach(resitem => {
           list.push(resitem[key]);
         });
         if (list.indexOf(item[key]) === -1) {
@@ -2360,8 +2391,8 @@ export default {
       if (val) {
         this.computationalBtn = false;
       }
-    },
-  },
+    }
+  }
   // watch: {
   //   rightForm: {
   //     handler (newName, oldName) {

+ 208 - 235
src/views/categroyManager/modals/baseInfo.vue

@@ -1,111 +1,115 @@
 <template>
   <div>
-    <el-alert title="基础信息" type="info" :closable="false" class="baseMsg"></el-alert>
+    <el-alert
+      title="基础信息"
+      type="info"
+      :closable="false"
+      class="baseMsg"
+    ></el-alert>
 
-    <div class="m-core">
-      <el-form
-        :label-position="labelPosition"
-        :model="baseForm"
-        ref="vipform"
-        label-width="140px"
-        :rules="vipformRules"
-        class="vipform"
+    <el-form
+      :label-position="labelPosition"
+      :model="baseForm"
+      ref="vipform"
+      label-width="140px"
+      :rules="vipformRules"
+      class="vipform"
+    >
+      <el-form-item label="活动名称" prop="name">
+        <el-input
+          style="width: 400px"
+          v-model.trim="baseForm.name"
+          :disabled="isDisabled || status != 'DRAFT'"
+        ></el-input>
+      </el-form-item>
+      <!--   @visible-change="$forceUpdate()" -->
+      <el-form-item label="适用分部" prop="organ">
+        <select-all
+          v-model.trim="baseForm.organ"
+          style="width: 400px"
+          multiple
+          filterable
+          @change="onOrganChange"
+          clearable
+          :disabled="isDisabled"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </select-all>
+        <!-- <el-button @click="onCheckAllBranch">适用所有分部</el-button> -->
+      </el-form-item>
+      <el-form-item label="活动描述" prop="description">
+        <el-input
+          type="textarea"
+          v-model.trim="baseForm.description"
+          style="width: 400px"
+          :rows="5"
+          placeholder="请输入活动说明"
+          :disabled="isDisabled || status != 'DRAFT'"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="活动渠道" prop="activityChannel">
+        <el-select
+          v-model.trim="baseForm.activityChannel"
+          placeholder="请选择活动渠道"
+          clearable
+          style="width: 400px !important"
+          :disabled="isDisabled || status != 'DRAFT'"
+          @change="changeActivityChannel"
+        >
+          <el-option label="乐团小课" :value="1"></el-option>
+          <el-option label="常规小课" :value="2"></el-option>
+          <el-option label="学生购买" :value="3"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="活动类型"
+        prop="activityType"
+        v-if="baseForm.activityChannel !== 1"
       >
-        <el-form-item label="活动名称" prop="name">
-          <el-input
-            style="width: 400px"
-            v-model.trim="baseForm.name"
-            :disabled="isDisabled || status != 'DRAFT'"
-          ></el-input>
-        </el-form-item>
-        <!--   @visible-change="$forceUpdate()" -->
-        <el-form-item label="适用分部" prop="organ">
-          <select-all
-            v-model.trim="baseForm.organ"
-            style="width: 400px"
-            multiple
-            filterable
-            @change="onOrganChange"
-            clearable
-            :disabled="isDisabled"
-          >
-            <el-option
-              v-for="(item, index) in selects.branchs"
-              :key="index"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </select-all>
-          <!-- <el-button @click="onCheckAllBranch">适用所有分部</el-button> -->
-        </el-form-item>
-        <el-form-item label="活动描述" prop="description">
-          <el-input
-            type="textarea"
-            v-model.trim="baseForm.description"
-            style="width: 400px"
-            :rows="5"
-            placeholder="请输入活动说明"
-            :disabled="isDisabled || status != 'DRAFT'"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="活动渠道" prop="activityChannel">
-          <el-select
-            v-model.trim="baseForm.activityChannel"
-            placeholder="请选择活动渠道"
-            clearable
-            style="width: 400px !important"
-            :disabled="isDisabled || status != 'DRAFT'"
-            @change="changeActivityChannel"
-          >
-            <el-option label="乐团小课" :value="1"></el-option>
-            <el-option label="常规小课" :value="2"></el-option>
-            <el-option label="学生购买" :value="3"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="活动类型"
-          prop="activityType"
-          v-if="baseForm.activityChannel !== 1"
+        <el-select
+          v-model.trim="baseForm.activityType"
+          placeholder="请选择活动类型"
+          clearable
+          style="width: 400px !important"
+          @change="changeActivityType"
+          :disabled="isDisabled || status != 'DRAFT'"
         >
-          <el-select
-            v-model.trim="baseForm.activityType"
-            placeholder="请选择活动类型"
-            clearable
-            style="width: 400px !important"
-            @change="changeActivityType"
-            :disabled="isDisabled || status != 'DRAFT'"
-          >
-            <el-option label="课程活动" :value="0"></el-option>
-            <el-option label="会员活动" :value="1"></el-option>
-          </el-select>
-        </el-form-item>
+          <el-option label="课程活动" :value="0"></el-option>
+          <el-option label="会员活动" :value="1"></el-option>
+        </el-select>
+      </el-form-item>
 
-        <el-form-item label="活动生效时间" prop="activeTime">
-          <el-date-picker
-            :disabled="isDisabled"
-            v-model.trim="baseForm.activeTime"
-            type="datetimerange"
-            :default-time="['00:00:00', '23:59:59']"
-            range-separator="至"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            start-placeholder="开始日期"
-            :picker-options="{
-              firstDayOfWeek: 1,
-            }"
-            end-placeholder="结束日期"
-          ></el-date-picker>
-          <el-tooltip placement="top" popper-class="mTooltip">
-            <div slot="content">
-              可通过该方案购买课程的时间范围,到达开始时间才可购买,到达结束时间后不可购买,不填则不限制且立即生效
-            </div>
-            <i
-              class="el-icon-question micon el-tooltip"
-              style="font-size: 18px; color: #f56c6c"
-            ></i>
-          </el-tooltip>
-        </el-form-item>
-        <div v-if="baseForm.activityChannel !== 1">
-          <!-- <el-form-item label="排课时间范围" prop="courseTime">
+      <el-form-item label="活动生效时间" prop="activeTime">
+        <el-date-picker
+          :disabled="isDisabled"
+          v-model.trim="baseForm.activeTime"
+          type="datetimerange"
+          :default-time="['00:00:00', '23:59:59']"
+          range-separator="至"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          start-placeholder="开始日期"
+          :picker-options="{
+            firstDayOfWeek: 1
+          }"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+        <el-tooltip placement="top" popper-class="mTooltip">
+          <div slot="content">
+            可通过该方案购买课程的时间范围,到达开始时间才可购买,到达结束时间后不可购买,不填则不限制且立即生效
+          </div>
+          <i
+            class="el-icon-question micon el-tooltip"
+            style="font-size: 18px; color: #f56c6c"
+          ></i>
+        </el-tooltip>
+      </el-form-item>
+      <div v-if="baseForm.activityChannel !== 1">
+        <!-- <el-form-item label="排课时间范围" prop="courseTime">
             <el-date-picker
               :disabled="isDisabled"
               v-model.trim="baseForm.courseTime"
@@ -129,52 +133,58 @@
               ></i>
             </el-tooltip>
           </el-form-item> -->
-          <el-form-item label="适用学员" prop="applyToStudentType">
-            <el-row>
-              <el-col style="width: 400px">
-                <select-all
-                  v-model.trim="baseForm.applyToStudentType"
-                  style="width: 400px"
-                  multiple
-                  filterable
-                  clearable
-                  placeholder="请选择适用学员"
-                  @change="applyToStudentTypeChange"
-                  :disabled="isDisabled"
-                >
-                  <el-option label="新学员" value="1"></el-option>
-                  <el-option label="老学员" value="0"></el-option>
-                  <el-option label="会员" value="2"></el-option>
-                  <el-option label="非会员" value="3"></el-option>
-                </select-all>
-              </el-col>
-              <el-tooltip placement="top" popper-class="mTooltip">
-                <div slot="content">可通过该方案购买课程的学员群体,不填则不限制</div>
-                <i
-                  class="el-icon-question micon el-tooltip"
-                  style="font-size: 18px; color: #f56c6c; margin-left: 3px"
-                ></i>
-              </el-tooltip>
-            </el-row>
-          </el-form-item>
-          <el-form-item label="可购买次数" prop="studentMaxUsedTimes">
-            <el-input
-              style="width: 400px"
-              type="number"
-              v-model.trim="baseForm.studentMaxUsedTimes"
-              :disabled="isDisabled"
-            >
-              <template slot="append">次</template>
-            </el-input>
+        <el-form-item label="适用学员" prop="applyToStudentType">
+          <el-row>
+            <el-col style="width: 400px">
+              <select-all
+                v-model.trim="baseForm.applyToStudentType"
+                style="width: 400px"
+                multiple
+                filterable
+                clearable
+                placeholder="请选择适用学员"
+                @change="applyToStudentTypeChange"
+                :disabled="isDisabled"
+              >
+                <el-option label="新学员" value="1"></el-option>
+                <el-option label="老学员" value="0"></el-option>
+                <el-option label="会员" value="2"></el-option>
+                <el-option label="非会员" value="3"></el-option>
+              </select-all>
+            </el-col>
             <el-tooltip placement="top" popper-class="mTooltip">
-              <div slot="content">学员可以购买该活动方案的次数限制,不填则不限制</div>
+              <div slot="content">
+                可通过该方案购买课程的学员群体,不填则不限制
+              </div>
               <i
                 class="el-icon-question micon el-tooltip"
-                style="font-size: 18px; color: #f56c6c"
+                style="font-size: 18px; color: #f56c6c; margin-left: 3px"
               ></i>
             </el-tooltip>
-          </el-form-item>
-          <!-- <el-form-item label="是否充值课程余额" prop="isPayToBalance">
+          </el-row>
+        </el-form-item>
+        <el-form-item label="可购买次数" prop="studentMaxUsedTimes">
+          <el-input
+            style="width: 400px"
+            type="number"
+            v-model.trim="baseForm.studentMaxUsedTimes"
+            :disabled="isDisabled"
+          >
+            <template slot="append"
+              >次</template
+            >
+          </el-input>
+          <el-tooltip placement="top" popper-class="mTooltip">
+            <div slot="content">
+              学员可以购买该活动方案的次数限制,不填则不限制
+            </div>
+            <i
+              class="el-icon-question micon el-tooltip"
+              style="font-size: 18px; color: #f56c6c"
+            ></i>
+          </el-tooltip>
+        </el-form-item>
+        <!-- <el-form-item label="是否充值课程余额" prop="isPayToBalance">
           <el-select
             v-model.trim="baseForm.isPayToBalance"
             placeholder="请选择是否充值课程余额"
@@ -197,62 +207,8 @@
             ></i>
           </el-tooltip>
         </el-form-item> -->
-        </div>
-        <el-form-item
-          label="活动售价"
-          prop="marketPrice"
-          :rules="[
-            {
-              required: true,
-              message: '请选输入活动售价',
-              trigger: 'blur',
-            },
-            {
-              pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-              message: '请输入正确的金额',
-            },
-          ]"
-        >
-          <el-input
-            style="width: 400px"
-            type="number"
-            v-model.trim="baseForm.marketPrice"
-            :disabled="isDisabled || status != 'DRAFT'"
-          >
-            <template slot="append">元</template>
-          </el-input>
-          <el-tooltip placement="top" popper-class="mTooltip">
-            <div slot="content">
-              该字段仅用于关联的营销活动中本方案的销售价格,后台、老师端为学员创建课程不受此价格影响
-            </div>
-            <i
-              class="el-icon-question micon el-tooltip"
-              style="font-size: 18px; color: #f56c6c"
-            ></i>
-          </el-tooltip>
-        </el-form-item>
-        <el-form-item
-          label="活动原价"
-          prop="originalPrice"
-          :rules="[
-            { required: true, message: '请选输入活动原价', trigger: 'blur' },
-            {
-              pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-              message: '请输入正确的金额',
-            },
-          ]"
-        >
-          <el-input
-            style="width: 400px"
-            type="number"
-            v-model.trim="baseForm.originalPrice"
-            :disabled="isDisabled || status != 'DRAFT'"
-          >
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-      </el-form>
-    </div>
+      </div>
+    </el-form>
   </div>
 </template>
 <script>
@@ -273,8 +229,8 @@ export default {
             min: 1,
             max: 25,
             message: "长度在 1 到 25 个字符",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         desc: [
           { required: true, message: "请输入文字描述", trigger: "blur" },
@@ -282,31 +238,41 @@ export default {
             min: 1,
             max: 200,
             message: "长度在 1 到 200 个字符",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
+        ],
+        activityType: [
+          { required: true, message: "请选择活动类型", trigger: "change" }
         ],
-        activityType: [{ required: true, message: "请选择活动类型", trigger: "change" }],
         activityChannel: [
-          { required: true, message: "请选择活动渠道", trigger: "change" },
+          { required: true, message: "请选择活动渠道", trigger: "change" }
+        ],
+        courseTime: [
+          { required: false, message: "请选择课程时间", trigger: "change" }
         ],
-        courseTime: [{ required: false, message: "请选择课程时间", trigger: "change" }],
         studentMaxUsedTimes: [
           { required: false, message: "请输入购买次数", trigger: "blur" },
-          { pattern: /^\+?[1-9]\d*$/, message: "请输入大于0的正整数" },
+          { pattern: /^\+?[1-9]\d*$/, message: "请输入大于0的正整数" }
+        ],
+        organ: [
+          { required: true, message: "请选择适用分部", trigger: "change" }
+        ],
+        stauts: [
+          { required: true, message: "请选择活动形式", trigger: "change" }
+        ],
+        applyToStudentType: [
+          { required: false, message: "请选择是否新生专享" }
         ],
-        organ: [{ required: true, message: "请选择适用分部", trigger: "change" }],
-        stauts: [{ required: true, message: "请选择活动形式", trigger: "change" }],
-        applyToStudentType: [{ required: false, message: "请选择是否新生专享" }],
         isPayToBalance: [
           {
             required: true,
             message: "请选择是否支付到余额",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         allowOnlineToOffline: [
-          { required: true, message: "请选择课程调整方式", trigger: "change" },
-        ],
+          { required: true, message: "请选择课程调整方式", trigger: "change" }
+        ]
       },
       courseStatusList: [], // 获取所有课程形式
       activeType: "",
@@ -323,7 +289,7 @@ export default {
       courseNumForm: {
         minCourseNum: "",
         maxCourseNum: "",
-        studentMaxUsedTimes: "",
+        studentMaxUsedTimes: ""
       },
       giveClassPaySalaryFlag: true,
       organList: [],
@@ -333,14 +299,14 @@ export default {
         minCourseNum: [
           { required: true, message: "请输入最小课时数", trigger: "blur" },
           { validator: this.validateCom, trigger: "blur" },
-          { validator: this.validateMin, trigger: "blur" },
+          { validator: this.validateMin, trigger: "blur" }
         ],
         maxCourseNum: [
           { required: true, message: "请输入最大课时数", trigger: "blur" },
           { validator: this.validateCom, trigger: "blur" },
-          { validator: this.validateMax, trigger: "blur" },
-        ],
-      },
+          { validator: this.validateMax, trigger: "blur" }
+        ]
+      }
     };
   },
 
@@ -425,20 +391,26 @@ export default {
       this.$emit("resetBaseChannel", val);
     },
     submitFrom() {
-      this.$refs.form.validate((isok) => {
+      this.$refs.form.validate(isok => {
         if (isok) {
-          this.$refs["vipform"].validate((valid) => {
+          this.$refs["vipform"].validate(valid => {
             if (valid) {
               // 验证通过
               let coursesStartTime = null,
                 coursesEndTime = null,
                 startTime = null,
                 endTime = null;
-              if (this.vipform.courseTime && this.vipform.courseTime.length > 0) {
+              if (
+                this.vipform.courseTime &&
+                this.vipform.courseTime.length > 0
+              ) {
                 coursesStartTime = this.vipform.courseTime[0];
                 coursesEndTime = this.vipform.courseTime[1];
               }
-              if (this.vipform.activeTime && this.vipform.activeTime.length > 0) {
+              if (
+                this.vipform.activeTime &&
+                this.vipform.activeTime.length > 0
+              ) {
                 startTime = this.vipform.activeTime[0];
                 endTime = this.vipform.activeTime[1];
               }
@@ -482,7 +454,7 @@ export default {
                 }
                 onlineSalarySettlement = {
                   salarySettlementType: this.onlineSalary,
-                  settlementValue: this.onlineprice,
+                  settlementValue: this.onlineprice
                 };
               } else {
                 onlineSalarySettlement = null;
@@ -499,7 +471,7 @@ export default {
                 }
                 offlineSalarySettlement = {
                   salarySettlementType: this.unonlineSalary,
-                  settlementValue: this.unonlineprice,
+                  settlementValue: this.unonlineprice
                 };
               } else {
                 offlineSalarySettlement = null;
@@ -509,7 +481,7 @@ export default {
               // let giveClassPaySalaryFlag = this.giveClassPaySalaryFlag * 1;
               let vipGroupSalarySettlement = {
                 onlineSalarySettlement,
-                offlineSalarySettlement,
+                offlineSalarySettlement
               };
               if (type == "BASE_ACTIVITY") {
                 this.courseNumForm.studentMaxUsedTimes = -1;
@@ -546,15 +518,16 @@ export default {
                     : -1,
                   offlineClassJoinGradientRewards:
                     this.offlineClassJoinGradientRewards * 1,
-                  onlineClassJoinGradientRewards: this.onlineClassJoinGradientRewards * 1,
+                  onlineClassJoinGradientRewards:
+                    this.onlineClassJoinGradientRewards * 1
                 })
-              ).then((res) => {
+              ).then(res => {
                 if (res.code == 200) {
                   this.$message.success("恭喜你,活动创建成功");
                   // this.onReSet();
                   this.$store.dispatch("delVisitedViews", this.$route);
                   this.$router.push({
-                    path: "/vipActiveManager/vipActiveList",
+                    path: "/vipActiveManager/vipActiveList"
                   });
                 }
               });
@@ -563,7 +536,7 @@ export default {
                 let isError = document.getElementsByClassName("is-error");
                 isError[0].scrollIntoView({
                   block: "center",
-                  behavior: "smooth",
+                  behavior: "smooth"
                 });
               });
               // this.$message.error("请填写必要参数");
@@ -588,7 +561,7 @@ export default {
       // 选择所有分部
       let vipform = this.vipform;
       vipform.organ = [];
-      this.selects.branchs.forEach((item) => {
+      this.selects.branchs.forEach(item => {
         vipform.organ.push(item.id);
       });
       this.$refs.vipform.validateField("organ");
@@ -600,7 +573,7 @@ export default {
         name: "",
         desc: "",
         activeTime: [],
-        courseTime: [],
+        courseTime: []
       };
       this.activeType = "";
       this.online = true;
@@ -617,7 +590,7 @@ export default {
       this.courseNumForm.maxCourseNum = "";
       this.courseNumForm.minCourseNum = "";
       // this.$refs.vipform.resetFields();
-    },
+    }
   },
   computed: {
     balanceDis() {
@@ -627,8 +600,8 @@ export default {
       } else {
         return false;
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 86 - 13
src/views/categroyManager/modals/payInfo.vue

@@ -133,7 +133,7 @@
         <el-row v-if="activityChannel != 1">
           <el-form-item
             label="是否限制课时数"
-            prop="isLimitNum"
+            prop="fixedCourseNumFlag"
             :rules="[
               {
                 required: false,
@@ -144,18 +144,20 @@
           >
             <el-select
               style="width: 400px !important"
-              v-model.trim="payForm.isLimitNum"
+              v-model.trim="payForm.fixedCourseNumFlag"
               placeholder="请选择是否限制课时"
               clearable
               :disabled="isDisabled"
-              @change="checkisLimitNum"
+              @change="checkFixedCourseNumFlag"
             >
               <el-option label="是" :value="true"></el-option>
               <el-option label="否" :value="false"></el-option>
             </el-select>
           </el-form-item>
         </el-row>
-        <el-row v-if="payForm.isLimitNum && activityChannel != 1">
+        <el-row
+          v-if="payForm.fixedCourseNumFlag === false && activityChannel != 1"
+        >
           <el-form-item
             prop="minCourseNum"
             label="最小课时数"
@@ -179,7 +181,9 @@
             </el-input>
           </el-form-item>
         </el-row>
-        <el-row v-if="payForm.isLimitNum && activityChannel != 1">
+        <el-row
+          v-if="payForm.fixedCourseNumFlag === false && activityChannel != 1"
+        >
           <el-form-item
             prop="maxCourseNum"
             label="最大课时数"
@@ -204,7 +208,8 @@
           </el-form-item>
         </el-row>
 
-        <el-row v-if="activityChannel == 1">
+        <!-- 乐团小课时才显示课时数 -->
+        <el-row v-if="activityChannel == 1 || payForm.fixedCourseNumFlag">
           <el-form-item
             prop="minCourseNum"
             label="课时数"
@@ -277,7 +282,9 @@
           </el-form-item>
         </el-row>
       </div>
-      <el-row v-if="activityChannel != 1">
+      <el-row
+        v-if="activityChannel != 1 && payForm.fixedCourseNumFlag === false"
+      >
         <!--  {
               pattern: /^100$|^(\d|[1-9]\d)(\.\d{1,8})*$/,
               message: '请输入正确的折扣',
@@ -302,6 +309,71 @@
           </el-input>
         </el-form-item>
       </el-row>
+      <!-- 活动价格 -->
+      <el-row v-if="payForm.fixedCourseNumFlag">
+        <el-col>
+          <el-form-item
+            label="活动售价"
+            prop="marketPrice"
+            :rules="[
+              {
+                required: true,
+                message: '请选输入活动售价',
+                trigger: 'blur'
+              },
+              {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: '请输入正确的金额'
+              }
+            ]"
+          >
+            <el-input
+              style="width: 400px"
+              type="number"
+              v-model.trim="payForm.marketPrice"
+              :disabled="isDisabled"
+            >
+              <template slot="append"
+                >元</template
+              >
+            </el-input>
+            <el-tooltip placement="top" popper-class="mTooltip">
+              <div slot="content">
+                该字段仅用于关联的营销活动中本方案的销售价格,后台、老师端为学员创建课程不受此价格影响
+              </div>
+              <i
+                class="el-icon-question micon el-tooltip"
+                style="font-size: 18px; color: #f56c6c"
+              ></i>
+            </el-tooltip>
+          </el-form-item>
+        </el-col>
+        <el-col>
+          <el-form-item
+            label="活动原价"
+            prop="originalPrice"
+            :rules="[
+              { required: true, message: '请选输入活动原价', trigger: 'blur' },
+              {
+                pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                message: '请输入正确的金额'
+              }
+            ]"
+          >
+            <el-input
+              style="width: 400px"
+              type="number"
+              v-model.trim="payForm.originalPrice"
+              :disabled="isDisabled"
+            >
+              <template slot="append"
+                >元</template
+              >
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
       <el-row v-if="activityChannel != 1">
         <el-form-item prop="fullMinusCourseTimes" label="满赠达标数量">
           <el-input
@@ -500,13 +572,14 @@
           </el-select>
         </el-form-item>
       </el-row>
-      <el-row>
+      <el-row
+        v-if="
+          payForm.giveCourseType == 'MEMBER' && payForm.fullMinusCourseTimes
+        "
+      >
         <el-form-item
           prop="giveMemberTime"
           label="赠送会员时长"
-          v-if="
-            payForm.giveCourseType == 'MEMBER' && payForm.fullMinusCourseTimes
-          "
           :rules="[
             { required: true, message: '请输入赠送会员时长', trigger: 'blur' }
           ]"
@@ -632,9 +705,9 @@ export default {
         this.$emit("chageSalary");
       }
     },
-    checkisLimitNum(val) {
+    checkFixedCourseNumFlag(val) {
       if (!val) {
-        this.$emit("resetIsLimitNum");
+        this.$emit("resetFixedCourseNumFlag");
       }
     },
     changeCateFee(val) {

+ 62 - 37
src/views/categroyManager/vipActiveList.vue

@@ -7,7 +7,10 @@
 
     <div class="m-core">
       <div class="btnList" style="margin-bottom: 20px">
-        <el-button type="primary" v-permission="'/vipNewActive'" @click="gotoNewActive"
+        <el-button
+          type="primary"
+          v-permission="'/vipNewActive'"
+          @click="gotoNewActive"
           >新建</el-button
         >
         <!-- <el-button
@@ -161,11 +164,21 @@
             <template slot-scope="scope">
               <div>
                 <div>
-                  {{ scope.row.activityChannel == 1 ? "活动渠道:乐团小课" : "" }}
-                  {{ scope.row.activityChannel == 2 ? "活动渠道:常规小课" : "" }}
-                  {{ scope.row.activityChannel == 3 ? "活动渠道:学生购买" : "" }}
+                  {{
+                    scope.row.activityChannel == 1 ? "活动渠道:乐团小课" : ""
+                  }}
+                  {{
+                    scope.row.activityChannel == 2 ? "活动渠道:常规小课" : ""
+                  }}
+                  {{
+                    scope.row.activityChannel == 3 ? "活动渠道:学生购买" : ""
+                  }}
                 </div>
-                <p>活动类型:{{ scope.row.activityType ? "会员活动" : "课程活动" }}</p>
+                <p>
+                  活动类型:{{
+                    scope.row.activityType ? "会员活动" : "课程活动"
+                  }}
+                </p>
               </div>
             </template>
           </el-table-column>
@@ -181,7 +194,9 @@
             <template slot-scope="scope">
               <div>
                 {{
-                  scope.row.vipGroupCategoryNames ? scope.row.vipGroupCategoryNames : "--"
+                  scope.row.vipGroupCategoryNames
+                    ? scope.row.vipGroupCategoryNames
+                    : "--"
                 }}
               </div>
             </template>
@@ -283,11 +298,11 @@
                 <el-button
                   v-if="
                     scope.row.status == 'PROGRESS' &&
-                    scope.row.maxCourseNum &&
-                    scope.row.minCourseNum &&
-                    scope.row.maxCourseNum > 0 &&
-                    scope.row.minCourseNum > 0 &&
-                    scope.row.minCourseNum == scope.row.maxCourseNum
+                      scope.row.maxCourseNum &&
+                      scope.row.minCourseNum &&
+                      scope.row.maxCourseNum > 0 &&
+                      scope.row.minCourseNum > 0 &&
+                      scope.row.minCourseNum == scope.row.maxCourseNum
                   "
                   type="text"
                   v-permission="'/activeSenior'"
@@ -333,7 +348,9 @@
                       @click="scope._self.$refs[scope.$index].doClose()"
                       >取消</el-button
                     >
-                    <el-button type="primary" @click="remove(scope)">确定</el-button>
+                    <el-button type="primary" @click="remove(scope)"
+                      >确定</el-button
+                    >
                   </div>
                   <el-button type="text" slot="reference">删除</el-button>
                 </el-popover>
@@ -361,7 +378,7 @@ import pagination from "@/components/Pagination/index";
 import {
   vipGroupActivity,
   removeVipActive,
-  enableVipGroupActivity,
+  enableVipGroupActivity
 } from "@/api/vipSeting";
 import ExportChiose from "@/components/Export-chiose";
 import qs from "qs";
@@ -381,7 +398,7 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       searchForm: {
         organId: null,
@@ -390,9 +407,9 @@ export default {
         applyToStudentType: null,
         allowOnlineToOffline: null,
         status: null,
-        activityChannel: null,
+        activityChannel: null
       },
-      dialogVisible: false,
+      dialogVisible: false
     };
   },
   // created() {
@@ -463,7 +480,9 @@ export default {
         switch (obj.onlineSalarySettlement.salarySettlementType) {
           case "RATIO_DISCOUNT": {
             if (obj.onlineSalarySettlement.settlementValue) {
-              return `线上:比例结算${obj.onlineSalarySettlement.settlementValue}%`;
+              return `线上:比例结算${
+                obj.onlineSalarySettlement.settlementValue
+              }%`;
             } else {
               return "线上:比例结算";
             }
@@ -475,7 +494,9 @@ export default {
           }
           case "FIXED_SALARY": {
             if (obj.onlineSalarySettlement.settlementValue) {
-              return `线上:固定课酬${obj.onlineSalarySettlement.settlementValue}/次`;
+              return `线上:固定课酬${
+                obj.onlineSalarySettlement.settlementValue
+              }/次`;
             } else {
               return "线上:固定课酬";
             }
@@ -495,7 +516,9 @@ export default {
         switch (obj.offlineSalarySettlement.salarySettlementType) {
           case "RATIO_DISCOUNT": {
             if (obj.offlineSalarySettlement.settlementValue) {
-              return `线下:比例结算${obj.offlineSalarySettlement.settlementValue}%`;
+              return `线下:比例结算${
+                obj.offlineSalarySettlement.settlementValue
+              }%`;
             } else {
               return "线下:比例结算";
             }
@@ -507,7 +530,9 @@ export default {
           }
           case "FIXED_SALARY": {
             if (obj.offlineSalarySettlement.settlementValue) {
-              return `线下:固定课酬${obj.offlineSalarySettlement.settlementValue}/次`;
+              return `线下:固定课酬${
+                obj.offlineSalarySettlement.settlementValue
+              }/次`;
             } else {
               return "线下:固定课酬";
             }
@@ -515,7 +540,7 @@ export default {
           }
         }
       }
-    },
+    }
   },
   methods: {
     async init() {
@@ -532,7 +557,7 @@ export default {
       let obj = {
         ...rest,
         page: this.rules.page,
-        rows: this.rules.limit,
+        rows: this.rules.limit
       };
       await Export(
         this,
@@ -540,7 +565,7 @@ export default {
           url: "/api-web/export/vipGroupActivity",
           fileName: "活动列表.xls",
           method: "post",
-          params: qs.stringify(cleanDeep(obj)),
+          params: qs.stringify(cleanDeep(obj))
         },
         "您确定活动列表?"
       );
@@ -560,7 +585,7 @@ export default {
     onCheckAllBranch() {
       // 适用所有分部
       this.resetForm.organ = [];
-      this.organList.forEach((item) => {
+      this.organList.forEach(item => {
         this.resetForm.organ.push(item.id);
       });
     },
@@ -589,8 +614,8 @@ export default {
         status: this.searchForm.status,
         activityChannel: this.searchForm.activityChannel,
         enable,
-        search,
-      }).then((res) => {
+        search
+      }).then(res => {
         if (res.code == 200) {
           this.tableList = res.data.rows;
           this.rules.total = res.data.total;
@@ -694,9 +719,9 @@ export default {
       this.$router.push(
         {
           path: "/operateManager/vipNewActive?type=reset",
-          query: { id: row.id },
+          query: { id: row.id }
         },
-        (router) => {
+        router => {
           router.meta.title = "修改活动方案";
         }
       );
@@ -704,20 +729,20 @@ export default {
     look(row) {
       this.$router.push({
         path: "/operateManager/vipNewActive?type=look",
-        query: { id: row.id },
+        query: { id: row.id }
       });
     },
     // 活动资格管理
     activeManager(row) {
       this.$router.push({
         path: "/operateManager/activeSenior",
-        query: { id: row.id },
+        query: { id: row.id }
       });
     },
     // 点击确认按钮发送修改请求
     remove(scope) {
       let id = scope.row.id;
-      removeVipActive({ id }).then((res) => {
+      removeVipActive({ id }).then(res => {
         if (res.code == 200) {
           this.$message.success("恭喜您删除成功");
           this.getList();
@@ -731,10 +756,10 @@ export default {
       // let searchForm = JSON.stringify(this.searchForm);
       this.$router.push(
         {
-          path: "/operateManager/vipNewActive?type=create",
+          path: "/operateManager/vipNewActive?type=create"
           // query: { rules, searchForm },
         },
-        (router) => {
+        router => {
           router.meta.title = "新建活动方案";
         }
       );
@@ -785,10 +810,10 @@ export default {
       this.$confirm(`是否${tempString}该活动?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
-          enableVipGroupActivity({ id: row.id }).then((res) => {
+          enableVipGroupActivity({ id: row.id }).then(res => {
             if (res.code == 200) {
               this.$message.success("操作成功");
               this.getList();
@@ -796,8 +821,8 @@ export default {
           });
         })
         .catch(() => {});
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 21 - 9
src/views/categroyManager/vipNewActive.vue

@@ -35,7 +35,7 @@
           @changeCourseType="changeCourseType"
           @changeGiveCourseType="changeGiveCourseType"
           @chageSalary="chageSalary"
-          @resetIsLimitNum="resetIsLimitNum"
+          @resetFixedCourseNumFlag="resetFixedCourseNumFlag"
           v-if="active == 2"
           :remberList="remberList"
           :isDisabled="isDisabled || statuss != 'DRAFT'"
@@ -110,7 +110,7 @@ const payBaseForm = {
   teachMode: null,
   allowOnlineToOffline: "",
   singleCourseTime: null,
-  isLimitNum: null,
+  fixedCourseNumFlag: null,
   minCourseNum: null,
   maxCourseNum: null,
   memberRankId: null,
@@ -300,7 +300,7 @@ export default {
 
       this.$forceUpdate();
     },
-    resetIsLimitNum() {
+    resetFixedCourseNumFlag() {
       this.$set(this.payForm, "maxCourseNum", null);
       this.$set(this.payForm, "minCourseNum", null);
     },
@@ -347,9 +347,21 @@ export default {
       // let vipGroupCategoryIdList =
       //   this.payForm.vipGroupCategoryIdList.join(",");
       let vipGroupSalarySettlement = this.salaryForm;
-      if (this.baseForm.activityChannel == 1) {
+      // 乐团小课 || 是否限制课时数为true
+      if (
+        this.baseForm.activityChannel == 1 ||
+        this.payForm.fixedCourseNumFlag
+      ) {
         this.payForm.maxCourseNum = this.payForm.minCourseNum;
       }
+
+      // 非乐团小课 是否限制课时数为true
+      if (
+        this.baseForm.activityChannel != 1 ||
+        this.payForm.fixedCourseNumFlag
+      ) {
+        this.payForm.discount = 100;
+      }
       let obj = {
         ...this.baseForm,
         ...this.payForm,
@@ -442,7 +454,6 @@ export default {
         description: data.description,
         activeTime,
         courseTime,
-        marketPrice: data.marketPrice,
         organ: data.organId.split(",").map(organ => {
           return Number(organ);
         }),
@@ -451,8 +462,7 @@ export default {
         studentMaxUsedTimes: data.studentMaxUsedTimes,
         isPayToBalance: Number(data.payToBalance),
         id: this.$route.query.id,
-        activityChannel: data.activityChannel,
-        originalPrice: data.originalPrice
+        activityChannel: data.activityChannel
       });
       // this.baseForm = {
       //   name: data.name,
@@ -486,7 +496,7 @@ export default {
         teachMode: data.teachMode + "",
         allowOnlineToOffline: data.allowOnlineToOffline + "",
         singleCourseTime: data.singleCourseTime,
-        isLimitNum: data.minCourseNum ? true : false,
+        fixedCourseNumFlag: data.fixedCourseNumFlag,
         minCourseNum: data.minCourseNum,
         maxCourseNum: data.maxCourseNum,
         memberRankId: data.memberRankId,
@@ -502,7 +512,9 @@ export default {
         giveMemberRankId: data.giveMemberRankId,
         givePeriod: data.givePeriodEnum,
         giveMemberTime: data.giveMemberTime ? data.giveMemberTime : null,
-        giveAllowOnlineToOffline: data.giveAllowOnlineToOffline + ""
+        giveAllowOnlineToOffline: data.giveAllowOnlineToOffline + "",
+        marketPrice: data.marketPrice,
+        originalPrice: data.originalPrice
       };
       // 格式化缴费金额
       if (data.salarySettlementJson && data.salarySettlementJson != "null") {

+ 2 - 2
vue.config.js

@@ -21,8 +21,8 @@ const name = defaultSettings.title || "管乐迷后台管理系统"; // page tit
 // let target = 'http://192.168.3.161:8000' //勇哥
 // let target = 'http://192.168.3.146:8000' //王昭
 // let target = 'http://dev.dayaedu.com' // 开发环境
-// let target = "https://test.dayaedu.com"; //测试环境
-let target = "https://online.dayaedu.com"; //测试环境
+let target = "https://test.dayaedu.com"; //测试环境
+// let target = "https://online.dayaedu.com"; //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**