Explorar el Código

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

mo hace 4 años
padre
commit
a146685576

+ 6 - 6
src/views/resetTeaming/components/resetPayList.vue

@@ -98,7 +98,7 @@
         </el-table-column>
         <el-table-column label="操作"
                          fixed="right"
-                         min-width="60px">
+                         min-width="120px">
           <template slot-scope="scope">
             <div>
               <el-button type="text"
@@ -110,16 +110,16 @@
               <!-- <el-button type="text"
                          @click="openChioseStudent(scope.row)"
                          v-if="scope.row.status != 'REJECT' && scope.row.status != 'AUDITING'&&teamStatus && scope.row.paymentType != 'MUSIC_APPLY' && scope.row.paymentType != 'ADD_STUDENT'"
-                         v-permission="'musicGroupPaymentCalenderDetail/batchAdd'">添加学员</el-button>
+                         v-permission="'musicGroupPaymentCalenderDetail/batchAdd'">添加学员</el-button> -->
               <el-button type="text"
-                         v-if="scope.row.status == 'REJECT'&&teamStatus"
+                         v-if="teamStatus && scope.row.auditStatus === 'REJECT'"
                          v-permission="'musicGroupPaymentCalender/update'"
                          @click="resetPay(scope.row)">修改</el-button>
 
-              <el-button type="text"
+              <!-- <el-button type="text"
                          v-if="!isNewGropu&&teamStatus&&scope.row.paymentType!='MUSIC_APPLY'"
-                         @click="onCreateQRCode(scope.row)">续费二维码</el-button>
-              <el-button type="text"
+                         @click="onCreateQRCode(scope.row)">续费二维码</el-button> -->
+              <!-- <el-button type="text"
                          v-if="isNewGropu"
                          v-permission="'musicGroup/findMusicGroupSubjectInfo/966'"
                          @click="onPreview(scope.row)">预览</el-button> -->

+ 5 - 5
src/views/resetTeaming/components/resetPayListSchool.vue

@@ -110,16 +110,16 @@
               <!-- <el-button type="text"
                          @click="openChioseStudent(scope.row)"
                          v-if="scope.row.status != 'REJECT' && scope.row.status != 'AUDITING'&&teamStatus && scope.row.paymentType != 'MUSIC_APPLY' && scope.row.paymentType != 'ADD_STUDENT'"
-                         v-permission="'musicGroupPaymentCalenderDetail/batchAdd'">添加学员</el-button>
+                         v-permission="'musicGroupPaymentCalenderDetail/batchAdd'">添加学员</el-button> -->
               <el-button type="text"
-                         v-if="scope.row.status == 'REJECT'&&teamStatus"
+                         v-if="teamStatus && scope.row.auditStatus === 'REJECT'"
                          v-permission="'musicGroupPaymentCalender/update'"
                          @click="resetPay(scope.row)">修改</el-button>
 
-              <el-button type="text"
+              <!-- <el-button type="text"
                          v-if="!isNewGropu&&teamStatus&&scope.row.paymentType!='MUSIC_APPLY'"
-                         @click="onCreateQRCode(scope.row)">续费二维码</el-button>
-              <el-button type="text"
+                         @click="onCreateQRCode(scope.row)">续费二维码</el-button> -->
+              <!-- <el-button type="text"
                          v-if="isNewGropu"
                          v-permission="'musicGroup/findMusicGroupSubjectInfo/966'"
                          @click="onPreview(scope.row)">预览</el-button> -->

+ 3 - 3
src/views/resetTeaming/modals/pay-items.vue

@@ -52,7 +52,7 @@
         </template>
       </el-table-column>
       <el-table-column align="center" prop="memo" label="备注"></el-table-column>
-      <el-table-column label="操作" fixed="right" min-width="260px">
+      <el-table-column label="操作" fixed="right" min-width="200px">
         <template slot-scope="scope">
           <div>
             <el-button
@@ -74,13 +74,13 @@
               v-permission="'musicGroupPaymentCalenderDetail/batchAdd'"
               >添加学员</el-button
             >
-            <el-button
+            <!-- <el-button
               type="text"
               v-if="scope.row.status == 'REJECT' && teamStatus"
               v-permission="'musicGroupPaymentCalender/update'"
               @click="$listeners.resetPay(scope.row)"
               >修改</el-button
-            >
+            > -->
             <el-button
               type="text"
               v-permission="'musicGroupPaymentCalender/makesureSchoolePaid'"

+ 50 - 25
src/views/resetTeaming/modals/user-pay-form.vue

@@ -48,7 +48,7 @@
                 class="alert"
                 type="info">
       </el-alert>
-      <template v-if="isUserType && paymentType == '0'">
+      <template v-if="isMulticycle">
         <el-form ref="payment" :model="payment">
           <el-form-item
             label-width="160px"
@@ -137,6 +137,7 @@ import {
   musicGroupPaymentCalenderAdd,
   musicGroupPaymentCalenderDetailBatchUpdate,
   queryByMusicGroupOrganizationCourseSettingsId,
+  musicGroupPaymentCalenderView,
 } from "../api";
 import { paymentPatternType } from '@/constant'
 import { getTimes, objectToOptions } from "@/utils";
