|
@@ -1,72 +1,72 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-alert title="课程信息设置" :closable="false" class="alert" type="info">
|
|
|
+ <el-alert title="课程信息设置"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ type="info">
|
|
|
</el-alert>
|
|
|
- <userBaseinfo
|
|
|
- :form.sync="form"
|
|
|
- :isCommon="isCommon"
|
|
|
- :isUserType="isUserType"
|
|
|
- @getCharges="getCharges"
|
|
|
- @changeActive="$listeners.changeActive"
|
|
|
- :typeList="typeList"
|
|
|
- :charges="charges"
|
|
|
- :chargeTypeName="chargeTypeName"
|
|
|
- :paymentType="paymentType"
|
|
|
- ref="base"
|
|
|
- />
|
|
|
+ <userBaseinfo :form.sync="form"
|
|
|
+ :isCommon="isCommon"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ @getCharges="getCharges"
|
|
|
+ @changeActive="$listeners.changeActive"
|
|
|
+ :typeList="typeList"
|
|
|
+ :charges="charges"
|
|
|
+ :chargeTypeName="chargeTypeName"
|
|
|
+ :paymentType="paymentType"
|
|
|
+ ref="base" />
|
|
|
<template v-if="!isCommon">
|
|
|
- <el-alert
|
|
|
- title="加课信息设置"
|
|
|
- :closable="false"
|
|
|
- class="alert"
|
|
|
- type="info"
|
|
|
- >
|
|
|
+ <el-alert title="加课信息设置"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ type="info">
|
|
|
</el-alert>
|
|
|
- <extraClass
|
|
|
- :form.sync="eclass"
|
|
|
- ref="eclass"
|
|
|
- :organizationCourseUnitPriceSettings="organizationCourseUnitPriceSettings"
|
|
|
- @create="addExtraClass"
|
|
|
- @remove="removeExtraClass"
|
|
|
- @priceChange="priceChange"
|
|
|
- @moneyChange="syncAllMoney"
|
|
|
- />
|
|
|
+ <extraClass :form.sync="eclass"
|
|
|
+ ref="eclass"
|
|
|
+ :organizationCourseUnitPriceSettings="organizationCourseUnitPriceSettings"
|
|
|
+ @create="addExtraClass"
|
|
|
+ @remove="removeExtraClass"
|
|
|
+ @priceChange="priceChange"
|
|
|
+ @moneyChange="syncAllMoney" />
|
|
|
</template>
|
|
|
- <extraClass
|
|
|
- v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
|
- :form="eclass"
|
|
|
- ref="eclass"
|
|
|
- :isCommon="isCommon"
|
|
|
- @create="addExtraClass"
|
|
|
- @remove="removeExtraClass"
|
|
|
- @moneyChange="syncAllMoney"
|
|
|
- :isUserType="isUserType"
|
|
|
- :isDisabled="form.leixing === '1' || paymentType == '0'"
|
|
|
- />
|
|
|
+ <extraClass v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
|
+ :form="eclass"
|
|
|
+ ref="eclass"
|
|
|
+ :isCommon="isCommon"
|
|
|
+ @create="addExtraClass"
|
|
|
+ @remove="removeExtraClass"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ :isDisabled="form.leixing === '1' || paymentType == '0'" />
|
|
|
<template>
|
|
|
- <el-alert title="缴费设置" :closable="false" class="alert" type="info">
|
|
|
+ <el-alert title="缴费设置"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ type="info">
|
|
|
</el-alert>
|
|
|
- <paymentCycle
|
|
|
- ref="cycle"
|
|
|
- :isUserType="isUserType"
|
|
|
- :form.sync="cycle"
|
|
|
- :isCommon="isCommon"
|
|
|
- :isDisabled="form.leixing === '1' || paymentType == '0'"
|
|
|
- />
|
|
|
+ <paymentCycle ref="cycle"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ :form.sync="cycle"
|
|
|
+ :isCommon="isCommon"
|
|
|
+ :isDisabled="form.leixing === '1' || paymentType == '0'" />
|
|
|
</template>
|
|
|
- <el-alert title="其它" :closable="false" class="alert" type="info">
|
|
|
+ <el-alert title="其它"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ type="info">
|
|
|
</el-alert>
|
|
|
- <otherform :form="other" ref="other" />
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <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">确认</el-button>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :title="nextTitle"
|
|
|
- :visible.sync="nextVisible"
|
|
|
- width="600px"
|
|
|
- append-to-body
|
|
|
- >
|
|
|
+ <el-dialog :title="nextTitle"
|
|
|
+ :visible.sync="nextVisible"
|
|
|
+ width="600px"
|
|
|
+ append-to-body>
|
|
|
<classrooms @close="closeNext" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -105,7 +105,7 @@ export default {
|
|
|
classrooms,
|
|
|
otherform,
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
options: [],
|
|
|
form: {
|
|
@@ -125,26 +125,26 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- isCommon() {
|
|
|
+ isCommon () {
|
|
|
return this.form.leixing === "1";
|
|
|
},
|
|
|
- isDisabled() {
|
|
|
+ isDisabled () {
|
|
|
return this.form.leixing === "1" || String(this.paymentType) === "0";
|
|
|
},
|
|
|
- isUserType() {
|
|
|
+ isUserType () {
|
|
|
return this.type === "user";
|
|
|
},
|
|
|
- nextTitle() {
|
|
|
+ nextTitle () {
|
|
|
return this.isCommon ? "乐团课程-班级选择" : "临时加课-班级选择";
|
|
|
},
|
|
|
- chargesById() {
|
|
|
+ chargesById () {
|
|
|
const data = {};
|
|
|
for (const item of this.charges) {
|
|
|
data[item.id] = item;
|
|
|
}
|
|
|
return data;
|
|
|
},
|
|
|
- organizationCourseUnitPriceSettingsByType() {
|
|
|
+ organizationCourseUnitPriceSettingsByType () {
|
|
|
const _ = {}
|
|
|
for (const item of this.organizationCourseUnitPriceSettings) {
|
|
|
_[item.courseType] = item
|
|
@@ -153,17 +153,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- type() {
|
|
|
+ type () {
|
|
|
this.$set(
|
|
|
this.form,
|
|
|
"payUserType",
|
|
|
this.type === "user" ? "STUDENT" : "SCHOOL"
|
|
|
);
|
|
|
},
|
|
|
- baseInfo(val) {
|
|
|
+ baseInfo (val) {
|
|
|
this.getCharges();
|
|
|
},
|
|
|
- "form.leixing"(val) {
|
|
|
+ "form.leixing" (val) {
|
|
|
this.cycles = [{}];
|
|
|
this.collapse = [0];
|
|
|
this.cycle = {};
|
|
@@ -175,7 +175,7 @@ export default {
|
|
|
this.eclass = [];
|
|
|
}
|
|
|
},
|
|
|
- async "form.musicGroupOrganizationCourseSettingId"(val) {
|
|
|
+ async "form.musicGroupOrganizationCourseSettingId" (val) {
|
|
|
try {
|
|
|
const res = await queryByMusicGroupOrganizationCourseSettingsId({
|
|
|
id: val
|
|
@@ -185,17 +185,17 @@ export default {
|
|
|
}) || [{}];
|
|
|
|
|
|
this.syncAllMoney();
|
|
|
- } catch (error) {}
|
|
|
+ } catch (error) { }
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.init();
|
|
|
},
|
|
|
- activated() {
|
|
|
+ activated () {
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
- init() {
|
|
|
+ init () {
|
|
|
this.getCharges();
|
|
|
if (this.rowDetail) {
|
|
|
this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
|
|
@@ -207,7 +207,7 @@ export default {
|
|
|
this.$set(this.other, "memo", this.rowDetail.memo);
|
|
|
}
|
|
|
},
|
|
|
- priceChange(item, index) {
|
|
|
+ priceChange (item, index) {
|
|
|
const _ = [...this.eclass]
|
|
|
const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
|
|
|
const price = Math.ceil((item.courseTotalMinuties || 1) * (active.unitPrice || 1))
|
|
@@ -216,7 +216,7 @@ export default {
|
|
|
_[index] = item
|
|
|
this.eclass = [..._]
|
|
|
},
|
|
|
- syncAllMoney() {
|
|
|
+ syncAllMoney () {
|
|
|
let money = 0;
|
|
|
for (const item of this.eclass) {
|
|
|
money += item.courseCurrentPrice;
|
|
@@ -226,32 +226,32 @@ export default {
|
|
|
} else {
|
|
|
this.$set(this.cycle, "paymentAmount", money);
|
|
|
}
|
|
|
- if(this.rowDetail){
|
|
|
- this.$set(
|
|
|
- this.cycle,
|
|
|
- "paymentPattern",
|
|
|
- this.rowDetail?.paymentPattern + ""
|
|
|
- );
|
|
|
- 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);
|
|
|
+ if (this.rowDetail) {
|
|
|
+ this.$set(
|
|
|
+ this.cycle,
|
|
|
+ "paymentPattern",
|
|
|
+ this.rowDetail?.paymentPattern + ""
|
|
|
+ );
|
|
|
+ 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() {
|
|
|
+ async getChargeTypeList () {
|
|
|
try {
|
|
|
const res = await chargeTypeList({
|
|
|
row: 9999,
|
|
|
});
|
|
|
this.typeList = res.data.rows;
|
|
|
- } catch (error) {}
|
|
|
+ } catch (error) { }
|
|
|
},
|
|
|
- async getCharges() {
|
|
|
+ async getCharges () {
|
|
|
const organId = this.baseInfo?.musicGroup?.organId;
|
|
|
const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId;
|
|
|
this.chargeTypeName = this.baseInfo?.musicGroup?.chargeTypeName;
|
|
@@ -262,37 +262,37 @@ export default {
|
|
|
organId,
|
|
|
});
|
|
|
this.charges = res.data.rows;
|
|
|
- } catch (error) {}
|
|
|
+ } catch (error) { }
|
|
|
},
|
|
|
- addExtraClass() {
|
|
|
+ addExtraClass () {
|
|
|
this.eclass.push({});
|
|
|
},
|
|
|
- removeExtraClass(index) {
|
|
|
+ removeExtraClass (index) {
|
|
|
this.eclass[index] = null;
|
|
|
this.eclass = this.eclass.filter((item) => !!item);
|
|
|
},
|
|
|
- addCycle() {
|
|
|
+ addCycle () {
|
|
|
this.cycles.push({});
|
|
|
this.collapse.push(this.collapse.length);
|
|
|
},
|
|
|
- removeCycle(index) {
|
|
|
+ removeCycle (index) {
|
|
|
this.cycles[index] = null;
|
|
|
this.cycles = this.cycles.filter((item) => !!item);
|
|
|
this.collapse.pop();
|
|
|
},
|
|
|
- collapseChange(val) {
|
|
|
+ collapseChange (val) {
|
|
|
this.collapse = val;
|
|
|
},
|
|
|
- closeNext() {
|
|
|
+ closeNext () {
|
|
|
this.nextVisible = false;
|
|
|
},
|
|
|
- getForms() {
|
|
|
+ getForms () {
|
|
|
const { $refs: refs } = this;
|
|
|
return [refs.base, refs.eclass, refs.cycle, refs.other]
|
|
|
.filter((item) => !!item)
|
|
|
.map((item) => item.$refs.form);
|
|
|
},
|
|
|
- async submit() {
|
|
|
+ async submit () {
|
|
|
const forms = this.getForms();
|
|
|
const valided = [];
|
|
|
for (const form of forms) {
|
|
@@ -316,7 +316,7 @@ export default {
|
|
|
...rest,
|
|
|
paymentType:
|
|
|
paymentTypeFormat[
|
|
|
- this.paymentType == 0 ? this.paymentType : leixing
|
|
|
+ this.paymentType == 0 ? this.paymentType : leixing
|
|
|
],
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
...getTimes(paymentDate, ["startPaymentDate", "deadlinePaymentDate"]),
|
|
@@ -330,14 +330,39 @@ export default {
|
|
|
const res = await musicGroupPaymentCalenderAdd(data);
|
|
|
this.$listeners.close();
|
|
|
this.$listeners.submited(res.data);
|
|
|
- } catch (error) {}
|
|
|
+ // 在这里
|
|
|
+ if (this.$route.query.type == "teamDraft") {
|
|
|
+ console.log('来了')
|
|
|
+ let query = this.$route.query;
|
|
|
+ query.type = "feeAudit";
|
|
|
+ query = JSON.parse(JSON.stringify(query))
|
|
|
+ this.$router.push({
|
|
|
+ query: {
|
|
|
+ ...query,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ console.log(query)
|
|
|
+ }
|
|
|
+ } catch (error) { }
|
|
|
} else {
|
|
|
- try {
|
|
|
+ try {
|
|
|
data.id = this.rowDetail.id
|
|
|
const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
|
|
|
this.$listeners.close();
|
|
|
this.$listeners.submited(res.data);
|
|
|
- } catch (error) {}
|
|
|
+ if (this.$route.query.type == "teamDraft") {
|
|
|
+ console.log('来了')
|
|
|
+ let query = this.$route.query;
|
|
|
+ query.type = "feeAudit";
|
|
|
+ query = JSON.parse(JSON.stringify(query))
|
|
|
+ console.log(query)
|
|
|
+ this.$router.push({
|
|
|
+ query: {
|
|
|
+ ...query
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) { }
|
|
|
}
|
|
|
}
|
|
|
},
|