|
@@ -28,6 +28,7 @@
|
|
|
ref="eclass"
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
/>
|
|
|
</template>
|
|
|
<extraClass
|
|
@@ -37,6 +38,7 @@
|
|
|
:isCommon="isCommon"
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
/>
|
|
|
<template>
|
|
|
<el-alert
|
|
@@ -90,6 +92,13 @@ import extraClass from './extra-class'
|
|
|
import classrooms from './classrooms'
|
|
|
import otherform from './other'
|
|
|
|
|
|
+const paymentTypeFormat = {
|
|
|
+ 0: 'MUSIC_RENEW',
|
|
|
+ 1: 'ADD_COURSE',
|
|
|
+ 2: 'MUSIC_RENEW',
|
|
|
+ 3: 'MUSIC_APPLY',
|
|
|
+}
|
|
|
+
|
|
|
export default {
|
|
|
props: ['type', 'musicGroupId', 'baseInfo', 'paymentType'],
|
|
|
components: {
|
|
@@ -142,6 +151,7 @@ export default {
|
|
|
this.cycles = [{}]
|
|
|
this.collapse = [0]
|
|
|
this.cycle = {}
|
|
|
+ this.cycle.money = ''
|
|
|
if (this.form.leixing === '1') {
|
|
|
this.eclass = []
|
|
|
} else if (this.form.leixing === '2') {
|
|
@@ -151,12 +161,21 @@ export default {
|
|
|
},
|
|
|
'form.musicGroupOrganizationCourseSettingId'() {
|
|
|
this.eclass = this.chargesById[this.form.musicGroupOrganizationCourseSettingId]?.details || []
|
|
|
+ this.syncAllMoney()
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getCharges()
|
|
|
},
|
|
|
methods: {
|
|
|
+ syncAllMoney() {
|
|
|
+ let money = 0
|
|
|
+ for (const item of this.eclass) {
|
|
|
+ money += item.courseCurrentPrice
|
|
|
+ }
|
|
|
+ this.$set(this.cycle, 'money', money)
|
|
|
+ return money
|
|
|
+ },
|
|
|
async getChargeTypeList() {
|
|
|
try {
|
|
|
const res = await chargeTypeList({
|
|
@@ -218,7 +237,7 @@ export default {
|
|
|
const { paymentDate, paymentValid, leixing, ...rest } = {...this.form, ...this.other, ...this.cycle, musicGroupPaymentCalenderCourseSettingsList: this.eclass}
|
|
|
const data = {
|
|
|
...rest,
|
|
|
- paymentType: (this.paymentType == 0 ? this.paymentType : leixing),
|
|
|
+ paymentType: paymentTypeFormat[(this.paymentType == 0 ? this.paymentType : leixing)],
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
...getTimes(paymentDate, ['startPaymentDate', 'deadlinePaymentDate']),
|
|
|
...getTimes(paymentValid, ['paymentValidStartDate', 'paymentValidEndDate']),
|