|
@@ -101,12 +101,22 @@
|
|
|
class="alert"
|
|
|
style="margin-top: 20px"
|
|
|
type="info"
|
|
|
- v-if="courseViewType == 2 && paymentType && paymentType != 2&&form.leixing !=2"
|
|
|
+ v-if="
|
|
|
+ courseViewType == 2 &&
|
|
|
+ paymentType &&
|
|
|
+ paymentType != 2 &&
|
|
|
+ form.leixing != 2
|
|
|
+ "
|
|
|
>
|
|
|
</el-alert>
|
|
|
<memberSetting
|
|
|
ref="memberSetting"
|
|
|
- v-if="courseViewType == 2 && paymentType && paymentType != 2&&form.leixing !=2"
|
|
|
+ v-if="
|
|
|
+ courseViewType == 2 &&
|
|
|
+ paymentType &&
|
|
|
+ paymentType != 2 &&
|
|
|
+ form.leixing != 2
|
|
|
+ "
|
|
|
:form="memberForm"
|
|
|
:viewDetail="nowDetail"
|
|
|
:isUserType="isUserType"
|
|
@@ -114,7 +124,9 @@
|
|
|
:addStudent="showMember"
|
|
|
:showTime="paymentType == 1"
|
|
|
/>
|
|
|
- <div v-if="!(courseViewType == 2 && paymentType == 1&&form.leixing !=2)">
|
|
|
+ <div
|
|
|
+ v-if="!(courseViewType == 2 && paymentType == 1 && form.leixing != 2)"
|
|
|
+ >
|
|
|
<el-alert title="缴费设置" :closable="false" class="alert" type="info">
|
|
|
</el-alert>
|
|
|
<!-- 缴费设置的 不是会员团切不是续费 续费{{form.leixing}} -->
|
|
@@ -192,7 +204,6 @@
|
|
|
icon="el-icon-circle-plus-outline"
|
|
|
plain
|
|
|
type="info"
|
|
|
-
|
|
|
style="width: 100%; margin: 20px 0"
|
|
|
@click="addCycle"
|
|
|
>新增缴费周期</el-button
|
|
@@ -205,7 +216,10 @@
|
|
|
:hidePaymentPattern="true"
|
|
|
:isUserType="isUserType"
|
|
|
:isDisabled="
|
|
|
- form.leixing === '1' || form.leixing === '2' || paymentType === '0' || form.leixing === '3'
|
|
|
+ form.leixing === '1' ||
|
|
|
+ form.leixing === '2' ||
|
|
|
+ paymentType === '0' ||
|
|
|
+ form.leixing === '3'
|
|
|
"
|
|
|
:courseViewType="courseViewType"
|
|
|
v-else
|
|
@@ -245,7 +259,8 @@ import {
|
|
|
musicGroupPaymentCalenderDetailBatchUpdate,
|
|
|
queryByMusicGroupOrganizationCourseSettingsId,
|
|
|
musicGroupPaymentCalenderView,
|
|
|
- musicGroupPaymentAuditListDetail
|
|
|
+ musicGroupPaymentAuditListDetail,
|
|
|
+ musicGroupresetCalender
|
|
|
} from "../api";
|
|
|
import { paymentPatternType } from "@/constant";
|
|
|
import { getTimes, objectToOptions } from "@/utils";
|
|
@@ -320,6 +335,8 @@ export default {
|
|
|
memberPaymentAmount: "",
|
|
|
originalMemberPaymentAmount: "",
|
|
|
paymentDate: [],
|
|
|
+ num: "",
|
|
|
+ period: "",
|
|
|
},
|
|
|
money: "",
|
|
|
isSetCourseSettingsId: false,
|
|
@@ -336,7 +353,11 @@ export default {
|
|
|
return this.viewDetail;
|
|
|
},
|
|
|
isCommon() {
|
|
|
- return this.form.leixing === "1" || this.form.leixing === "3" || (this.courseViewType !=2&&this.form.leixing === "0");
|
|
|
+ return (
|
|
|
+ this.form.leixing === "1" ||
|
|
|
+ this.form.leixing === "3" ||
|
|
|
+ (this.courseViewType != 2 && this.form.leixing === "0")
|
|
|
+ );
|
|
|
},
|
|
|
isDisabled() {
|
|
|
return this.form.leixing === "1" || String(this.paymentType) === "0";
|
|
@@ -361,36 +382,37 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
isMulticycle() {
|
|
|
- let editMulticycle = false;
|
|
|
- let paymentType = "";
|
|
|
- if (this.viewDetail) {
|
|
|
- const { musicGroupPaymentCalenders, auditDto } = this.viewDetail;
|
|
|
- paymentType = musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
- editMulticycle =
|
|
|
- musicGroupPaymentCalenders.length > 1 || paymentType != "ADD_COURSE";
|
|
|
- if (editMulticycle) {
|
|
|
- this.cycles = musicGroupPaymentCalenders.map((item) => ({
|
|
|
- paymentAmount: item.paymentAmount,
|
|
|
- paymentDate: [item?.startPaymentDate, item?.deadlinePaymentDate],
|
|
|
- paymentValid: [
|
|
|
- item?.paymentValidStartDate,
|
|
|
- item?.paymentValidEndDate,
|
|
|
- ],
|
|
|
- }));
|
|
|
- }
|
|
|
- }
|
|
|
- return (
|
|
|
- (this.payment.paymentPattern == 0 &&
|
|
|
- this.form.leixing !== "2" &&
|
|
|
- paymentType !== "ADD_COURSE") ||
|
|
|
- (this.payment.paymentPattern == 0 && editMulticycle)
|
|
|
- );
|
|
|
+ // let editMulticycle = false;
|
|
|
+ // let paymentType = "";
|
|
|
+ // if (this.viewDetail) {
|
|
|
+ // const { musicGroupPaymentCalenders, auditDto } = this.viewDetail;
|
|
|
+ // paymentType = musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
+ // editMulticycle =
|
|
|
+ // musicGroupPaymentCalenders.length > 1 || paymentType != "ADD_COURSE";
|
|
|
+ // if (editMulticycle) {
|
|
|
+ // this.cycles = musicGroupPaymentCalenders.map((item) => ({
|
|
|
+ // paymentAmount: item.paymentAmount,
|
|
|
+ // paymentDate: [item?.startPaymentDate, item?.deadlinePaymentDate],
|
|
|
+ // paymentValid: [
|
|
|
+ // item?.paymentValidStartDate,
|
|
|
+ // item?.paymentValidEndDate,
|
|
|
+ // ],
|
|
|
+ // }));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // (
|
|
|
+ // (this.payment.paymentPattern == 0 &&
|
|
|
+ // this.form.leixing !== "2" &&
|
|
|
+ // paymentType !== "ADD_COURSE") ||
|
|
|
+ // (this.payment.paymentPattern == 0 && editMulticycle)
|
|
|
+ // );
|
|
|
+ return false;
|
|
|
},
|
|
|
paymentTypeString() {
|
|
|
let paymentType = "";
|
|
|
if (this.viewDetail) {
|
|
|
const { musicGroupPaymentCalenders } = this.viewDetail;
|
|
|
- paymentType = musicGroupPaymentCalenders[0]?.paymentType;
|
|
|
+ paymentType = this.viewDetail?.calender?.paymentType;
|
|
|
}
|
|
|
return paymentType;
|
|
|
},
|
|
@@ -416,7 +438,7 @@ export default {
|
|
|
this.cycle = {};
|
|
|
this.$set(this.form, "musicGroupOrganizationCourseSettingId", undefined);
|
|
|
this.$set(this.cycle, "paymentAmount", undefined);
|
|
|
- this.$set(this.other, "memo", null);
|
|
|
+ this.$set(this.other, "memo", null);
|
|
|
if (val === "1") {
|
|
|
this.eclass = [];
|
|
|
} else if (val === "2") {
|
|
@@ -475,8 +497,8 @@ export default {
|
|
|
if (paymentTypeFormat.hasOwnProperty(key)) {
|
|
|
const item = paymentTypeFormat[key];
|
|
|
if (item === this.rowDetail.paymentType) {
|
|
|
- this.$emit('changePaymentType',key)
|
|
|
- this.$set(this.form, "leixing", key+'');
|
|
|
+ this.$emit("changePaymentType", key);
|
|
|
+ this.$set(this.form, "leixing", key + "");
|
|
|
// this.paymentType = key;
|
|
|
}
|
|
|
}
|
|
@@ -487,94 +509,125 @@ export default {
|
|
|
"isGiveMusicNetwork",
|
|
|
this.rowDetail.isGiveMusicNetwork
|
|
|
);
|
|
|
- this.$set(this.other, "memo", this.rowDetail.memo);
|
|
|
- try {
|
|
|
- const res = await musicGroupPaymentAuditListDetail({
|
|
|
- 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,
|
|
|
- };
|
|
|
- }
|
|
|
- return item;
|
|
|
- });
|
|
|
- this.$set(
|
|
|
- this.payment,
|
|
|
- "paymentPattern",
|
|
|
- String(this.viewDetail.auditDto?.paymentPattern)
|
|
|
- );
|
|
|
- // 添加会员缴费信息
|
|
|
- this.$set(
|
|
|
- this.memberForm,
|
|
|
- "memberRankSettingId",
|
|
|
- this.viewDetail.musicGroupPaymentCalenders[0].memberRankSettingId ||
|
|
|
- null
|
|
|
- );
|
|
|
|
|
|
- this.$set(
|
|
|
- this.memberForm,
|
|
|
- "memberValidDate",
|
|
|
- this.viewDetail.musicGroupPaymentCalenders[0].memberValidDate ||
|
|
|
- null
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.memberForm,
|
|
|
- "memberPaymentAmount",
|
|
|
- this.viewDetail.musicGroupPaymentCalenders[0].memberPaymentAmount
|
|
|
- );
|
|
|
- this.$set(
|
|
|
- this.memberForm,
|
|
|
- "originalMemberPaymentAmount",
|
|
|
- this.viewDetail.musicGroupPaymentCalenders[0]
|
|
|
- .originalMemberPaymentAmount
|
|
|
- );
|
|
|
-
|
|
|
- if (this.$refs.cycle) {
|
|
|
+ if (this.rowDetail.paymentType == "ADD_STUDENT") {
|
|
|
+ try {
|
|
|
+ const res = await getMusicGroupPaymentCalenderDetail({
|
|
|
+ id: this.rowDetail.id,
|
|
|
+ });
|
|
|
+ this.viewDetail = res.data;
|
|
|
+ this.eclass = res.data.course || [];
|
|
|
this.$set(
|
|
|
- this.cycle,
|
|
|
- "paymentPattern",
|
|
|
- firstPayment.paymentPattern + ""
|
|
|
+ this.memberForm,
|
|
|
+ "memberRankSettingId",
|
|
|
+ this.viewDetail.member.memberRankSettingId || null
|
|
|
);
|
|
|
- let arr = [
|
|
|
- firstPayment.paymentValidStartDate,
|
|
|
- firstPayment.paymentValidEndDate,
|
|
|
- ];
|
|
|
- // paymentDate startPaymentDate deadlinePaymentDate
|
|
|
+ this.$set(
|
|
|
+ this.memberForm,
|
|
|
+ "num",
|
|
|
+ this.viewDetail.member.num || null
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.memberForm,
|
|
|
+ "period",
|
|
|
+ this.viewDetail.member.period || null
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.memberForm,
|
|
|
+ "memberPaymentAmount",
|
|
|
+ this.viewDetail.member.actualAmount || null
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.memberForm,
|
|
|
+ "originalMemberPaymentAmount",
|
|
|
+ this.viewDetail.member.originalAmount || null
|
|
|
+ );
|
|
|
+ console.log(
|
|
|
+ this.viewDetail.member.originalAmount,
|
|
|
+ this.viewDetail.member.actualAmount
|
|
|
+ );
|
|
|
+ this.$set(this.memberForm, "memberValidDate", [
|
|
|
+ this.viewDetail.calender.startPaymentDate,
|
|
|
+ this.viewDetail.calender.deadlinePaymentDate,
|
|
|
+ ]);
|
|
|
this.$set(this.cycle, "paymentDate", [
|
|
|
- firstPayment.startPaymentDate,
|
|
|
- firstPayment.deadlinePaymentDate,
|
|
|
+ this.viewDetail.calender.startPaymentDate,
|
|
|
+ this.viewDetail.calender.deadlinePaymentDate,
|
|
|
]);
|
|
|
- this.$set(this.cycle, "paymentValid", arr);
|
|
|
- }
|
|
|
- this.studentIds = firstPayment.studentIds;
|
|
|
- if (res.data.auditDto?.musicGroupOrganizationCourseSettingsId) {
|
|
|
- this.isSetCourseSettingsId = true;
|
|
|
- }
|
|
|
- this.$set(
|
|
|
- this.form,
|
|
|
- "musicGroupOrganizationCourseSettingId",
|
|
|
- res.data.auditDto?.musicGroupOrganizationCourseSettingsId
|
|
|
- );
|
|
|
- if (this.courseViewType == 2 && this.form.leixing == 1) {
|
|
|
- // 会员团续费
|
|
|
|
|
|
- this.$set(this.memberForm, "paymentDate", [dayjs(firstPayment.startPaymentDate).format("YYYY-MM-DD"),dayjs(firstPayment.deadlinePaymentDate).format("YYYY-MM-DD")
|
|
|
- ]);
|
|
|
+ this.$set(this.other, "memo", this.viewDetail.calender.memo);
|
|
|
+ this.syncAllMoney();
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
}
|
|
|
- this.syncAllMoney();
|
|
|
- } catch (error) {}
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ const res = await musicGroupPaymentAuditListDetail({
|
|
|
+ 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,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ this.$set(
|
|
|
+ this.payment,
|
|
|
+ "paymentPattern",
|
|
|
+ String(this.viewDetail.auditDto?.paymentPattern)
|
|
|
+ );
|
|
|
+
|
|
|
+ // 添加会员缴费信息
|
|
|
+
|
|
|
+ if (this.$refs.cycle) {
|
|
|
+ this.$set(
|
|
|
+ this.cycle,
|
|
|
+ "paymentPattern",
|
|
|
+ firstPayment.paymentPattern + ""
|
|
|
+ );
|
|
|
+ let arr = [
|
|
|
+ firstPayment.paymentValidStartDate,
|
|
|
+ firstPayment.paymentValidEndDate,
|
|
|
+ ];
|
|
|
+ // paymentDate startPaymentDate deadlinePaymentDate
|
|
|
+ this.$set(this.cycle, "paymentDate", [
|
|
|
+ firstPayment.startPaymentDate,
|
|
|
+ firstPayment.deadlinePaymentDate,
|
|
|
+ ]);
|
|
|
+ this.$set(this.cycle, "paymentValid", arr);
|
|
|
+ }
|
|
|
+ this.studentIds = firstPayment.studentIds;
|
|
|
+ if (res.data.auditDto?.musicGroupOrganizationCourseSettingsId) {
|
|
|
+ this.isSetCourseSettingsId = true;
|
|
|
+ }
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ "musicGroupOrganizationCourseSettingId",
|
|
|
+ res.data.auditDto?.musicGroupOrganizationCourseSettingsId
|
|
|
+ );
|
|
|
+ if (this.courseViewType == 2 && this.form.leixing == 1) {
|
|
|
+ // 会员团续费
|
|
|
+
|
|
|
+ this.$set(this.memberForm, "paymentDate", [
|
|
|
+ dayjs(firstPayment.startPaymentDate).format("YYYY-MM-DD"),
|
|
|
+ dayjs(firstPayment.deadlinePaymentDate).format("YYYY-MM-DD"),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ this.syncAllMoney();
|
|
|
+ } catch (error) {}
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
formatCourse() {
|
|
@@ -679,10 +732,10 @@ export default {
|
|
|
}
|
|
|
this.charges = res.data.rows;
|
|
|
// this.charges =[];
|
|
|
- if(this.charges.length<=0){
|
|
|
- this.$bus.$emit("showguide", ['teamCourseFee']);
|
|
|
- return
|
|
|
- }
|
|
|
+ if (this.charges.length <= 0) {
|
|
|
+ this.$bus.$emit("showguide", ["teamCourseFee"]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
} catch (error) {}
|
|
|
},
|
|
|
addExtraClass() {
|
|
@@ -754,16 +807,80 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (valided.length === forms.length) {
|
|
|
- // 验证通过
|
|
|
- const { leixing, ...rest } = {
|
|
|
- ...this.form,
|
|
|
- ...this.other,
|
|
|
+ if (this.rowDetail.paymentType == "ADD_STUDENT") {
|
|
|
+ const data = {
|
|
|
+ calenderId:this.viewDetail.calender.id,
|
|
|
+ calenderMember: {
|
|
|
+ ...this.memberForm,
|
|
|
+ actualAmount: this.memberForm.memberPaymentAmount,
|
|
|
+ originalAmount: this.memberForm.originalMemberPaymentAmount,
|
|
|
+ },
|
|
|
+ calenderAddStudent: {
|
|
|
+ classGroupIds: this.viewDetail.calender.attribute1,
|
|
|
+ studentIds: this.viewDetail.calender.studentIds,
|
|
|
+ },
|
|
|
+ ...getTimes(this.cycle.paymentDate, [
|
|
|
+ "startPaymentDate",
|
|
|
+ "deadlinePaymentDate",
|
|
|
+ ]),
|
|
|
+ // paymentPattern: this.payment.paymentPattern,
|
|
|
+ musicGroupId: this.musicGroupId,
|
|
|
+ paymentType: "ADD_STUDENT",
|
|
|
+ payUserType: "STUDENT",
|
|
|
|
|
|
- // paymentPattern: this.payment.paymentPattern,
|
|
|
- musicGroupPaymentDateRangeList: [
|
|
|
- ...this.cycles.map((item) => {
|
|
|
- const { paymentDate, paymentValid, ...other } = item;
|
|
|
- return {
|
|
|
+ musicGroupPaymentCalenderCourseSettingsList: this.eclass,
|
|
|
+ ...this.other,
|
|
|
+ };
|
|
|
+ try {
|
|
|
+ await musicGroupresetCalender(data);
|
|
|
+ this.$message.success("提交成功");
|
|
|
+ this.$listeners.submited();
|
|
|
+ this.$listeners.close();
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 验证通过
|
|
|
+ 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",
|
|
|
+ ]),
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ ],
|
|
|
+
|
|
|
+ musicGroupPaymentCalenderCourseSettingsList: this.eclass,
|
|
|
+ musicGroupPaymentCalenderStudentDetails: this.eclassuser,
|
|
|
+ };
|
|
|
+ // 如果是会员团续费 则添加缴费开始时间 缴费结束时间
|
|
|
+ const { paymentDate, ...some } = this.memberForm;
|
|
|
+ if (this.courseViewType == 2 && this.form.leixing == 1) {
|
|
|
+ rest.musicGroupPaymentDateRangeList[0] = {
|
|
|
+ ...getTimes(paymentDate, [
|
|
|
+ "startPaymentDate",
|
|
|
+ "deadlinePaymentDate",
|
|
|
+ ]),
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$refs.cycle) {
|
|
|
+ const { paymentDate, paymentValid, ...other } = this.cycle;
|
|
|
+ rest.musicGroupPaymentDateRangeList = [
|
|
|
+ {
|
|
|
...other,
|
|
|
...getTimes(paymentDate, [
|
|
|
"startPaymentDate",
|
|
@@ -773,109 +890,81 @@ export default {
|
|
|
"paymentValidStartDate",
|
|
|
"paymentValidEndDate",
|
|
|
]),
|
|
|
- };
|
|
|
- }),
|
|
|
- ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
|
|
|
- musicGroupPaymentCalenderCourseSettingsList: this.eclass,
|
|
|
- musicGroupPaymentCalenderStudentDetails: this.eclassuser,
|
|
|
- };
|
|
|
- // 如果是会员团续费 则添加缴费开始时间 缴费结束时间
|
|
|
- const { paymentDate, ...some } = this.memberForm;
|
|
|
- if (this.courseViewType == 2 && this.form.leixing == 1) {
|
|
|
- rest.musicGroupPaymentDateRangeList[0] = {
|
|
|
- ...getTimes(paymentDate, [
|
|
|
- "startPaymentDate",
|
|
|
- "deadlinePaymentDate",
|
|
|
- ]),
|
|
|
+ const data = {
|
|
|
+ ...rest,
|
|
|
+ ...some,
|
|
|
+ isGiveMusicNetwork: false,
|
|
|
+ studentIds: this.studentIds,
|
|
|
+ paymentType:
|
|
|
+ paymentTypeFormat[
|
|
|
+ this.paymentType == 0 ? this.paymentType : leixing
|
|
|
+ ],
|
|
|
+ musicGroupId: this.musicGroupId,
|
|
|
};
|
|
|
- }
|
|
|
-
|
|
|
- if (this.$refs.cycle) {
|
|
|
- const { paymentDate, paymentValid, ...other } = this.cycle;
|
|
|
- rest.musicGroupPaymentDateRangeList = [
|
|
|
- {
|
|
|
- ...other,
|
|
|
- ...getTimes(paymentDate, [
|
|
|
- "startPaymentDate",
|
|
|
- "deadlinePaymentDate",
|
|
|
- ]),
|
|
|
- ...getTimes(paymentValid, [
|
|
|
- "paymentValidStartDate",
|
|
|
- "paymentValidEndDate",
|
|
|
- ]),
|
|
|
- },
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- const data = {
|
|
|
- ...rest,
|
|
|
- ...some,
|
|
|
- isGiveMusicNetwork: false,
|
|
|
- studentIds: this.studentIds,
|
|
|
- paymentType:
|
|
|
- paymentTypeFormat[
|
|
|
- this.paymentType == 0 ? this.paymentType : leixing
|
|
|
- ],
|
|
|
- musicGroupId: this.musicGroupId,
|
|
|
- };
|
|
|
- const info = this.viewDetail?.musicGroupPaymentCalenders[0];
|
|
|
- if (info && this.viewDetail?.auditDto.paymentType === "ADD_STUDENT") {
|
|
|
- data.attribute1 = info.attribute1;
|
|
|
- }
|
|
|
- // courseViewType == 1&&paymentType !== undefined
|
|
|
- let hasCourseFee = false;
|
|
|
-
|
|
|
- for (const item of data.musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
- if (item.courseCurrentPrice > 0 || item.isStudentOptional == true) {
|
|
|
- hasCourseFee = true;
|
|
|
- break;
|
|
|
+ const info = this.viewDetail?.musicGroupPaymentCalenders[0];
|
|
|
+ if (info && this.viewDetail?.auditDto.paymentType === "ADD_STUDENT") {
|
|
|
+ data.attribute1 = info.attribute1;
|
|
|
}
|
|
|
- }
|
|
|
- // console.log(this.baseInfo?.musicGroup?.courseViewType, this.paymentType, hasCourseFee, this.type)
|
|
|
- if (
|
|
|
- (this.baseInfo?.musicGroup?.courseViewType == 2 ||
|
|
|
- this.baseInfo?.musicGroup?.courseViewType == 3) &&
|
|
|
- this.paymentType == 0 &&
|
|
|
- hasCourseFee &&
|
|
|
- this.type === "user"
|
|
|
- ) {
|
|
|
- this.$message.error(
|
|
|
- "会员收费模式报名缴费项目课程费用不得大于0且不可选"
|
|
|
- );
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.rowDetail?.batchNo) {
|
|
|
- try {
|
|
|
- const res = await musicGroupPaymentCalenderAdd(data);
|
|
|
- if (this.$route.query.team_status == "PRE_BUILD_FEE") {
|
|
|
- this.$message.success("创建成功");
|
|
|
- this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
- this.$router.push({
|
|
|
- path: "/teamList",
|
|
|
- });
|
|
|
+ // courseViewType == 1&&paymentType !== undefined
|
|
|
+ let hasCourseFee = false;
|
|
|
+
|
|
|
+ for (const item of data.musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
+ if (item.courseCurrentPrice > 0 || item.isStudentOptional == true) {
|
|
|
+ hasCourseFee = true;
|
|
|
+ break;
|
|
|
}
|
|
|
+ }
|
|
|
+ // console.log(this.baseInfo?.musicGroup?.courseViewType, this.paymentType, hasCourseFee, this.type)
|
|
|
+ if (
|
|
|
+ (this.baseInfo?.musicGroup?.courseViewType == 2 ||
|
|
|
+ this.baseInfo?.musicGroup?.courseViewType == 3) &&
|
|
|
+ this.paymentType == 0 &&
|
|
|
+ hasCourseFee &&
|
|
|
+ this.type === "user"
|
|
|
+ ) {
|
|
|
+ this.$message.error(
|
|
|
+ "会员收费模式报名缴费项目课程费用不得大于0且不可选"
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.rowDetail?.batchNo) {
|
|
|
+ try {
|
|
|
+ const res = await musicGroupPaymentCalenderAdd(data);
|
|
|
+ if (this.$route.query.team_status == "PRE_BUILD_FEE") {
|
|
|
+ this.$message.success("创建成功");
|
|
|
+ this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
+ this.$router.push({
|
|
|
+ path: "/teamList",
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- this.$listeners.close();
|
|
|
- this.$listeners.submited(res.data);
|
|
|
+ this.$listeners.close();
|
|
|
+ this.$listeners.submited(res.data);
|
|
|
|
|
|
- // 在这里
|
|
|
- } catch (error) {}
|
|
|
- } else {
|
|
|
- try {
|
|
|
- data.batchNo = this.rowDetail.batchNo;
|
|
|
- // 缴费类型无法修改,按照之前覆盖
|
|
|
- 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" }),
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (error) {}
|
|
|
+ // 在这里
|
|
|
+ } catch (error) {}
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ data.batchNo = this.rowDetail.batchNo;
|
|
|
+ // 缴费类型无法修改,按照之前覆盖
|
|
|
+ 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" }),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|