|
@@ -68,6 +68,7 @@
|
|
|
:isCommon="false"
|
|
|
:isDisabled="true"
|
|
|
:courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
+ @priceChange="priceChange"
|
|
|
@moneyChange="syncAllMoney"
|
|
|
/>
|
|
|
<el-alert title="缴费设置" :closable="false" class="alert" type="info">
|
|
@@ -137,6 +138,16 @@ export default {
|
|
|
addExtraClass() {
|
|
|
this.eclass.push({});
|
|
|
},
|
|
|
+ priceChange (item, index) {
|
|
|
+ const _ = [...this.eclass]
|
|
|
+ const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
|
|
|
+ const price = Math.ceil((item.courseTotalMinuties || 1) * (active.unitPrice || 1))
|
|
|
+ item.courseCurrentPrice = price
|
|
|
+ item.courseOriginalPrice = price
|
|
|
+ _[index] = item
|
|
|
+ this.eclass = [..._]
|
|
|
+ this.syncAllMoney()
|
|
|
+ },
|
|
|
syncAllMoney() {
|
|
|
let money = 0;
|
|
|
for (const item of this.eclass) {
|
|
@@ -176,7 +187,7 @@ export default {
|
|
|
})
|
|
|
this.ids = ids
|
|
|
const _ = res.data.map(item => {
|
|
|
- const active = this.organizationCourseUnitPriceSettings[item.courseType] || {}
|
|
|
+ const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
|
|
|
const money = Math.ceil((active.unitPrice || 1) * (item.remainMinutes || 1))
|
|
|
return {
|
|
|
courseType: item.courseType,
|