Browse Source

修改多周期缴费问题

wolyshaw 4 years ago
parent
commit
ece5ce59d8

+ 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"
                          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> -->

+ 4 - 4
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-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'"

+ 24 - 3
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: {
@@ -282,9 +301,11 @@ export default {
           this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
         } else {
           try {
-            const res = await getMusicGroupPaymentCalenderDetail({
-              id: this.rowDetail.id
+            const res = await musicGroupPaymentCalenderView({
+              musicGroupId: this.musicGroupId,
+              batchNo: this.rowDetail.batchNo,
             })
+            this.viewDetail = res.data
             this.eclass = res.data.musicGroupPaymentCalenderCourseSettings
             this.syncAllMoney()
           } catch (error) {}