Ver Fonte

Merge branch '03/03GRADE' into test

mo há 3 anos atrás
pai
commit
2aa321c0d3

+ 33 - 34
src/views/buildVip/index.vue

@@ -494,7 +494,26 @@
                 />
               </template>
             </el-table-column>
-            <el-table-column align="center" prop="studentId" label="缴费总额">
+            <el-table-column align="center" prop="studentId" label="">
+              <template slot="header" slot-scope="slot">
+                <div class="titleCell">
+                  <span>缴费总额</span>
+                  <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;
+                        top: 2px;
+                        position: relative;
+                      "
+                    ></i>
+                  </el-tooltip>
+                </div>
+              </template>
               <template slot-scope="scope">
                 <el-input-number
                   size="mini"
@@ -1230,14 +1249,8 @@ export default {
           this.activeStudentList.push({
             studentId: stu.userId,
             userName: stu.username,
-            onlineClassesUnitPrice: (
-              (this.rightForm.onlinePrice * discount) /
-              100
-            ).toFixed(2),
-            offlineClassesUnitPrice: (
-              (this.rightForm.offlinePrice * discount) /
-              100
-            ).toFixed(2),
+            onlineClassesUnitPrice: this.rightForm.onlinePrice,
+            offlineClassesUnitPrice: this.rightForm.offlinePrice,
             paymentPrice: "",
           });
         }
@@ -1265,7 +1278,6 @@ export default {
       this.hasOffline = true;
       this.maxCourseNum = 0;
       this.minCourseNum = 0;
-      this.rightForm.discount = 100;
 
       if (val) {
         this.classTimeDis = true;
@@ -1337,14 +1349,8 @@ export default {
                 this.activeStudentList.push({
                   studentId: stu.userId,
                   userName: stu.username,
-                  onlineClassesUnitPrice: (
-                    (this.rightForm.onlinePrice * discount) /
-                    100
-                  ).toFixed(0),
-                  offlineClassesUnitPrice: (
-                    (this.rightForm.offlinePrice * discount) /
-                    100
-                  ).toFixed(0),
+                  onlineClassesUnitPrice: this.rightForm.onlinePrice,
+                  offlineClassesUnitPrice: this.rightForm.offlinePrice,
                   paymentPrice: "",
                 });
               }
@@ -1688,6 +1694,11 @@ export default {
     },
     // 计算课酬
     computational() {
+      if (this.timeTable.length <= 0) {
+        this.$message.error("请先排课再计算课酬");
+        return;
+      }
+
       this.computationalBtn = true;
       let userId = this.leftForm.teacher || null;
       let giveTeachMode = this.centerForm.radio || null;
@@ -2248,14 +2259,8 @@ export default {
           this.activeStudentList.push({
             studentId: stu.userId,
             userName: stu.username,
-            onlineClassesUnitPrice: (
-              (this.rightForm.onlinePrice * discount) /
-              100
-            ).toFixed(2),
-            offlineClassesUnitPrice: (
-              (this.rightForm.offlinePrice * discount) /
-              100
-            ).toFixed(2),
+            onlineClassesUnitPrice: this.rightForm.onlinePrice,
+            offlineClassesUnitPrice: this.rightForm.offlinePrice,
             paymentPrice: "",
           });
         }
@@ -2289,14 +2294,8 @@ export default {
           this.activeStudentList.push({
             studentId: stu.userId,
             userName: stu.username,
-            onlineClassesUnitPrice: (
-              (this.rightForm.onlinePrice * discount) /
-              100
-            ).toFixed(2),
-            offlineClassesUnitPrice: (
-              (this.rightForm.offlinePrice * discount) /
-              100
-            ).toFixed(2),
+            onlineClassesUnitPrice: this.rightForm.onlinePrice,
+            offlineClassesUnitPrice: this.rightForm.offlinePrice,
             paymentPrice: "",
           });
         }

+ 1 - 0
src/views/categroyManager/modals/baseInfo.vue

@@ -255,6 +255,7 @@ export default {
         ],
         studentMaxUsedTimes: [
           { required: false, message: "请输入购买次数", trigger: "blur" },
+          { pattern: /^[1-9]d*$/, message: '请输入大于0的正整数'  }
         ],
         organ: [{ required: true, message: "请选择适用分部", trigger: "change" }],
         stauts: [

+ 22 - 3
src/views/categroyManager/vipNewActive.vue

@@ -235,7 +235,6 @@ export default {
       this.payForm = {
         ...payBaseForm,
       };
-      console.log(this.payForm);
     },
     changeCourseType(val) {
       // this.$emit("changeCourseType", val);
@@ -365,11 +364,15 @@ export default {
             if (status == "DRAFT") {
               this.$message.success("恭喜你,保存草稿成功");
               this.baseForm.id = res.data.id;
+              this.$nextTick(()=>{
+                 this.formatDetail(res.data);
+              })
               this.$router.push({
                 query: merge(this.$route.query, {
                   id: res.data.id,
                 }),
               });
+
             } else {
               this.$message.success("活动创建成功");
               this.$store.dispatch("delVisitedViews", this.$route);
@@ -403,7 +406,8 @@ export default {
         ? data.applyToStudentType.split(",")
         : [];
       // 格式化 baseForm
-      this.baseForm = {
+      console.log(data.studentMaxUsedTimes);
+      this.$set(this, "baseForm", {
         name: data.name,
         description: data.description,
         activeTime,
@@ -417,7 +421,22 @@ export default {
         studentMaxUsedTimes: data.studentMaxUsedTimes,
         isPayToBalance: Number(data.payToBalance),
         id: this.$route.query.id,
-      };
+      });
+      // this.baseForm = {
+      //   name: data.name,
+      //   description: data.description,
+      //   activeTime,
+      //   courseTime,
+      //   marketPrice: data.marketPrice,
+      //   organ: data.organId.split(",").map((organ) => {
+      //     return Number(organ);
+      //   }),
+      //   activityType: data.activityType,
+      //   applyToStudentType,
+      //   studentMaxUsedTimes,
+      //   isPayToBalance: Number(data.payToBalance),
+      //   id: this.$route.query.id,
+      // };
       // this.$set()
       //格式化payForm
       // console.log(data.vipGroupCategoryIdList