|
@@ -48,7 +48,7 @@
|
|
|
class="alert"
|
|
|
type="info">
|
|
|
</el-alert>
|
|
|
- <template v-if="isUserType && paymentType == '0'">
|
|
|
+ <template v-if="isMulticycle">
|
|
|
<el-form ref="payment" :model="payment">
|
|
|
<el-form-item
|
|
|
label-width="160px"
|
|
@@ -137,6 +137,7 @@ import {
|
|
|
musicGroupPaymentCalenderAdd,
|
|
|
musicGroupPaymentCalenderDetailBatchUpdate,
|
|
|
queryByMusicGroupOrganizationCourseSettingsId,
|
|
|
+ musicGroupPaymentCalenderView,
|
|
|
} from "../api";
|
|
|
import { paymentPatternType } from '@/constant'
|
|
|
import { getTimes, objectToOptions } from "@/utils";
|
|
@@ -184,6 +185,7 @@ export default {
|
|
|
payment: {
|
|
|
paymentPattern: null,
|
|
|
},
|
|
|
+ viewDetail: null,
|
|
|
organizationCourseUnitPriceSettingsByType: {},
|
|
|
paymentPatternTypeOptions: objectToOptions(paymentPatternType),
|
|
|
};
|
|
@@ -210,6 +212,23 @@ export default {
|
|
|
},
|
|
|
paymentAmountDisabled() {
|
|
|
return (this.isUserType || (this.isCommon && this.isUserType)) && this.isDisabled
|
|
|
+ },
|
|
|
+ isMulticycle() {
|
|
|
+ let editMulticycle = false
|
|
|
+ if (this.viewDetail) {
|
|
|
+ const { musicGroupPaymentCalenders, auditDto } = this.viewDetail
|
|
|
+ editMulticycle = (musicGroupPaymentCalenders > 1 ||
|
|
|
+ musicGroupPaymentCalenders[0]?.paymentType == 'MUSIC_APPLY')
|
|
|
+ if (editMulticycle) {
|
|
|
+ this.$set(this.payment, 'paymentPattern', String(auditDto?.paymentPattern))
|
|
|
+ this.cycles = musicGroupPaymentCalenders.map(item => ({
|
|
|
+ paymentAmount: item.paymentAmount,
|
|
|
+ paymentDate: [item?.startPaymentDate, item?.deadlinePaymentDate],
|
|
|
+ paymentValid: [item?.paymentValidStartDate, item?.paymentValidEndDate]
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return this.isUserType && this.paymentType == '0' || editMulticycle
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -240,16 +259,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async "form.musicGroupOrganizationCourseSettingId" (val) {
|
|
|
- try {
|
|
|
- const res = await queryByMusicGroupOrganizationCourseSettingsId({
|
|
|
- id: val
|
|
|
- })
|
|
|
- this.eclass = res.data.filter(item => {
|
|
|
- return !item.isStudentOptional || this.paymentType !== undefined
|
|
|
- }) || [{}];
|
|
|
+ if (val) {
|
|
|
+ try {
|
|
|
+ const res = await queryByMusicGroupOrganizationCourseSettingsId({
|
|
|
+ id: val
|
|
|
+ })
|
|
|
+ this.eclass = res.data.filter(item => {
|
|
|
+ return !item.isStudentOptional || this.paymentType !== undefined
|
|
|
+ }) || [{}];
|
|
|
|
|
|
- this.syncAllMoney();
|
|
|
- } catch (error) { }
|
|
|
+ this.syncAllMoney();
|
|
|
+ } catch (error) { }
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
mounted () {
|
|
@@ -278,17 +299,18 @@ export default {
|
|
|
this.rowDetail.isGiveMusicNetwork
|
|
|
);
|
|
|
this.$set(this.other, "memo", this.rowDetail.memo);
|
|
|
- if (this.rowDetail.musicGroupOrganizationCourseSettingId) {
|
|
|
- this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
|
|
|
- } else {
|
|
|
- try {
|
|
|
- const res = await getMusicGroupPaymentCalenderDetail({
|
|
|
- id: this.rowDetail.id
|
|
|
- })
|
|
|
- this.eclass = res.data.musicGroupPaymentCalenderCourseSettings
|
|
|
- this.syncAllMoney()
|
|
|
- } catch (error) {}
|
|
|
- }
|
|
|
+ try {
|
|
|
+ const res = await musicGroupPaymentCalenderView({
|
|
|
+ musicGroupId: this.musicGroupId,
|
|
|
+ batchNo: this.rowDetail.batchNo,
|
|
|
+ })
|
|
|
+ this.viewDetail = res.data
|
|
|
+ this.eclass = (res.data.musicGroupPaymentCalenderCourseSettings || []).filter(item => {
|
|
|
+ return !item.isStudentOptional || this.paymentType !== undefined
|
|
|
+ })
|
|
|
+ this.$set(this.form, 'musicGroupOrganizationCourseSettingId', res.data.auditDto?.musicGroupOrganizationCourseSettingsId)
|
|
|
+ this.syncAllMoney()
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
},
|
|
|
formatCourse() {
|
|
@@ -325,7 +347,6 @@ export default {
|
|
|
} else {
|
|
|
const floorMoney = Math.floor((item.courseCurrentPrice * 100) / this.cycles.length)
|
|
|
const remainder = (item.courseCurrentPrice * 100) % this.cycles.length
|
|
|
- console.log(remainder, item.courseCurrentPrice, this.cycles.length)
|
|
|
first += floorMoney + remainder
|
|
|
other += floorMoney
|
|
|
}
|
|
@@ -404,13 +425,17 @@ export default {
|
|
|
},
|
|
|
addCycle () {
|
|
|
this.cycles.push({});
|
|
|
- this.collapse.push(this.collapse.length);
|
|
|
+ this.collapse.push(this.cycles.length - 1);
|
|
|
this.syncAllMoney()
|
|
|
},
|
|
|
removeCycle (index) {
|
|
|
this.cycles[index] = null;
|
|
|
this.cycles = this.cycles.filter((item) => !!item);
|
|
|
- this.collapse.pop();
|
|
|
+ if (this.collapse.includes(index)) {
|
|
|
+ this.collapse.splice(index, 1);
|
|
|
+ this.collapse = this.collapse.map((item, _index) => _index - 1 >= index ? item -- : item)
|
|
|
+ console.log(this.collapse)
|
|
|
+ }
|
|
|
this.syncAllMoney()
|
|
|
},
|
|
|
collapseChange (val) {
|
|
@@ -501,7 +526,7 @@ export default {
|
|
|
try {
|
|
|
data.batchNo = this.rowDetail.batchNo
|
|
|
// 缴费类型无法修改,按照之前覆盖
|
|
|
- data.paymentType = this.rowDetail.paymentType
|
|
|
+ data.paymentType = this.viewDetail.musicGroupPaymentCalenders[0]?.paymentType
|
|
|
const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
|
|
|
this.$listeners.close();
|
|
|
this.$listeners.submited(res.data);
|