@@ -184,6 +185,7 @@ export default {
       payment: {
         paymentPattern: null,
       },
+      viewDetail: null,
       organizationCourseUnitPriceSettingsByType: {},
       paymentPatternTypeOptions: objectToOptions(paymentPatternType),
     };
@@ -210,6 +212,23 @@ export default {
     },
     paymentAmountDisabled() {
       return (this.isUserType || (this.isCommon && this.isUserType)) && this.isDisabled
+    },
+    isMulticycle() {
+      let editMulticycle = false
+      if (this.viewDetail) {
+        const { musicGroupPaymentCalenders, auditDto } = this.viewDetail
+        editMulticycle = (musicGroupPaymentCalenders > 1 ||
+          musicGroupPaymentCalenders[0]?.paymentType == 'MUSIC_APPLY')
+        if (editMulticycle) {
+          this.$set(this.payment, 'paymentPattern', String(auditDto?.paymentPattern))
+          this.cycles = musicGroupPaymentCalenders.map(item => ({
+            paymentAmount: item.paymentAmount,
+            paymentDate: [item?.startPaymentDate, item?.deadlinePaymentDate],
+            paymentValid: [item?.paymentValidStartDate, item?.paymentValidEndDate]
+          }))
+        }
+      }
+      return this.isUserType && this.paymentType == '0' || editMulticycle
     }
   },
   watch: {
@@ -240,16 +259,18 @@ export default {
       }
     },
     async "form.musicGroupOrganizationCourseSettingId" (val) {
-      try {
-        const res = await queryByMusicGroupOrganizationCourseSettingsId({
-          id: val
-        })
-        this.eclass = res.data.filter(item => {
-          return !item.isStudentOptional || this.paymentType !== undefined
-        }) || [{}];
+      if (val) {
+        try {
+          const res = await queryByMusicGroupOrganizationCourseSettingsId({
+            id: val
+          })
+          this.eclass = res.data.filter(item => {
+            return !item.isStudentOptional || this.paymentType !== undefined
+          }) || [{}];
 
-        this.syncAllMoney();
-      } catch (error) { }
+          this.syncAllMoney();
+        } catch (error) { }
+      }
     },
   },
   mounted () {
@@ -278,17 +299,18 @@ export default {
           this.rowDetail.isGiveMusicNetwork
         );
         this.$set(this.other, "memo", this.rowDetail.memo);
-        if (this.rowDetail.musicGroupOrganizationCourseSettingId) {
-          this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
-        } else {
-          try {
-            const res = await getMusicGroupPaymentCalenderDetail({
-              id: this.rowDetail.id
-            })
-            this.eclass = res.data.musicGroupPaymentCalenderCourseSettings
-            this.syncAllMoney()
-          } catch (error) {}
-        }
+        try {
+          const res = await musicGroupPaymentCalenderView({
+            musicGroupId: this.musicGroupId,
+            batchNo: this.rowDetail.batchNo,
+          })
+          this.viewDetail = res.data
+          this.eclass = (res.data.musicGroupPaymentCalenderCourseSettings || []).filter(item => {
+            return !item.isStudentOptional || this.paymentType !== undefined
+          })
+          this.$set(this.form, 'musicGroupOrganizationCourseSettingId', res.data.auditDto?.musicGroupOrganizationCourseSettingsId)
+          this.syncAllMoney()
+        } catch (error) {}
       }
     },
     formatCourse() {
@@ -325,7 +347,6 @@ export default {
           } else {
             const floorMoney = Math.floor((item.courseCurrentPrice * 100) / this.cycles.length)
             const remainder = (item.courseCurrentPrice * 100) % this.cycles.length
-            console.log(remainder, item.courseCurrentPrice, this.cycles.length)
             first += floorMoney + remainder
             other += floorMoney
           }
@@ -404,13 +425,17 @@ export default {
     },
     addCycle () {
       this.cycles.push({});
-      this.collapse.push(this.collapse.length);
+      this.collapse.push(this.cycles.length - 1);
       this.syncAllMoney()
     },
     removeCycle (index) {
       this.cycles[index] = null;
       this.cycles = this.cycles.filter((item) => !!item);
-      this.collapse.pop();
+      if (this.collapse.includes(index)) {
+        this.collapse.splice(index, 1);
+        this.collapse = this.collapse.map((item, _index) => _index - 1 >= index ? item -- : item)
+        console.log(this.collapse)
+      }
       this.syncAllMoney()
     },
     collapseChange (val) {
@@ -501,7 +526,7 @@ export default {
           try {
             data.batchNo = this.rowDetail.batchNo
             // 缴费类型无法修改,按照之前覆盖
-            data.paymentType = this.rowDetail.paymentType
+            data.paymentType = this.viewDetail.musicGroupPaymentCalenders[0]?.paymentType
             const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
             this.$listeners.close();
             this.$listeners.submited(res.data);