|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<el-alert
|
|
<el-alert
|
|
- title="基础信息设置"
|
|
|
|
|
|
+ title="课程信息设置"
|
|
:closable="false"
|
|
:closable="false"
|
|
class="alert"
|
|
class="alert"
|
|
type="info">
|
|
type="info">
|
|
@@ -10,6 +10,9 @@
|
|
:form.sync="form"
|
|
:form.sync="form"
|
|
:isCommon="isCommon"
|
|
:isCommon="isCommon"
|
|
:isUserType="isUserType"
|
|
:isUserType="isUserType"
|
|
|
|
+ @getCharges="getCharges"
|
|
|
|
+ :typeList="typeList"
|
|
|
|
+ :charges="charges"
|
|
ref="base"
|
|
ref="base"
|
|
/>
|
|
/>
|
|
<template v-if="!isCommon">
|
|
<template v-if="!isCommon">
|
|
@@ -26,47 +29,31 @@
|
|
@remove="removeExtraClass"
|
|
@remove="removeExtraClass"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
|
|
+ <extraClass
|
|
|
|
+ v-else
|
|
|
|
+ :form="eclass"
|
|
|
|
+ ref="eclass"
|
|
|
|
+ @create="addExtraClass"
|
|
|
|
+ @remove="removeExtraClass"
|
|
|
|
+ />
|
|
<template v-if="isUserType">
|
|
<template v-if="isUserType">
|
|
<el-alert
|
|
<el-alert
|
|
- title="缴费周期设置"
|
|
|
|
|
|
+ title="缴费设置"
|
|
:closable="false"
|
|
:closable="false"
|
|
class="alert"
|
|
class="alert"
|
|
type="info">
|
|
type="info">
|
|
</el-alert>
|
|
</el-alert>
|
|
- <template v-if="isCommon">
|
|
|
|
- <el-collapse :value="collapse" @change="collapseChange" >
|
|
|
|
- <el-collapse-item
|
|
|
|
- v-for="(item, index) in cycles"
|
|
|
|
- :key="index"
|
|
|
|
- :name="index"
|
|
|
|
- >
|
|
|
|
- <template slot="title">
|
|
|
|
- <div class="collapse-title">
|
|
|
|
- <span>缴费周期 {{index + 1}}</span>
|
|
|
|
- <i v-if="cycles.length > 1" class="el-icon-circle-close" @click.stop="removeCycle(index)"></i>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <paymentCycle
|
|
|
|
- ref="cycles"
|
|
|
|
- :form="item"
|
|
|
|
- />
|
|
|
|
- </el-collapse-item>
|
|
|
|
- </el-collapse>
|
|
|
|
- <el-button
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- plain
|
|
|
|
- type="info"
|
|
|
|
- size="small"
|
|
|
|
- style="width: 100%;margin: 20px 0;"
|
|
|
|
- @click="addCycle"
|
|
|
|
- >新增缴费周期</el-button>
|
|
|
|
- </template>
|
|
|
|
<paymentCycle
|
|
<paymentCycle
|
|
ref="cycle"
|
|
ref="cycle"
|
|
:form.sync="cycle"
|
|
:form.sync="cycle"
|
|
- v-else
|
|
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
|
|
+ <el-alert
|
|
|
|
+ title="其它"
|
|
|
|
+ :closable="false"
|
|
|
|
+ class="alert"
|
|
|
|
+ type="info">
|
|
|
|
+ </el-alert>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -87,13 +74,16 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import { chargeTypeList, musicGroupOrganizationCourseSettingsQueryPage } from '@/api/specialSetting'
|
|
|
|
+import { musicGroupPaymentCalenderAdd } from '../api'
|
|
|
|
+import { getTimes } from '@/utils'
|
|
import userBaseinfo from './user-baseinfo'
|
|
import userBaseinfo from './user-baseinfo'
|
|
import paymentCycle from './payment-cycle'
|
|
import paymentCycle from './payment-cycle'
|
|
import extraClass from './extra-class'
|
|
import extraClass from './extra-class'
|
|
import classrooms from './classrooms'
|
|
import classrooms from './classrooms'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- props: ['type'],
|
|
|
|
|
|
+ props: ['type', 'musicGroupId', 'baseInfo'],
|
|
components: {
|
|
components: {
|
|
userBaseinfo,
|
|
userBaseinfo,
|
|
paymentCycle,
|
|
paymentCycle,
|
|
@@ -104,6 +94,7 @@ export default {
|
|
return {
|
|
return {
|
|
options: [],
|
|
options: [],
|
|
form: {
|
|
form: {
|
|
|
|
+ payUserType: this.type === 'user' ? 'STUDENT' : 'SCHOOL',
|
|
leixing: '0',
|
|
leixing: '0',
|
|
},
|
|
},
|
|
cycles: [{}],
|
|
cycles: [{}],
|
|
@@ -111,12 +102,13 @@ export default {
|
|
eclass: [{}],
|
|
eclass: [{}],
|
|
collapse: [],
|
|
collapse: [],
|
|
nextVisible: false,
|
|
nextVisible: false,
|
|
|
|
+ typeList: [],
|
|
|
|
+ charges: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
isCommon() {
|
|
isCommon() {
|
|
- console.log(this.form.leixing)
|
|
|
|
- return this.form.leixing === '0'
|
|
|
|
|
|
+ return this.form.leixing === '1'
|
|
},
|
|
},
|
|
isUserType() {
|
|
isUserType() {
|
|
return this.type === 'user'
|
|
return this.type === 'user'
|
|
@@ -124,21 +116,52 @@ export default {
|
|
nextTitle() {
|
|
nextTitle() {
|
|
return this.isCommon ? '乐团课程-班级选择' : '临时加课-班级选择'
|
|
return this.isCommon ? '乐团课程-班级选择' : '临时加课-班级选择'
|
|
},
|
|
},
|
|
|
|
+ chargesById() {
|
|
|
|
+ const data = {}
|
|
|
|
+ for (const item of this.charges) {
|
|
|
|
+ data[item.id] = item
|
|
|
|
+ }
|
|
|
|
+ return data
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
eclass() {
|
|
eclass() {
|
|
console.log([...this.eclass])
|
|
console.log([...this.eclass])
|
|
},
|
|
},
|
|
|
|
+ baseInfo() {
|
|
|
|
+ const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId
|
|
|
|
+ this.getCharges(chargeTypeId)
|
|
|
|
+ },
|
|
'form.leixing'() {
|
|
'form.leixing'() {
|
|
this.cycles = [{}]
|
|
this.cycles = [{}]
|
|
this.collapse = [0]
|
|
this.collapse = [0]
|
|
this.cycle = {}
|
|
this.cycle = {}
|
|
},
|
|
},
|
|
|
|
+ 'form.musicGroupOrganizationCourseSettingId'() {
|
|
|
|
+ this.eclass = this.chargesById[this.form.musicGroupOrganizationCourseSettingId]?.details || []
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- console.log(this.refs)
|
|
|
|
|
|
+ this.getChargeTypeList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async getChargeTypeList() {
|
|
|
|
+ try {
|
|
|
|
+ const res = await chargeTypeList({
|
|
|
|
+ row: 9999
|
|
|
|
+ })
|
|
|
|
+ this.typeList = res.data.rows
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ },
|
|
|
|
+ async getCharges(chargeTypeId) {
|
|
|
|
+ try {
|
|
|
|
+ const res = await musicGroupOrganizationCourseSettingsQueryPage({
|
|
|
|
+ row: 9999,
|
|
|
|
+ chargeTypeId
|
|
|
|
+ })
|
|
|
|
+ this.charges = res.data.rows
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ },
|
|
addExtraClass() {
|
|
addExtraClass() {
|
|
this.eclass.push({})
|
|
this.eclass.push({})
|
|
},
|
|
},
|
|
@@ -163,7 +186,7 @@ export default {
|
|
},
|
|
},
|
|
getForms() {
|
|
getForms() {
|
|
const { $refs: refs } = this
|
|
const { $refs: refs } = this
|
|
- return [...refs.cycles, refs.base, refs.eclass, refs.cycle]
|
|
|
|
|
|
+ return [refs.base, refs.eclass, refs.cycle]
|
|
.filter(item => !!item)
|
|
.filter(item => !!item)
|
|
.map(item => item.$refs.form)
|
|
.map(item => item.$refs.form)
|
|
},
|
|
},
|
|
@@ -179,8 +202,18 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (valided.length === forms.length) {
|
|
if (valided.length === forms.length) {
|
|
- console.log({...this.form}, this.cycle, this.cycles, this.eclass)
|
|
|
|
- this.nextVisible = true
|
|
|
|
|
|
+ const { paymentDate, paymentValid, leixing, ...rest } = {...this.form, ...this.cycle, musicGroupPaymentCalenderCourseSettingsList: this.eclass}
|
|
|
|
+ const data = {
|
|
|
|
+ ...rest,
|
|
|
|
+ paymentType: leixing,
|
|
|
|
+ musicGroupId: this.musicGroupId,
|
|
|
|
+ ...getTimes(paymentDate, ['startPaymentDate', 'deadlinePaymentDate']),
|
|
|
|
+ ...getTimes(paymentValid, ['paymentValidStartDate', 'paymentValidEndDate']),
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ await musicGroupPaymentCalenderAdd(data)
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ // this.nextVisible = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|