Browse Source

Merge branch 'Nov16thResetMusic' of http://git.dayaedu.com/molingzhide/dy-admin-manager into Nov16thResetMusic

mo 4 years ago
parent
commit
4d1a6c9864
1 changed files with 18 additions and 16 deletions
  1. 18 16
      src/views/resetTeaming/modals/user-pay-form.vue

+ 18 - 16
src/views/resetTeaming/modals/user-pay-form.vue

@@ -182,6 +182,7 @@ export default {
       nextVisible: false,
       typeList: [],
       charges: [],
+      studentIds: '',
       payment: {
         paymentPattern: null,
       },
@@ -308,6 +309,22 @@ export default {
           this.eclass = (res.data.musicGroupPaymentCalenderCourseSettings || []).filter(item => {
             return !item.isStudentOptional || this.paymentType !== undefined
           })
+          const firstPayment = res.data.musicGroupPaymentCalenders[0] || {}
+          if (this.$refs.cycle) {
+            this.$set(
+              this.cycle,
+              "paymentPattern",
+              firstPayment.paymentPattern + ""
+            );
+            let arr = [
+              firstPayment.paymentValidStartDate,
+              firstPayment.paymentValidEndDate,
+            ];
+            // paymentDate startPaymentDate deadlinePaymentDate
+            this.$set(this.cycle, "paymentDate", [firstPayment.startPaymentDate, firstPayment.deadlinePaymentDate]);
+            this.$set(this.cycle, "paymentValid", arr);
+          }
+          this.studentIds = firstPayment.studentIds
           this.$set(this.form, 'musicGroupOrganizationCourseSettingId', res.data.auditDto?.musicGroupOrganizationCourseSettingsId)
           this.syncAllMoney()
         } catch (error) {}
@@ -374,20 +391,6 @@ export default {
       // } else {
         this.$set(this.cycle, "paymentAmount", money);
       // }
-      if (this.rowDetail) {
-        this.$set(
-          this.cycle,
-          "paymentPattern",
-          this.rowDetail?.paymentPattern + ""
-        );
-        let arr = [
-          this.rowDetail?.paymentValidStartDate,
-          this.rowDetail?.paymentValidEndDate,
-        ];
-        // paymentDate startPaymentDate deadlinePaymentDate
-        this.$set(this.cycle, "paymentDate", [this.rowDetail?.startPaymentDate, this.rowDetail?.deadlinePaymentDate]);
-        this.$set(this.cycle, "paymentValid", arr);
-      }
 
       return money;
     },
@@ -501,14 +504,13 @@ export default {
         const data = {
           ...rest,
           isGiveMusicNetwork: false,
+          studentIds: this.studentIds,
           paymentType:
             paymentTypeFormat[
               this.paymentType == 0 ? this.paymentType : leixing
             ],
           musicGroupId: this.musicGroupId,
         };
-        // console.log(data)
-        // return
         if (!this.rowDetail?.batchNo) {
           try {
             const res = await musicGroupPaymentCalenderAdd(data);