Przeglądaj źródła

修改 VIP 传参

1
mo 3 lat temu
rodzic
commit
9e8e644ffb
1 zmienionych plików z 47 dodań i 24 usunięć
  1. 47 24
      src/views/buildVip/index.vue

+ 47 - 24
src/views/buildVip/index.vue

@@ -1206,7 +1206,11 @@ export default {
       }
       this.activeStudentList = [];
       this.studentList.forEach((stu) => {
-        if (this.chioseStudent.indexOf(stu.userId) != -1) {
+        if (
+          Array.isArray(this.chioseStudent)
+            ? this.chioseStudent.indexOf(stu.userId) != -1
+            : stu.userId == this.chioseStudent
+        ) {
           let discount = this.rightForm.discount
             ? this.rightForm.discount
             : 100;
@@ -1244,6 +1248,7 @@ export default {
       this.leftForm.courseEnd = "";
       this.hasOnline = true;
       this.hasOffline = true;
+
       if (val) {
         for (let i in this.courseTypeList) {
           if (this.courseTypeList[i].id == this.leftForm.courseType) {
@@ -1285,30 +1290,48 @@ export default {
             this.salaryReadonlyFlag = this.activeList[i].salaryReadonlyFlag;
             this.paymentReadonlyFlag = this.activeList[i].paymentReadonlyFlag;
             //  hasOnline: false, hasOffline: false 还需要判断type类型 根据活动id获取
-            if (this.activeList[i].salarySettlementJson) {
-              let obj = JSON.parse(this.activeList[i].salarySettlementJson);
-              if (obj && obj.onlineSalarySettlement) {
-                // 有线上课
-                this.hasOnline = true;
-                this.onlineSalary =
-                  obj.onlineSalarySettlement.salarySettlementType;
-                //  ('线上:' + this.onlineSalary)
-              } else {
-                this.hasOnline = false;
-              }
-              if (obj && obj.offlineSalarySettlement) {
-                // 有线下课
-                this.hasOffline = true;
-                this.offlineSalary =
-                  obj.offlineSalarySettlement.salarySettlementType;
-                //  ('线下:' + this.offlineSalary)
-              } else {
+            // if (this.activeList[i].salarySettlementJson) {
+            //   let obj = JSON.parse(this.activeList[i].salarySettlementJson);
+            //   if (obj && obj.onlineSalarySettlement) {
+            //     // 有线上课
+            //     this.hasOnline = true;
+            //     this.onlineSalary =
+            //       obj.onlineSalarySettlement.salarySettlementType;
+            //     //  ('线上:' + this.onlineSalary)
+            //   } else {
+            //     this.hasOnline = false;
+            //   }
+            //   if (obj && obj.offlineSalarySettlement) {
+            //     // 有线下课
+            //     this.hasOffline = true;
+            //     this.offlineSalary =
+            //       obj.offlineSalarySettlement.salarySettlementType;
+            //     //  ('线下:' + this.offlineSalary)
+            //   } else {
+            //     this.hasOffline = false;
+            //   }
+            // }
+            if (this.courseType == "PRACTICE") {
+              this.hasOffline = false;
+              this.hasOnline = true;
+            } else {
+              if (this.activeList[i].teachMode == 0) {
                 this.hasOffline = false;
+                // -1:所有;0:线上;1:线下"
+              }
+              if (this.activeList[i].teachMode == 1) {
+                this.hasOnline = false;
               }
             }
+
             this.activeStudentList = [];
+
             this.studentList.forEach((stu) => {
-              if (this.chioseStudent.indexOf(stu.userId) != -1) {
+              if (
+                Array.isArray(this.chioseStudent)
+                  ? this.chioseStudent.indexOf(stu.userId) != -1
+                  : stu.userId == this.chioseStudent
+              ) {
                 let discount = this.rightForm.discount
                   ? this.rightForm.discount
                   : 100;
@@ -1788,7 +1811,7 @@ export default {
       if (this.courseType == "PRACTICE") {
         studentIdList = this.leftForm.students;
         obj.practiceGroupApplyBaseInfoDto = {
-            studentId: studentIdList, // 这个不要了
+          studentId: studentIdList, // 这个不要了
           vipGroupStudentCoursePrices: this.activeStudentList,
           coursesExpireDate: this.leftForm.courseEnd,
           teacherSchoolId: this.leftForm.section,
@@ -1811,12 +1834,12 @@ 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;
         obj.vipGroupApplyBaseInfo = {
-          studentId: studentIdList, // 这个不要了
+         studentIdList, // 这个不要了
           vipGroupStudentCoursePrices: this.activeStudentList,
           coursesExpireDate: this.leftForm.courseEnd,
           teacherSchoolId: this.leftForm.section,