|
@@ -7,6 +7,7 @@
|
|
|
:isCommon="isCommon"
|
|
|
:isUserType="isUserType"
|
|
|
@getCharges="getCharges"
|
|
|
+ @changeActive="$listeners.changeActive"
|
|
|
:typeList="typeList"
|
|
|
:charges="charges"
|
|
|
:paymentType="paymentType"
|
|
@@ -21,10 +22,12 @@
|
|
|
>
|
|
|
</el-alert>
|
|
|
<extraClass
|
|
|
- :form="eclass"
|
|
|
+ :form.sync="eclass"
|
|
|
ref="eclass"
|
|
|
+ :organizationCourseUnitPriceSettings="organizationCourseUnitPriceSettings"
|
|
|
@create="addExtraClass"
|
|
|
@remove="removeExtraClass"
|
|
|
+ @priceChange="priceChange"
|
|
|
@moneyChange="syncAllMoney"
|
|
|
/>
|
|
|
</template>
|
|
@@ -55,7 +58,7 @@
|
|
|
<otherform :form="other" ref="other" />
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="$listeners.close">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submit">下一步</el-button>
|
|
|
+ <el-button type="primary" @click="submit">{{paymentType == '0' ? '确认' : '下一步'}}</el-button>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
:title="nextTitle"
|
|
@@ -82,6 +85,7 @@ import paymentCycle from "./payment-cycle";
|
|
|
import extraClass from "./extra-class";
|
|
|
import classrooms from "./classrooms";
|
|
|
import otherform from "./other";
|
|
|
+import baseInfoVue from '../../teamDetail/components/baseInfo.vue';
|
|
|
|
|
|
const paymentTypeFormat = {
|
|
|
0: "MUSIC_APPLY",
|
|
@@ -91,7 +95,7 @@ const paymentTypeFormat = {
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
- props: ["type", "musicGroupId", "baseInfo", "paymentType", "rowDetail"],
|
|
|
+ props: ["type", "musicGroupId", "baseInfo", "paymentType", "rowDetail", 'organizationCourseUnitPriceSettings'],
|
|
|
components: {
|
|
|
userBaseinfo,
|
|
|
paymentCycle,
|
|
@@ -137,6 +141,13 @@ export default {
|
|
|
}
|
|
|
return data;
|
|
|
},
|
|
|
+ organizationCourseUnitPriceSettingsByType() {
|
|
|
+ const _ = {}
|
|
|
+ for (const item of this.organizationCourseUnitPriceSettings) {
|
|
|
+ _[item.courseType] = item
|
|
|
+ }
|
|
|
+ return _
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
type() {
|
|
@@ -149,16 +160,16 @@ export default {
|
|
|
baseInfo(val) {
|
|
|
this.getCharges();
|
|
|
},
|
|
|
- "form.leixing"() {
|
|
|
+ "form.leixing"(val) {
|
|
|
this.cycles = [{}];
|
|
|
this.collapse = [0];
|
|
|
this.cycle = {};
|
|
|
- this.cycle.paymentAmount = "";
|
|
|
- if (this.form.leixing === "1") {
|
|
|
+ this.$set(this.form, "musicGroupOrganizationCourseSettingId", undefined);
|
|
|
+ this.$set(this.cycle, "paymentAmount", undefined);
|
|
|
+ if (val === "1") {
|
|
|
this.eclass = [];
|
|
|
- } else if (this.form.leixing === "2") {
|
|
|
+ } else if (val === "2") {
|
|
|
this.eclass = [{}];
|
|
|
- this.$set(this.form, "musicGroupOrganizationCourseSettingId", "");
|
|
|
}
|
|
|
},
|
|
|
"form.musicGroupOrganizationCourseSettingId"(val) {
|
|
@@ -173,8 +184,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- console.log(this.rowDetail);
|
|
|
- this.getCharges();
|
|
|
+ this.getCharges();
|
|
|
if (this.rowDetail) {
|
|
|
this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
|
|
|
this.$set(
|
|
@@ -185,12 +195,25 @@ export default {
|
|
|
this.$set(this.other, "memo", this.rowDetail.memo);
|
|
|
}
|
|
|
},
|
|
|
+ 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 = [..._]
|
|
|
+ },
|
|
|
syncAllMoney() {
|
|
|
let money = 0;
|
|
|
for (const item of this.eclass) {
|
|
|
money += item.courseCurrentPrice;
|
|
|
}
|
|
|
- this.$set(this.cycle, "paymentAmount", money);
|
|
|
+ if (!money) {
|
|
|
+ this.$set(this.cycle, "paymentAmount", undefined);
|
|
|
+ } else {
|
|
|
+ this.$set(this.cycle, "paymentAmount", money);
|
|
|
+ }
|
|
|
if(this.rowDetail){
|
|
|
this.$set(
|
|
|
this.cycle,
|
|
@@ -200,12 +223,12 @@ export default {
|
|
|
let arr = [
|
|
|
this.rowDetail?.paymentValidStartDate,
|
|
|
this.rowDetail?.paymentValidEndDate,
|
|
|
- ];
|
|
|
+ ];
|
|
|
// paymentDate startPaymentDate deadlinePaymentDate
|
|
|
this.$set(this.cycle, "paymentDate", [ this.rowDetail?.startPaymentDate, this.rowDetail?.deadlinePaymentDate]);
|
|
|
this.$set(this.cycle, "paymentValid", arr);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return money;
|
|
|
},
|
|
|
async getChargeTypeList() {
|
|
@@ -227,7 +250,7 @@ export default {
|
|
|
const eclas = this.chargesById[
|
|
|
this.form.musicGroupOrganizationCourseSettingId
|
|
|
];
|
|
|
- this.eclass = eclas?.details || [];
|
|
|
+ this.eclass = eclas?.details || [{}];
|
|
|
|
|
|
this.syncAllMoney();
|
|
|
} catch (error) {}
|
|
@@ -298,10 +321,10 @@ export default {
|
|
|
} catch (error) {}
|
|
|
} else {
|
|
|
try {
|
|
|
- data.id = this.rowDetail.id
|
|
|
- const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
|
|
|
- this.$listeners.close();
|
|
|
- this.$listeners.submited(res.data);
|
|
|
+ data.id = this.rowDetail.id
|
|
|
+ const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
|
|
|
+ this.$listeners.close();
|
|
|
+ this.$listeners.submited(res.data);
|
|
|
} catch (error) {}
|
|
|
}
|
|
|
}
|