|
@@ -1,88 +1,114 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-alert title="课程信息设置"
|
|
|
- :closable="false"
|
|
|
- class="alert"
|
|
|
- v-if="paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'"
|
|
|
- type="info">
|
|
|
+ <el-alert
|
|
|
+ title="课程信息设置"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ v-if="paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'"
|
|
|
+ type="info"
|
|
|
+ >
|
|
|
</el-alert>
|
|
|
- <userBaseinfo :form.sync="form"
|
|
|
- :isCommon="isCommon"
|
|
|
- v-if="paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'"
|
|
|
- :isUserType="isUserType"
|
|
|
- @getCharges="getCharges"
|
|
|
- @changeActive="changeActive"
|
|
|
- :typeList="typeList"
|
|
|
- :charges="charges"
|
|
|
- :rowDetail="rowDetail"
|
|
|
- :chargeTypeName="chargeTypeName"
|
|
|
- :paymentType="paymentType"
|
|
|
- ref="base" />
|
|
|
+ <userBaseinfo
|
|
|
+ :form.sync="form"
|
|
|
+ :isCommon="isCommon"
|
|
|
+ v-if="paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ @getCharges="getCharges"
|
|
|
+ @changeActive="changeActive"
|
|
|
+ :typeList="typeList"
|
|
|
+ :charges="charges"
|
|
|
+ :rowDetail="rowDetail"
|
|
|
+ :chargeTypeName="chargeTypeName"
|
|
|
+ :paymentType="paymentType"
|
|
|
+ ref="base"
|
|
|
+ />
|
|
|
<template v-if="paymentTypeString === 'SPAN_GROUP_CLASS_ADJUST'">
|
|
|
- <el-alert title="加课信息设置"
|
|
|
- :closable="false"
|
|
|
- class="alert"
|
|
|
- type="info">
|
|
|
+ <el-alert
|
|
|
+ title="加课信息设置"
|
|
|
+ :closable="false"
|
|
|
+ class="alert"
|
|
|
+ type="info"
|
|
|
+ >
|
|
|
</el-alert>
|
|
|
- <extraClassUser :form.sync="eclassuser"
|
|
|
- ref="eclass"
|
|
|
- :isUserType="isUserType"
|
|
|
- :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
- @priceChange="priceChange"
|
|
|
- :clearable="true"
|
|
|
- @moneyChange="syncAllMoney" />
|
|
|
+ <extraClassUser
|
|
|
+ :form.sync="eclassuser"
|
|
|
+ ref="eclass"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ :courseUnitPriceSettingsByType="
|
|
|
+ organizationCourseUnitPriceSettingsByType
|
|
|
+ "
|
|
|
+ @priceChange="priceChange"
|
|
|
+ :clearable="true"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template v-else-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"
|
|
|
- @create="addExtraClass"
|
|
|
- @remove="removeExtraClass"
|
|
|
- :isUserType="isUserType"
|
|
|
- :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
- @priceChange="priceChange"
|
|
|
- :clearable="true"
|
|
|
- @moneyChange="syncAllMoney" />
|
|
|
+ <extraClass
|
|
|
+ :form.sync="eclass"
|
|
|
+ ref="eclass"
|
|
|
+ @create="addExtraClass"
|
|
|
+ @remove="removeExtraClass"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ :courseUnitPriceSettingsByType="
|
|
|
+ organizationCourseUnitPriceSettingsByType
|
|
|
+ "
|
|
|
+ @priceChange="priceChange"
|
|
|
+ :clearable="true"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
+ />
|
|
|
</template>
|
|
|
- <extraClass v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
|
- :form="eclass"
|
|
|
- ref="eclass"
|
|
|
- :isCommon="isCommon"
|
|
|
- @create="addExtraClass"
|
|
|
- @remove="removeExtraClass"
|
|
|
- @moneyChange="syncAllMoney"
|
|
|
- :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
- :isUserType="isUserType"
|
|
|
- :isDisabled="form.leixing === '1' || form.leixing === '2' || paymentType == '0'" />
|
|
|
+ <extraClass
|
|
|
+ v-else-if="(!isCommon && eclass.length) || isCommon"
|
|
|
+ :form="eclass"
|
|
|
+ ref="eclass"
|
|
|
+ :isCommon="isCommon"
|
|
|
+ @create="addExtraClass"
|
|
|
+ @remove="removeExtraClass"
|
|
|
+ @moneyChange="syncAllMoney"
|
|
|
+ :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
|
|
|
+ :isUserType="isUserType"
|
|
|
+ :isDisabled="
|
|
|
+ form.leixing === '1' || form.leixing === '2' || paymentType == '0'
|
|
|
+ "
|
|
|
+ />
|
|
|
<template>
|
|
|
- <el-alert title="缴费设置"
|
|
|
- :closable="false"
|
|
|
- class="alert"
|
|
|
- type="info">
|
|
|
+ <el-alert title="缴费设置" :closable="false" class="alert" type="info">
|
|
|
</el-alert>
|
|
|
<el-form ref="payment" :model="payment">
|
|
|
<el-form-item
|
|
|
label-width="160px"
|
|
|
label="缴费方式"
|
|
|
prop="paymentPattern"
|
|
|
- :rules="[{required: true, message: '请选择缴费方式', trigger: 'change'}]"
|
|
|
+ :rules="[
|
|
|
+ { required: true, message: '请选择缴费方式', trigger: 'change' },
|
|
|
+ ]"
|
|
|
>
|
|
|
- <el-select style="width: 100%!important;" v-model="payment.paymentPattern" placeholder="请选择缴费方式">
|
|
|
+ <el-select
|
|
|
+ style="width: 100% !important"
|
|
|
+ v-model="payment.paymentPattern"
|
|
|
+ placeholder="请选择缴费方式"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in paymentPatternTypeOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
- :value="item.value">
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <template v-if="isMulticycle && paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'">
|
|
|
- <el-collapse :value="collapse" @change="collapseChange" >
|
|
|
+ <template
|
|
|
+ v-if="isMulticycle && paymentTypeString !== 'SPAN_GROUP_CLASS_ADJUST'"
|
|
|
+ >
|
|
|
+ <el-collapse :value="collapse" @change="collapseChange">
|
|
|
<el-collapse-item
|
|
|
v-for="(item, index) in cycles"
|
|
|
:key="index"
|
|
@@ -90,8 +116,12 @@
|
|
|
>
|
|
|
<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>
|
|
|
+ <span>缴费周期 {{ index + 1 }}</span>
|
|
|
+ <i
|
|
|
+ v-if="cycles.length > 1"
|
|
|
+ class="el-icon-circle-close"
|
|
|
+ @click.stop="removeCycle(index)"
|
|
|
+ ></i>
|
|
|
</div>
|
|
|
</template>
|
|
|
<paymentCycle
|
|
@@ -100,7 +130,11 @@
|
|
|
:hidePaymentPattern="true"
|
|
|
:isCommon="isCommon"
|
|
|
:isUserType="isUserType"
|
|
|
- :isDisabled="form.leixing === '1' || form.leixing === '2' || paymentType == '0'"
|
|
|
+ :isDisabled="
|
|
|
+ form.leixing === '1' ||
|
|
|
+ form.leixing === '2' ||
|
|
|
+ paymentType == '0'
|
|
|
+ "
|
|
|
/>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
@@ -109,9 +143,10 @@
|
|
|
plain
|
|
|
type="info"
|
|
|
size="small"
|
|
|
- style="width: 100%;margin: 20px 0;"
|
|
|
+ style="width: 100%; margin: 20px 0"
|
|
|
@click="addCycle"
|
|
|
- >新增缴费周期</el-button>
|
|
|
+ >新增缴费周期</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<paymentCycle
|
|
|
ref="cycle"
|
|
@@ -119,27 +154,25 @@
|
|
|
:isCommon="isCommon"
|
|
|
:hidePaymentPattern="true"
|
|
|
:isUserType="isUserType"
|
|
|
- :isDisabled="form.leixing === '1' || form.leixing === '2' || paymentType == '0'"
|
|
|
+ :isDisabled="
|
|
|
+ form.leixing === '1' || form.leixing === '2' || paymentType == '0'
|
|
|
+ "
|
|
|
v-else
|
|
|
/>
|
|
|
</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>
|
|
@@ -149,14 +182,14 @@ import {
|
|
|
chargeTypeList,
|
|
|
musicGroupOrganizationCourseSettingsQueryPage,
|
|
|
} from "@/api/specialSetting";
|
|
|
-import { getMusicGroupPaymentCalenderDetail } from '@/api/buildTeam'
|
|
|
+import { getMusicGroupPaymentCalenderDetail } from "@/api/buildTeam";
|
|
|
import {
|
|
|
musicGroupPaymentCalenderAdd,
|
|
|
musicGroupPaymentCalenderDetailBatchUpdate,
|
|
|
queryByMusicGroupOrganizationCourseSettingsId,
|
|
|
musicGroupPaymentCalenderView,
|
|
|
} from "../api";
|
|
|
-import { paymentPatternType } from '@/constant'
|
|
|
+import { paymentPatternType } from "@/constant";
|
|
|
import { getTimes, objectToOptions } from "@/utils";
|
|
|
import userBaseinfo from "./user-baseinfo";
|
|
|
import paymentCycle from "./payment-cycle";
|
|
@@ -164,9 +197,9 @@ import extraClass from "./extra-class";
|
|
|
import extraClassUser from "./extra-class-user";
|
|
|
import classrooms from "./classrooms";
|
|
|
import otherform from "./other";
|
|
|
-import baseInfoVue from '../../teamDetail/components/baseInfo.vue';
|
|
|
-import merge from 'webpack-merge'
|
|
|
-import numeral from 'numeral'
|
|
|
+import baseInfoVue from "../../teamDetail/components/baseInfo.vue";
|
|
|
+import merge from "webpack-merge";
|
|
|
+import numeral from "numeral";
|
|
|
|
|
|
const paymentTypeFormat = {
|
|
|
0: "MUSIC_APPLY",
|
|
@@ -177,7 +210,14 @@ const paymentTypeFormat = {
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
- props: ["type", "musicGroupId", "baseInfo", "paymentType", "rowDetail", 'organizationCourseUnitPriceSettings'],
|
|
|
+ props: [
|
|
|
+ "type",
|
|
|
+ "musicGroupId",
|
|
|
+ "baseInfo",
|
|
|
+ "paymentType",
|
|
|
+ "rowDetail",
|
|
|
+ "organizationCourseUnitPriceSettings",
|
|
|
+ ],
|
|
|
components: {
|
|
|
userBaseinfo,
|
|
|
paymentCycle,
|
|
@@ -186,7 +226,7 @@ export default {
|
|
|
classrooms,
|
|
|
otherform,
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
options: [],
|
|
|
form: {
|
|
@@ -194,7 +234,7 @@ export default {
|
|
|
leixing: "1",
|
|
|
musicGroupOrganizationCourseSettingId: null,
|
|
|
},
|
|
|
- chargeTypeName: '',
|
|
|
+ chargeTypeName: "",
|
|
|
other: {},
|
|
|
cycles: [{}],
|
|
|
cycle: {},
|
|
@@ -204,7 +244,7 @@ export default {
|
|
|
nextVisible: false,
|
|
|
typeList: [],
|
|
|
charges: [],
|
|
|
- studentIds: '',
|
|
|
+ studentIds: "",
|
|
|
payment: {
|
|
|
paymentPattern: null,
|
|
|
},
|
|
@@ -215,21 +255,21 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
musicGroup() {
|
|
|
- return this.baseInfo?.musicGroup
|
|
|
+ return this.baseInfo?.musicGroup;
|
|
|
},
|
|
|
- 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;
|
|
@@ -237,50 +277,62 @@ export default {
|
|
|
return data;
|
|
|
},
|
|
|
paymentAmountDisabled() {
|
|
|
- return (this.isUserType || (this.isCommon && this.isUserType)) && this.isDisabled
|
|
|
+ return (
|
|
|
+ (this.isUserType || (this.isCommon && this.isUserType)) &&
|
|
|
+ this.isDisabled
|
|
|
+ );
|
|
|
},
|
|
|
isMulticycle() {
|
|
|
- let editMulticycle = false
|
|
|
- let paymentType = ''
|
|
|
+ let editMulticycle = false;
|
|
|
+ let paymentType = "";
|
|
|
if (this.viewDetail) {
|
|
|
- const { musicGroupPaymentCalenders, auditDto } = this.viewDetail
|
|
|
- paymentType = musicGroupPaymentCalenders[0]?.paymentType
|
|
|
- editMulticycle = (musicGroupPaymentCalenders.length > 1 || paymentType != 'ADD_COURSE')
|
|
|
+ const { musicGroupPaymentCalenders, auditDto } = this.viewDetail;
|
|
|
+ paymentType = musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
+ editMulticycle =
|
|
|
+ musicGroupPaymentCalenders.length > 1 || paymentType != "ADD_COURSE";
|
|
|
if (editMulticycle) {
|
|
|
- this.cycles = musicGroupPaymentCalenders.map(item => ({
|
|
|
+ this.cycles = musicGroupPaymentCalenders.map((item) => ({
|
|
|
paymentAmount: item.paymentAmount,
|
|
|
paymentDate: [item?.startPaymentDate, item?.deadlinePaymentDate],
|
|
|
- paymentValid: [item?.paymentValidStartDate, item?.paymentValidEndDate]
|
|
|
- }))
|
|
|
+ paymentValid: [
|
|
|
+ item?.paymentValidStartDate,
|
|
|
+ item?.paymentValidEndDate,
|
|
|
+ ],
|
|
|
+ }));
|
|
|
}
|
|
|
}
|
|
|
- return (this.payment.paymentPattern == 0 && this.form.leixing !== '2' && paymentType !== 'ADD_COURSE') || (this.payment.paymentPattern == 0 && editMulticycle)
|
|
|
+ return (
|
|
|
+ (this.payment.paymentPattern == 0 &&
|
|
|
+ this.form.leixing !== "2" &&
|
|
|
+ paymentType !== "ADD_COURSE") ||
|
|
|
+ (this.payment.paymentPattern == 0 && editMulticycle)
|
|
|
+ );
|
|
|
},
|
|
|
paymentTypeString() {
|
|
|
- let paymentType = ''
|
|
|
+ let paymentType = "";
|
|
|
if (this.viewDetail) {
|
|
|
- const { musicGroupPaymentCalenders } = this.viewDetail
|
|
|
- paymentType = musicGroupPaymentCalenders[0]?.paymentType
|
|
|
+ const { musicGroupPaymentCalenders } = this.viewDetail;
|
|
|
+ paymentType = musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
}
|
|
|
- return paymentType
|
|
|
- }
|
|
|
+ return paymentType;
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
- type () {
|
|
|
+ type() {
|
|
|
this.$set(
|
|
|
this.form,
|
|
|
"payUserType",
|
|
|
this.type === "user" ? "STUDENT" : "SCHOOL"
|
|
|
);
|
|
|
},
|
|
|
- baseInfo (val) {
|
|
|
- this.formatCourse()
|
|
|
+ baseInfo(val) {
|
|
|
+ this.formatCourse();
|
|
|
this.getCharges();
|
|
|
},
|
|
|
organizationCourseUnitPriceSettings() {
|
|
|
- this.formatCourse()
|
|
|
+ this.formatCourse();
|
|
|
},
|
|
|
- "form.leixing" (val) {
|
|
|
+ "form.leixing"(val) {
|
|
|
this.cycles = [{}];
|
|
|
this.collapse = [0];
|
|
|
this.cycle = {};
|
|
@@ -292,41 +344,41 @@ export default {
|
|
|
this.eclass = [{}];
|
|
|
}
|
|
|
},
|
|
|
- async "form.musicGroupOrganizationCourseSettingId" (val) {
|
|
|
- if (val&&!this.rowDetail) {
|
|
|
+ async "form.musicGroupOrganizationCourseSettingId"(val) {
|
|
|
+ if (val && !this.rowDetail) {
|
|
|
try {
|
|
|
const res = await queryByMusicGroupOrganizationCourseSettingsId({
|
|
|
- id: val
|
|
|
- })
|
|
|
- this.eclass = res.data.filter(item => {
|
|
|
- return !item.isStudentOptional || this.paymentType !== undefined
|
|
|
+ id: val,
|
|
|
+ });
|
|
|
+ this.eclass = res.data.filter((item) => {
|
|
|
+ return !item.isStudentOptional || this.paymentType !== undefined;
|
|
|
}) || [{}];
|
|
|
|
|
|
this.syncAllMoney();
|
|
|
- } catch (error) { }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
},
|
|
|
- 'payment.paymentPattern'() {
|
|
|
- this.syncAllMoney()
|
|
|
+ "payment.paymentPattern"() {
|
|
|
+ this.syncAllMoney();
|
|
|
},
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.formatCourse()
|
|
|
+ mounted() {
|
|
|
+ this.formatCourse();
|
|
|
this.init();
|
|
|
},
|
|
|
- activated () {
|
|
|
- this.formatCourse()
|
|
|
+ activated() {
|
|
|
+ this.formatCourse();
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
- async init () {
|
|
|
+ async init() {
|
|
|
this.getCharges();
|
|
|
if (this.rowDetail) {
|
|
|
for (const key in paymentTypeFormat) {
|
|
|
if (paymentTypeFormat.hasOwnProperty(key)) {
|
|
|
const item = paymentTypeFormat[key];
|
|
|
if (item === this.rowDetail.paymentType) {
|
|
|
- this.paymentType = key
|
|
|
+ this.paymentType = key;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -340,22 +392,30 @@ export default {
|
|
|
const res = await musicGroupPaymentCalenderView({
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
batchNo: this.rowDetail.batchNo,
|
|
|
- })
|
|
|
- this.viewDetail = res.data
|
|
|
- const firstPayment = res.data.musicGroupPaymentCalenders[0] || {}
|
|
|
- this.eclass = (res.data.musicGroupPaymentCalenderCourseSettings || []).filter(item => {
|
|
|
- return !item.isStudentOptional || this.paymentType !== undefined
|
|
|
- })
|
|
|
- this.eclassuser = res.data.musicGroupPaymentCalenderStudentDetails.map(item => {
|
|
|
- if (this.paymentTypeString === 'SPAN_GROUP_CLASS_ADJUST') {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- courseOriginalPrice: item.masterSubCoursePrice
|
|
|
+ });
|
|
|
+ this.viewDetail = res.data;
|
|
|
+ const firstPayment = res.data.musicGroupPaymentCalenders[0] || {};
|
|
|
+ this.eclass = (
|
|
|
+ res.data.musicGroupPaymentCalenderCourseSettings || []
|
|
|
+ ).filter((item) => {
|
|
|
+ return !item.isStudentOptional || this.paymentType !== undefined;
|
|
|
+ });
|
|
|
+ this.eclassuser = res.data.musicGroupPaymentCalenderStudentDetails.map(
|
|
|
+ (item) => {
|
|
|
+ if (this.paymentTypeString === "SPAN_GROUP_CLASS_ADJUST") {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ courseOriginalPrice: item.masterSubCoursePrice,
|
|
|
+ };
|
|
|
}
|
|
|
+ return item;
|
|
|
}
|
|
|
- return item
|
|
|
- })
|
|
|
- this.$set(this.payment, 'paymentPattern', String(this.viewDetail.auditDto?.paymentPattern))
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.payment,
|
|
|
+ "paymentPattern",
|
|
|
+ String(this.viewDetail.auditDto?.paymentPattern)
|
|
|
+ );
|
|
|
if (this.$refs.cycle) {
|
|
|
this.$set(
|
|
|
this.cycle,
|
|
@@ -367,57 +427,80 @@ export default {
|
|
|
firstPayment.paymentValidEndDate,
|
|
|
];
|
|
|
// paymentDate startPaymentDate deadlinePaymentDate
|
|
|
- this.$set(this.cycle, "paymentDate", [firstPayment.startPaymentDate, firstPayment.deadlinePaymentDate]);
|
|
|
+ this.$set(this.cycle, "paymentDate", [
|
|
|
+ firstPayment.startPaymentDate,
|
|
|
+ firstPayment.deadlinePaymentDate,
|
|
|
+ ]);
|
|
|
this.$set(this.cycle, "paymentValid", arr);
|
|
|
}
|
|
|
- this.studentIds = firstPayment.studentIds
|
|
|
- this.$set(this.form, 'musicGroupOrganizationCourseSettingId', res.data.auditDto?.musicGroupOrganizationCourseSettingsId)
|
|
|
- this.syncAllMoney()
|
|
|
+ this.studentIds = firstPayment.studentIds;
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ "musicGroupOrganizationCourseSettingId",
|
|
|
+ res.data.auditDto?.musicGroupOrganizationCourseSettingsId
|
|
|
+ );
|
|
|
+ this.syncAllMoney();
|
|
|
} catch (error) {}
|
|
|
}
|
|
|
},
|
|
|
formatCourse() {
|
|
|
- const organId = this.musicGroup?.organId
|
|
|
- const chargeTypeId = this.musicGroup?.chargeTypeId
|
|
|
- const _ = {}
|
|
|
- const list = (this.organizationCourseUnitPriceSettings || [])
|
|
|
- .filter(item => organId && organId == item.organId && chargeTypeId && chargeTypeId == item.chargeTypeId)
|
|
|
+ const organId = this.musicGroup?.organId;
|
|
|
+ const chargeTypeId = this.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
|
|
|
+ _[item.courseType] = item;
|
|
|
}
|
|
|
- this.organizationCourseUnitPriceSettingsByType = _
|
|
|
- return _
|
|
|
+ this.organizationCourseUnitPriceSettingsByType = _;
|
|
|
+ return _;
|
|
|
},
|
|
|
- priceChange (item, index) {
|
|
|
- const _ = [...this.eclass]
|
|
|
- const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
|
|
|
- const price = Math.round(numeral(active.unitPrice || 1).multiply((item.courseTotalMinuties || 1)).value())
|
|
|
- item.courseCurrentPrice = price
|
|
|
- item.courseOriginalPrice = price
|
|
|
- _[index] = item
|
|
|
- this.eclass = [..._]
|
|
|
- this.syncAllMoney()
|
|
|
+ priceChange(item, index) {
|
|
|
+ const _ = [...this.eclass];
|
|
|
+ const active =
|
|
|
+ this.organizationCourseUnitPriceSettingsByType[item.courseType] || {};
|
|
|
+ const price = Math.round(
|
|
|
+ numeral(active.unitPrice || 1)
|
|
|
+ .multiply(item.courseTotalMinuties || 1)
|
|
|
+ .value()
|
|
|
+ );
|
|
|
+ item.courseCurrentPrice = price;
|
|
|
+ item.courseOriginalPrice = price;
|
|
|
+ _[index] = item;
|
|
|
+ this.eclass = [..._];
|
|
|
+ this.syncAllMoney();
|
|
|
},
|
|
|
- syncAllMoney () {
|
|
|
- if (this.paymentTypeString === 'SPAN_GROUP_CLASS_ADJUST') {
|
|
|
- const money = this.viewDetail?.musicGroupPaymentCalenders[0].paymentAmount
|
|
|
+ syncAllMoney() {
|
|
|
+ if (this.paymentTypeString === "SPAN_GROUP_CLASS_ADJUST") {
|
|
|
+ const money = this.viewDetail?.musicGroupPaymentCalenders[0]
|
|
|
+ .paymentAmount;
|
|
|
this.$set(this.cycle, "paymentAmount", money);
|
|
|
- return money
|
|
|
+ return money;
|
|
|
}
|
|
|
let money = 0;
|
|
|
- let first = 0
|
|
|
- let other = 0
|
|
|
- let classs = this.paymentTypeString === 'SPAN_GROUP_CLASS_ADJUST' ? this.eclassuser : this.eclass
|
|
|
+ let first = 0;
|
|
|
+ let other = 0;
|
|
|
+ let classs =
|
|
|
+ this.paymentTypeString === "SPAN_GROUP_CLASS_ADJUST"
|
|
|
+ ? this.eclassuser
|
|
|
+ : this.eclass;
|
|
|
for (const item of classs) {
|
|
|
money += item.courseCurrentPrice;
|
|
|
if (this.cycles && this.cycles.length) {
|
|
|
if (item.isStudentOptional) {
|
|
|
- first += item.courseCurrentPrice
|
|
|
+ first += item.courseCurrentPrice;
|
|
|
} else {
|
|
|
- const floorMoney = Math.floor(item.courseCurrentPrice / this.cycles.length)
|
|
|
- const remainder = item.courseCurrentPrice % this.cycles.length
|
|
|
- first += floorMoney + remainder
|
|
|
- other += floorMoney
|
|
|
+ const floorMoney = Math.floor(
|
|
|
+ item.courseCurrentPrice / this.cycles.length
|
|
|
+ );
|
|
|
+ const remainder = item.courseCurrentPrice % this.cycles.length;
|
|
|
+ first += floorMoney + remainder;
|
|
|
+ other += floorMoney;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -425,27 +508,27 @@ export default {
|
|
|
this.cycles = this.cycles.map((item, index) => {
|
|
|
return {
|
|
|
...item,
|
|
|
- paymentAmount: (index === 0 ? first : other)
|
|
|
- }
|
|
|
- })
|
|
|
+ paymentAmount: index === 0 ? first : other,
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
// if (!money) {
|
|
|
- // this.$set(this.cycle, "paymentAmount", undefined);
|
|
|
+ // this.$set(this.cycle, "paymentAmount", undefined);
|
|
|
// } else {
|
|
|
- this.$set(this.cycle, "paymentAmount", money);
|
|
|
+ this.$set(this.cycle, "paymentAmount", money);
|
|
|
// }
|
|
|
|
|
|
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.musicGroup?.organId;
|
|
|
const chargeTypeId = this.musicGroup?.chargeTypeId;
|
|
|
this.chargeTypeName = this.musicGroup?.chargeTypeName;
|
|
@@ -455,50 +538,59 @@ export default {
|
|
|
chargeTypeId,
|
|
|
organId,
|
|
|
});
|
|
|
- const ids = res.data.rows.map(item => item.id)
|
|
|
+ const ids = res.data.rows.map((item) => item.id);
|
|
|
if (!ids.includes(this.form.musicGroupOrganizationCourseSettingId)) {
|
|
|
- this.$set(this.form, 'musicGroupOrganizationCourseSettingId', null)
|
|
|
+ this.$set(this.form, "musicGroupOrganizationCourseSettingId", null);
|
|
|
}
|
|
|
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.cycles.length - 1);
|
|
|
- this.syncAllMoney()
|
|
|
+ this.syncAllMoney();
|
|
|
},
|
|
|
- removeCycle (index) {
|
|
|
+ removeCycle(index) {
|
|
|
this.cycles[index] = null;
|
|
|
this.cycles = this.cycles.filter((item) => !!item);
|
|
|
if (this.collapse.includes(index)) {
|
|
|
this.collapse.splice(index, 1);
|
|
|
- this.collapse = this.collapse.map((item, _index) => _index - 1 >= index ? item -- : item)
|
|
|
+ this.collapse = this.collapse.map((item, _index) =>
|
|
|
+ _index - 1 >= index ? item-- : item
|
|
|
+ );
|
|
|
}
|
|
|
- this.syncAllMoney()
|
|
|
+ this.syncAllMoney();
|
|
|
},
|
|
|
- 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.cycles || []), refs.other, refs.payment]
|
|
|
+ return [
|
|
|
+ refs.base,
|
|
|
+ refs.eclass,
|
|
|
+ refs.cycle,
|
|
|
+ ...(refs.cycles || []),
|
|
|
+ refs.other,
|
|
|
+ refs.payment,
|
|
|
+ ]
|
|
|
.filter((item) => !!item)
|
|
|
.map((item) => item.$refs.form || item);
|
|
|
},
|
|
|
changeActive(val) {
|
|
|
if (this.$listeners.changeActive) {
|
|
|
- this.$listeners.changeActive(val)
|
|
|
+ this.$listeners.changeActive(val);
|
|
|
}
|
|
|
},
|
|
|
async submit() {
|
|
@@ -512,37 +604,47 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
if (this.eclass.length < 1 && this.eclassuser.length < 1) {
|
|
|
- return this.$message.error('请至少选择一条加课信息')
|
|
|
+ return this.$message.error("请至少选择一条加课信息");
|
|
|
}
|
|
|
if (valided.length === forms.length) {
|
|
|
const { leixing, ...rest } = {
|
|
|
...this.form,
|
|
|
...this.other,
|
|
|
paymentPattern: this.payment.paymentPattern,
|
|
|
- musicGroupPaymentDateRangeList: [...this.cycles.map(item => {
|
|
|
- const { paymentDate, paymentValid, ...other } = item
|
|
|
- return {
|
|
|
- ...other,
|
|
|
- ...getTimes(paymentDate, ["startPaymentDate", "deadlinePaymentDate"]),
|
|
|
- ...getTimes(paymentValid, [
|
|
|
- "paymentValidStartDate",
|
|
|
- "paymentValidEndDate",
|
|
|
- ]),
|
|
|
- }
|
|
|
- })],
|
|
|
+ musicGroupPaymentDateRangeList: [
|
|
|
+ ...this.cycles.map((item) => {
|
|
|
+ const { paymentDate, paymentValid, ...other } = item;
|
|
|
+ return {
|
|
|
+ ...other,
|
|
|
+ ...getTimes(paymentDate, [
|
|
|
+ "startPaymentDate",
|
|
|
+ "deadlinePaymentDate",
|
|
|
+ ]),
|
|
|
+ ...getTimes(paymentValid, [
|
|
|
+ "paymentValidStartDate",
|
|
|
+ "paymentValidEndDate",
|
|
|
+ ]),
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ ],
|
|
|
musicGroupPaymentCalenderCourseSettingsList: this.eclass,
|
|
|
musicGroupPaymentCalenderStudentDetails: this.eclassuser,
|
|
|
};
|
|
|
if (this.$refs.cycle) {
|
|
|
- const { paymentDate, paymentValid, ...other } = this.cycle
|
|
|
- rest.musicGroupPaymentDateRangeList = [{
|
|
|
+ const { paymentDate, paymentValid, ...other } = this.cycle;
|
|
|
+ rest.musicGroupPaymentDateRangeList = [
|
|
|
+ {
|
|
|
...other,
|
|
|
- ...getTimes(paymentDate, ["startPaymentDate", "deadlinePaymentDate"]),
|
|
|
+ ...getTimes(paymentDate, [
|
|
|
+ "startPaymentDate",
|
|
|
+ "deadlinePaymentDate",
|
|
|
+ ]),
|
|
|
...getTimes(paymentValid, [
|
|
|
"paymentValidStartDate",
|
|
|
"paymentValidEndDate",
|
|
|
]),
|
|
|
- }]
|
|
|
+ },
|
|
|
+ ];
|
|
|
}
|
|
|
const data = {
|
|
|
...rest,
|
|
@@ -554,37 +656,43 @@ export default {
|
|
|
],
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
};
|
|
|
- const info = this.viewDetail?.musicGroupPaymentCalenders[0]
|
|
|
- if (info && this.viewDetail?.auditDto.paymentType === 'ADD_STUDENT') {
|
|
|
- data.attribute1 = info.attribute1
|
|
|
+ const info = this.viewDetail?.musicGroupPaymentCalenders[0];
|
|
|
+ if (info && this.viewDetail?.auditDto.paymentType === "ADD_STUDENT") {
|
|
|
+ data.attribute1 = info.attribute1;
|
|
|
}
|
|
|
+
|
|
|
if (!this.rowDetail?.batchNo) {
|
|
|
+
|
|
|
+
|
|
|
try {
|
|
|
const res = await musicGroupPaymentCalenderAdd(data);
|
|
|
- this.$listeners.close();
|
|
|
- this.$listeners.submited(res.data);
|
|
|
- // 在这里
|
|
|
- if (this.$route.query.type == "teamDraft") {
|
|
|
- this.$router.push({
|
|
|
- query: merge(this.$route.query, { 'type': 'feeAudit' })
|
|
|
- });
|
|
|
+ if (this.$route.query.team_status == "PRE_BUILD_FEE") {
|
|
|
+ this.$message.success("创建成功");
|
|
|
+ this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
+ this.$router.push({
|
|
|
+ path: "/teamList",
|
|
|
+ });
|
|
|
}
|
|
|
- } catch (error) { }
|
|
|
+
|
|
|
+ // this.$listeners.close();
|
|
|
+ // this.$listeners.submited(res.data);
|
|
|
+
|
|
|
+ // 在这里
|
|
|
+ } catch (error) {}
|
|
|
} else {
|
|
|
try {
|
|
|
- data.batchNo = this.rowDetail.batchNo
|
|
|
+ data.batchNo = this.rowDetail.batchNo;
|
|
|
// 缴费类型无法修改,按照之前覆盖
|
|
|
- data.paymentType = this.viewDetail.musicGroupPaymentCalenders[0]?.paymentType
|
|
|
+ data.paymentType = this.viewDetail.musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
|
|
|
this.$listeners.close();
|
|
|
this.$listeners.submited(res.data);
|
|
|
if (this.$route.query.type == "teamDraft") {
|
|
|
this.$router.push({
|
|
|
- query: merge(this.$route.query, { 'type': 'feeAudit' })
|
|
|
+ query: merge(this.$route.query, { type: "feeAudit" }),
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
- } catch (error) { }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
}
|
|
|
},
|