|
@@ -13,6 +13,7 @@
|
|
|
@getCharges="getCharges"
|
|
|
:typeList="typeList"
|
|
|
:charges="charges"
|
|
|
+ :paymentType="paymentType"
|
|
|
ref="base"
|
|
|
/>
|
|
|
<template v-if="!isCommon">
|
|
@@ -30,13 +31,14 @@
|
|
|
/>
|
|
|
</template>
|
|
|
<extraClass
|
|
|
- v-else
|
|
|
+ v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
|
:form="eclass"
|
|
|
ref="eclass"
|
|
|
+ :isCommon="isCommon"
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
/>
|
|
|
- <template v-if="isUserType">
|
|
|
+ <template>
|
|
|
<el-alert
|
|
|
title="缴费设置"
|
|
|
:closable="false"
|
|
@@ -45,6 +47,7 @@
|
|
|
</el-alert>
|
|
|
<paymentCycle
|
|
|
ref="cycle"
|
|
|
+ :isUserType="isUserType"
|
|
|
:form.sync="cycle"
|
|
|
/>
|
|
|
</template>
|
|
@@ -54,6 +57,10 @@
|
|
|
class="alert"
|
|
|
type="info">
|
|
|
</el-alert>
|
|
|
+ <otherform
|
|
|
+ :form="other"
|
|
|
+ ref="other"
|
|
|
+ />
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
|
<el-button
|
|
@@ -81,25 +88,28 @@ import userBaseinfo from './user-baseinfo'
|
|
|
import paymentCycle from './payment-cycle'
|
|
|
import extraClass from './extra-class'
|
|
|
import classrooms from './classrooms'
|
|
|
+import otherform from './other'
|
|
|
|
|
|
export default {
|
|
|
- props: ['type', 'musicGroupId', 'baseInfo'],
|
|
|
+ props: ['type', 'musicGroupId', 'baseInfo', 'paymentType'],
|
|
|
components: {
|
|
|
userBaseinfo,
|
|
|
paymentCycle,
|
|
|
extraClass,
|
|
|
classrooms,
|
|
|
+ otherform
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
options: [],
|
|
|
form: {
|
|
|
payUserType: this.type === 'user' ? 'STUDENT' : 'SCHOOL',
|
|
|
- leixing: '0',
|
|
|
+ leixing: '1',
|
|
|
},
|
|
|
+ other: {},
|
|
|
cycles: [{}],
|
|
|
cycle: {},
|
|
|
- eclass: [{}],
|
|
|
+ eclass: [],
|
|
|
collapse: [],
|
|
|
nextVisible: false,
|
|
|
typeList: [],
|
|
@@ -125,24 +135,25 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- eclass() {
|
|
|
- console.log([...this.eclass])
|
|
|
- },
|
|
|
baseInfo() {
|
|
|
- const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId
|
|
|
- this.getCharges(chargeTypeId)
|
|
|
+ this.getCharges()
|
|
|
},
|
|
|
'form.leixing'() {
|
|
|
this.cycles = [{}]
|
|
|
this.collapse = [0]
|
|
|
this.cycle = {}
|
|
|
+ if (this.form.leixing === '1') {
|
|
|
+ this.eclass = []
|
|
|
+ } else if (this.form.leixing === '2') {
|
|
|
+ this.eclass = [{}]
|
|
|
+ }
|
|
|
},
|
|
|
'form.musicGroupOrganizationCourseSettingId'() {
|
|
|
this.eclass = this.chargesById[this.form.musicGroupOrganizationCourseSettingId]?.details || []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getChargeTypeList()
|
|
|
+ this.getCharges()
|
|
|
},
|
|
|
methods: {
|
|
|
async getChargeTypeList() {
|
|
@@ -153,7 +164,8 @@ export default {
|
|
|
this.typeList = res.data.rows
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
- async getCharges(chargeTypeId) {
|
|
|
+ async getCharges() {
|
|
|
+ const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId
|
|
|
try {
|
|
|
const res = await musicGroupOrganizationCourseSettingsQueryPage({
|
|
|
row: 9999,
|
|
@@ -186,7 +198,7 @@ export default {
|
|
|
},
|
|
|
getForms() {
|
|
|
const { $refs: refs } = this
|
|
|
- return [refs.base, refs.eclass, refs.cycle]
|
|
|
+ return [refs.base, refs.eclass, refs.cycle, refs.other]
|
|
|
.filter(item => !!item)
|
|
|
.map(item => item.$refs.form)
|
|
|
},
|
|
@@ -202,14 +214,15 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
if (valided.length === forms.length) {
|
|
|
- const { paymentDate, paymentValid, leixing, ...rest } = {...this.form, ...this.cycle, musicGroupPaymentCalenderCourseSettingsList: this.eclass}
|
|
|
+ const { paymentDate, paymentValid, leixing, ...rest } = {...this.form, ...this.other, ...this.cycle, musicGroupPaymentCalenderCourseSettingsList: this.eclass}
|
|
|
const data = {
|
|
|
...rest,
|
|
|
- paymentType: leixing,
|
|
|
+ paymentType: (this.paymentType == 0 ? this.paymentType : leixing),
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
...getTimes(paymentDate, ['startPaymentDate', 'deadlinePaymentDate']),
|
|
|
...getTimes(paymentValid, ['paymentValidStartDate', 'paymentValidEndDate']),
|
|
|
}
|
|
|
+ console.log(data)
|
|
|
try {
|
|
|
await musicGroupPaymentCalenderAdd(data)
|
|
|
} catch (error) {}
|