|
@@ -23,11 +23,12 @@
|
|
|
</el-alert>
|
|
|
<extraClass :form.sync="eclass"
|
|
|
ref="eclass"
|
|
|
- :organizationCourseUnitPriceSettings="organizationCourseUnitPriceSettings"
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
:isUserType="isUserType"
|
|
|
+ :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
@priceChange="priceChange"
|
|
|
+ :clearable="true"
|
|
|
@moneyChange="syncAllMoney" />
|
|
|
</template>
|
|
|
<extraClass v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
@@ -37,6 +38,7 @@
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
@moneyChange="syncAllMoney"
|
|
|
+ :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
:isUserType="isUserType"
|
|
|
:isDisabled="form.leixing === '1' || paymentType == '0'" />
|
|
|
<template>
|
|
@@ -124,6 +126,7 @@ export default {
|
|
|
nextVisible: false,
|
|
|
typeList: [],
|
|
|
charges: [],
|
|
|
+ organizationCourseUnitPriceSettingsByType: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -146,13 +149,6 @@ export default {
|
|
|
}
|
|
|
return data;
|
|
|
},
|
|
|
- organizationCourseUnitPriceSettingsByType () {
|
|
|
- const _ = {}
|
|
|
- for (const item of this.organizationCourseUnitPriceSettings) {
|
|
|
- _[item.courseType] = item
|
|
|
- }
|
|
|
- return _
|
|
|
- }
|
|
|
},
|
|
|
watch: {
|
|
|
type () {
|
|
@@ -163,8 +159,12 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
baseInfo (val) {
|
|
|
+ this.formatCourse()
|
|
|
this.getCharges();
|
|
|
},
|
|
|
+ organizationCourseUnitPriceSettings() {
|
|
|
+ this.formatCourse()
|
|
|
+ },
|
|
|
"form.leixing" (val) {
|
|
|
this.cycles = [{}];
|
|
|
this.collapse = [0];
|
|
@@ -191,9 +191,22 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted () {
|
|
|
+ if (this.rowDetail) {
|
|
|
+ for (const key in paymentTypeFormat) {
|
|
|
+ if (paymentTypeFormat.hasOwnProperty(key)) {
|
|
|
+ const item = paymentTypeFormat[key];
|
|
|
+ if (item === this.rowDetail.paymentType) {
|
|
|
+ console.log(key)
|
|
|
+ this.paymentType = key
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.formatCourse()
|
|
|
this.init();
|
|
|
},
|
|
|
activated () {
|
|
|
+ this.formatCourse()
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
@@ -209,8 +222,19 @@ export default {
|
|
|
this.$set(this.other, "memo", this.rowDetail.memo);
|
|
|
}
|
|
|
},
|
|
|
+ formatCourse() {
|
|
|
+ const organId = this.baseInfo?.musicGroup?.organId
|
|
|
+ const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId
|
|
|
+ const _ = {}
|
|
|
+ const list = (this.organizationCourseUnitPriceSettings || [])
|
|
|
+ .filter(item => organId && organId == item.organId && chargeTypeId && chargeTypeId == item.chargeTypeId)
|
|
|
+ for (const item of list) {
|
|
|
+ _[item.courseType] = item
|
|
|
+ }
|
|
|
+ this.organizationCourseUnitPriceSettingsByType = _
|
|
|
+ return _
|
|
|
+ },
|
|
|
priceChange (item, index) {
|
|
|
- console.log({...item})
|
|
|
const _ = [...this.eclass]
|
|
|
const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
|
|
|
const price = Math.ceil((item.courseTotalMinuties || 1) * (active.unitPrice || 1))
|
|
@@ -346,7 +370,6 @@ export default {
|
|
|
this.$listeners.submited(res.data);
|
|
|
// 在这里
|
|
|
if (this.$route.query.type == "teamDraft") {
|
|
|
- console.log('来了')
|
|
|
this.$router.push({
|
|
|
query: merge(this.$route.query, { 'type': 'feeAudit' })
|
|
|
});
|
|
@@ -359,7 +382,6 @@ export default {
|
|
|
this.$listeners.close();
|
|
|
this.$listeners.submited(res.data);
|
|
|
if (this.$route.query.type == "teamDraft") {
|
|
|
- console.log('来了')
|
|
|
this.$router.push({
|
|
|
query: merge(this.$route.query, { 'type': 'feeAudit' })
|
|
|
});
|