瀏覽代碼

修复会员团必选课程和云教练

1
mo 2 年之前
父節點
當前提交
680e94973c
共有 2 個文件被更改,包括 74 次插入172 次删除
  1. 52 100
      src/views/resetTeaming/components/payInfoDetail.vue
  2. 22 72
      src/views/teamDetail/teamList.vue

+ 52 - 100
src/views/resetTeaming/components/payInfoDetail.vue

@@ -28,11 +28,7 @@
                     placeholder="请选择计价标准"
                   >
                     <el-option label="按学生" value="STUDENT"> </el-option>
-                    <el-option
-                      label="按老师"
-                      value="TEACHER"
-                      :disabled="!teamCourse"
-                    >
+                    <el-option label="按老师" value="TEACHER" :disabled="!teamCourse">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -75,10 +71,7 @@
                 </div>
                 <div
                   class="checkBtn"
-                  :class="[
-                    member ? 'active' : '',
-                    memberDisabled ? 'disabled' : '',
-                  ]"
+                  :class="[member ? 'active' : '', memberDisabled ? 'disabled' : '']"
                   @click.prevent="
                     () => {
                       if (memberDisabled) return;
@@ -103,15 +96,10 @@
                 </div>
                 <div
                   v-if="
-                    isShowLeBao &&
-                    tenantId == 1 &&
-                    $route.query.team_status != 'PROGRESS'
+                    isShowLeBao && tenantId == 1 && $route.query.team_status != 'PROGRESS'
                   "
                   class="checkBtn"
-                  :class="[
-                    leBao ? 'active' : '',
-                    leBaoDisabled ? 'disabled' : '',
-                  ]"
+                  :class="[leBao ? 'active' : '', leBaoDisabled ? 'disabled' : '']"
                   @click.prevent="
                     () => {
                       if (leBaoDisabled) return;
@@ -169,9 +157,7 @@
               <payTeamCourse
                 :form="form"
                 :charges="charges"
-                :courseUnitPriceSettingsByType="
-                  organizationCourseUnitPriceSettingsByType
-                "
+                :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
                 v-if="teamCourse"
                 @create="addExtraClass"
                 @remove="removeExtraClass"
@@ -199,9 +185,7 @@
               />
               <paySchoolInfo
                 :form="form"
-                :courseUnitPriceSettingsByType="
-                  organizationCourseUnitPriceSettingsByType
-                "
+                :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
                 :teamCourse="teamCourse"
                 :member="member"
                 :teamActive="teamActive"
@@ -211,10 +195,7 @@
                 @checkType="checkType"
               />
               <backMoney
-                v-if="
-                  $route.query.payUserType == 'SCHOOL' &&
-                  form.currentTotalAmount > 0
-                "
+                v-if="$route.query.payUserType == 'SCHOOL' && form.currentTotalAmount > 0"
                 :form="form"
               />
             </div>
@@ -540,22 +521,19 @@ export default {
     async init() {
       this.organId = this.musicGroup?.organId;
       this.courseViewType = this.baseInfo?.musicGroup?.courseViewType;
-      if (
-        this.courseViewType != 2 &&
-        this.$route.query.team_status == "DRAFT"
-      ) {
+      if (this.courseViewType != 2 && this.$route.query.team_status == "DRAFT") {
         // 课程团的创建缴费
         this.teamCourse = true;
         // 现在课程团不在
         // this.teamCourseDisabled = true;
         this.form.paymentType = "MUSIC_APPLY";
-      } else if (
-        this.courseViewType == 2 &&
-        this.$route.query.team_status == "DRAFT"
-      ) {
+      } else if (this.courseViewType == 2 && this.$route.query.team_status == "DRAFT") {
         // 会员团的创建缴费
         this.member = true;
         this.memberDisabled = true;
+        // 乐团创建缴费时,若乐团【收费模式】为【会员收费】,则缴费项目中【课程】【会员】两项都默认选中且必选,不可去掉
+        this.teamCourse = true;
+        this.teamCourseDisabled = true;
       } else if (this.$route.query.team_status == "PROGRESS") {
         this.leBao = false;
         this.leBaoDisabled = true;
@@ -603,11 +581,7 @@ export default {
               ]);
             }
 
-            this.$set(
-              this.form,
-              "contractUrl",
-              res.data?.calender?.contractUrl
-            );
+            this.$set(this.form, "contractUrl", res.data?.calender?.contractUrl);
             this.$set(this.form, "memo", res.data?.calender?.memo);
 
             this.$set(
@@ -618,19 +592,14 @@ export default {
             this.$set(
               this.form,
               "isShowMusicInsuranceForPay",
-              res.data?.calender?.paymentItemShowState
-                ?.isShowMusicInsuranceForPay
+              res.data?.calender?.paymentItemShowState?.isShowMusicInsuranceForPay
             );
             this.$set(
               this.form,
               "isShowVipCourseForPay",
               res.data?.calender?.paymentItemShowState?.isShowVipCourseForPay
             );
-            this.$set(
-              this.form,
-              "isShowSalePrice",
-              res.data?.calender?.isShowSalePrice
-            );
+            this.$set(this.form, "isShowSalePrice", res.data?.calender?.isShowSalePrice);
             this.$set(
               this.form,
               "isShowMusicCourseForPay",
@@ -647,21 +616,17 @@ export default {
             }
             if (res.data?.course?.length > 0) {
               this.$set(
-                  this.form,
-                  "calenderFeeType",
-                  res.data?.calender?.calenderFeeType
-                );
+                this.form,
+                "calenderFeeType",
+                res.data?.calender?.calenderFeeType
+              );
               this.$nextTick(() => {
                 this.teamCourse = true;
 
                 this.$set(this.form, "eclass", res.data?.course);
                 console.log([...res.data?.course], "res.data?.course");
                 this.initDetail = true;
-                this.$set(
-                  this.form,
-                  "payUserType",
-                  res.data?.calender?.payUserType
-                );
+                this.$set(this.form, "payUserType", res.data?.calender?.payUserType);
 
                 this.$set(
                   this.form,
@@ -746,9 +711,7 @@ export default {
         const paramName = "cloud_price_range";
         res.data.forEach((item) => {
           if (item.paramName == paramName) {
-            const itemValue = item.paranValue
-              ? JSON.parse(item.paranValue)
-              : null;
+            const itemValue = item.paranValue ? JSON.parse(item.paranValue) : null;
             if (itemValue) {
               this.rulesForm = itemValue;
             }
@@ -883,9 +846,7 @@ export default {
           if (item.isStudentOptional) {
             first += item.courseCurrentPrice;
           } else {
-            const floorMoney = Math.floor(
-              item.courseCurrentPrice / this.cycles.length
-            );
+            const floorMoney = Math.floor(item.courseCurrentPrice / this.cycles.length);
             const remainder = item.courseCurrentPrice % this.cycles.length;
             first += floorMoney + remainder;
             other += floorMoney;
@@ -928,22 +889,20 @@ export default {
     async onPreview() {
       // 开始预览
       const musicGroupId = this.$route.query.id;
-      await findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then(
-        (res) => {
-          if (res.code == 200) {
-            this.dialogSubjectList = res.data.musicGroupSubjectPlans;
-            // 默认预览第一个
-            if (this.dialogSubjectList.length <= 0) {
-              this.$message.error("请先设置声部信息");
-              return;
-            }
-            this.activeName = this.dialogSubjectList[0].subjectId.toString();
-            this.dialogSubjectVisible = true;
-          } else {
-            this.$message.warning("没有可预览的声部");
+      await findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then((res) => {
+        if (res.code == 200) {
+          this.dialogSubjectList = res.data.musicGroupSubjectPlans;
+          // 默认预览第一个
+          if (this.dialogSubjectList.length <= 0) {
+            this.$message.error("请先设置声部信息");
+            return;
           }
+          this.activeName = this.dialogSubjectList[0].subjectId.toString();
+          this.dialogSubjectVisible = true;
+        } else {
+          this.$message.warning("没有可预览的声部");
         }
-      );
+      });
     },
     checkType() {
       this.$refs.form.validate();
@@ -953,11 +912,15 @@ export default {
         if (isok) {
           // 学校缴费没有预览
           if (this.$route.query.payUserType == "SCHOOL") {
-            this.$confirm(this.$route.query.calenderId?"是否修改缴费":"是否创建缴费?", "提示", {
-              confirmButtonText: "确定",
-              cancelButtonText: "取消",
-              type: "warning",
-            })
+            this.$confirm(
+              this.$route.query.calenderId ? "是否修改缴费" : "是否创建缴费?",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }
+            )
               .then(() => {
                 this.onSubmit();
               })
@@ -1076,8 +1039,7 @@ export default {
           }
         });
       }
-      let memberObj =
-        form.memberList?.length > 0 ? { ...form.memberList[0] } : null;
+      let memberObj = form.memberList?.length > 0 ? { ...form.memberList[0] } : null;
       // 获取会员名称
       if (memberObj) {
         this.memberRankList.forEach((item) => {
@@ -1133,9 +1095,7 @@ export default {
           calenderActivityList:
             this.form.activeList?.length > 0 ? this.form.activeList : null,
           musicRepair:
-            this.form.leBaoList?.length > 0
-              ? { ...this.form.leBaoList[0] }
-              : null,
+            this.form.leBaoList?.length > 0 ? { ...this.form.leBaoList[0] } : null,
           calenderMember:
             this.form.memberList?.length > 0 &&
             this.form.memberList[0]?.memberRankSettingId
@@ -1168,9 +1128,7 @@ export default {
           calenderActivityList:
             this.form.activeList?.length > 0 ? this.form.activeList : null,
           musicRepair:
-            this.form.leBaoList?.length > 0
-              ? { ...this.form.leBaoList[0] }
-              : null,
+            this.form.leBaoList?.length > 0 ? { ...this.form.leBaoList[0] } : null,
           calenderMember:
             this.form.memberList?.length > 0 &&
             this.form.memberList[0]?.memberRankSettingId
@@ -1187,8 +1145,7 @@ export default {
           }),
           calenderFeeType: this.form.calenderFeeType,
           calenderFeeJson: JSON.stringify(calenderFeeJson),
-          musicGroupCalenderRefundPeriods:
-            this.form.musicGroupCalenderRefundPeriods,
+          musicGroupCalenderRefundPeriods: this.form.musicGroupCalenderRefundPeriods,
           currentTotalAmount: this.form.currentTotalAmount,
           contractUrl: this.form.contractUrl,
         };
@@ -1209,8 +1166,7 @@ export default {
       this.form.calenderFeeJson.allTotal = val;
       if (this.form.calenderFeeJson.discountTotal) {
         this.form.currentTotalAmount =
-          this.form.calenderFeeJson.allTotal -
-          this.form.calenderFeeJson.discountTotal;
+          this.form.calenderFeeJson.allTotal - this.form.calenderFeeJson.discountTotal;
       } else {
         this.form.currentTotalAmount = this.form.calenderFeeJson.allTotal;
       }
@@ -1287,9 +1243,9 @@ export default {
       // console.log(val,'form.currentTotalAmount');
       // this.$forceUpdate()
     },
-    "form.calenderFeeType"(val,oldValue) {
-      console.log(val,oldValue,this.initDetail)
-      if (val == "TEACHER"&&!this.initDetail ) {
+    "form.calenderFeeType"(val, oldValue) {
+      console.log(val, oldValue, this.initDetail);
+      if (val == "TEACHER" && !this.initDetail) {
         let arr = [];
         this.form.eclass.forEach((item) => {
           arr.push({
@@ -1329,11 +1285,7 @@ export default {
       this.cycle = {};
 
       if (val != "1") {
-        this.$set(
-          this.form,
-          "musicGroupOrganizationCourseSettingId",
-          undefined
-        );
+        this.$set(this.form, "musicGroupOrganizationCourseSettingId", undefined);
       }
 
       // this.$set(this.cycle, "paymentAmount", undefined);

+ 22 - 72
src/views/teamDetail/teamList.vue

@@ -19,7 +19,6 @@
           >申请乐团</el-button
         >
       </div>
-
       <save-form
         :inline="true"
         @submit="search"
@@ -171,10 +170,7 @@
           <el-button type="primary" native-type="reset">重置</el-button>
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="primary"
-            v-permission="'export/musicGroup'"
-            @click="onExport"
+          <el-button type="primary" v-permission="'export/musicGroup'" @click="onExport"
             >导出</el-button
           >
         </el-form-item>
@@ -195,24 +191,14 @@
             align="center"
             label="所属分部"
           ></el-table-column>
-          <el-table-column
-            prop="id"
-            width="100"
-            align="center"
-            label="乐团编号"
-          >
+          <el-table-column prop="id" width="100" align="center" label="乐团编号">
             <template slot-scope="scope">
               <copy-text>
                 {{ scope.row.id }}
               </copy-text>
             </template>
           </el-table-column>
-          <el-table-column
-            prop="name"
-            width="200px"
-            align="center"
-            label="乐团名称"
-          >
+          <el-table-column prop="name" width="200px" align="center" label="乐团名称">
             <template slot-scope="scope">
               <p>
                 {{ scope.row.name }}
@@ -241,35 +227,21 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            prop="chargeTypeName"
-            label="收费类型"
-          >
+          <el-table-column align="center" prop="chargeTypeName" label="收费类型">
           </el-table-column>
-          <el-table-column
-            prop="educationalTeacherName"
-            align="center"
-            label="乐团主管"
-          >
+          <el-table-column prop="educationalTeacherName" align="center" label="乐团主管">
           </el-table-column>
 
-          <el-table-column
-            prop="groupMemberNum"
-            align="center"
-            label="成团人数"
-          >
+          <el-table-column prop="groupMemberNum" align="center" label="成团人数">
           </el-table-column>
           <el-table-column prop="payNum" align="center" label="在读人数">
           </el-table-column>
-          <el-table-column prop="course"
-                           align='center'
-                           label="是否开课">
-                           <template slot-scope="scope">
-                            <div>
-                              {{scope.row.firstCourseStartTime?'是':'否'}}
-                            </div>
-                           </template>
+          <el-table-column prop="course" align="center" label="是否开课">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.firstCourseStartTime ? "是" : "否" }}
+              </div>
+            </template>
           </el-table-column>
           <el-table-column
             prop="createTime"
@@ -304,30 +276,21 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column
-            align="center"
-            width="220px"
-            fixed="right"
-            label="操作"
-          >
+          <el-table-column align="center" width="220px" fixed="right" label="操作">
             <template slot-scope="scope">
               <div>
                 <!-- 审核中 编辑 -->
                 <el-button
                   type="text"
                   v-if="
-                    scope.row.status == 'AUDIT' &&
-                    permission('musicGroup/auditSuccess')
+                    scope.row.status == 'AUDIT' && permission('musicGroup/auditSuccess')
                   "
                   @click="lookTeamDetail(scope.row)"
                   >审核</el-button
                 >
                 <el-button
                   type="text"
-                  v-if="
-                    scope.row.status == 'DRAFT' &&
-                    permission('musicGroup/update')
-                  "
+                  v-if="scope.row.status == 'DRAFT' && permission('musicGroup/update')"
                   @click="lookTeamDetail(scope.row)"
                   >编辑</el-button
                 >
@@ -335,8 +298,7 @@
                 <el-button
                   type="text"
                   v-if="
-                    scope.row.status == 'AUDIT_FAILED' &&
-                    permission('musicGroup/update')
+                    scope.row.status == 'AUDIT_FAILED' && permission('musicGroup/update')
                   "
                   @click="lookTeamDetail(scope.row)"
                   >编辑</el-button
@@ -411,10 +373,7 @@
                 >
 
                 <el-button
-                  v-if="
-                    scope.row.status == 'PREPARE' &&
-                    permission('musicGroup/action')
-                  "
+                  v-if="scope.row.status == 'PREPARE' && permission('musicGroup/action')"
                   @click="startTeam(scope.row)"
                   type="text"
                   >确认成团</el-button
@@ -424,8 +383,7 @@
                            @click="stopTeam(scope.row)">取消乐团</el-button> -->
                 <el-button
                   v-if="
-                    (scope.row.status == 'PAUSE' ||
-                      scope.row.status == 'CLOSE') &&
+                    (scope.row.status == 'PAUSE' || scope.row.status == 'CLOSE') &&
                     permission('musicGroup/resumeMusicGroup')
                   "
                   @click="onTeamOpeation('start', scope.row)"
@@ -523,7 +481,7 @@ export default {
         billTimer: [],
         createTimer: [],
         cooperationOrganId: null,
-        isStartedCourse:null
+        isStartedCourse: null,
       },
       organList: [],
       typeList: [], // 收费类型
@@ -616,12 +574,8 @@ export default {
         courseViewType: this.topForm.courseViewType || null,
         cooperationOrganId: this.topForm.cooperationOrganId || null,
         searchType: this.$route.query.searchType,
-        isStartedCourse:this.topForm.isStartedCourse,
-        ...getTimes(
-          createTimer,
-          ["createStartDate", "createEndDate"],
-          "YYYY-MM-DD"
-        ),
+        isStartedCourse: this.topForm.isStartedCourse,
+        ...getTimes(createTimer, ["createStartDate", "createEndDate"], "YYYY-MM-DD"),
         ...getTimes(billTimer, ["billStartDate", "billEndDate"], "YYYY-MM-DD"),
       }).then((res) => {
         if (res.code == 200) {
@@ -1181,11 +1135,7 @@ export default {
       let obj = {
         ...reset,
         organId: this.topForm.orgin.join(",") || null,
-        ...getTimes(
-          createTimer,
-          ["createStartDate", "createEndDate"],
-          "YYYY-MM-DD"
-        ),
+        ...getTimes(createTimer, ["createStartDate", "createEndDate"], "YYYY-MM-DD"),
         searchType: this.$route.query.searchType,
         ...getTimes(billTimer, ["billStartDate", "billEndDate"], "YYYY-MM-DD"),
       };