|
@@ -3,7 +3,8 @@
|
|
|
<tips />
|
|
|
|
|
|
<course-model
|
|
|
- v-if="mypreViewData&&mypreViewData.isShowMusicCourseForPay"
|
|
|
+ v-if="mypreViewData && mypreViewData.isShowMusicCourseForPay"
|
|
|
+ :isShowSalePrice="isShowSalePrice"
|
|
|
:courseViewType="courseViewType"
|
|
|
:courseShowInfo="courseShowInfo"
|
|
|
:remissionCourseFeeStatus="remissionCourseFeeStatus"
|
|
@@ -19,7 +20,13 @@
|
|
|
/>
|
|
|
|
|
|
<member
|
|
|
- v-if="toolsPackage && toolsPackage.length > 0&&mypreViewData&&mypreViewData.isShowMemberForPay"
|
|
|
+ v-if="
|
|
|
+ toolsPackage &&
|
|
|
+ toolsPackage.length > 0 &&
|
|
|
+ mypreViewData &&
|
|
|
+ mypreViewData.isShowMemberForPay
|
|
|
+ "
|
|
|
+ :isShowSalePrice="isShowSalePrice"
|
|
|
:toolsPackage="toolsPackage"
|
|
|
:isGiveAccessories="isGiveAccessories"
|
|
|
:accessStatus="accessOries.length > 0"
|
|
@@ -27,6 +34,7 @@
|
|
|
/>
|
|
|
|
|
|
<instrument-model
|
|
|
+ :isShowSalePrice="isShowSalePrice"
|
|
|
:instrumentResultList="instrumentResultList"
|
|
|
:buyMaintenance="buyMaintenance"
|
|
|
:trainSmallBg="trainSmallBg"
|
|
@@ -37,48 +45,87 @@
|
|
|
@onQuestions="onQuestions"
|
|
|
/>
|
|
|
|
|
|
- <div class="courseModel" style="margin-top: 12px;" v-if="instrumentRepair && instrumentRepair.length > 0&& mypreViewData&&mypreViewData.isShowMusicInsuranceForPay">
|
|
|
+ <div
|
|
|
+ class="courseModel"
|
|
|
+ style="margin-top: 12px;"
|
|
|
+ v-if="
|
|
|
+ instrumentRepair &&
|
|
|
+ instrumentRepair.length > 0 &&
|
|
|
+ mypreViewData &&
|
|
|
+ mypreViewData.isShowMusicInsuranceForPay
|
|
|
+ "
|
|
|
+ >
|
|
|
<h2 class="titles">
|
|
|
<img :src="trainSmallBg" />
|
|
|
<span>乐器保养</span>
|
|
|
</h2>
|
|
|
- <!-- 可选课程信息集合 -->
|
|
|
- <div class="section">
|
|
|
- <el-row class="title-row">
|
|
|
- <el-col :span="12">服务项目</el-col>
|
|
|
- <!-- 原价 -->
|
|
|
- <el-col :span="5" :offset="1" style="text-align: right;">时间</el-col>
|
|
|
- <el-col :span="6" style="text-align: right;">价格</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="option-row" v-for="(item, index) in instrumentRepair" :key="index" @click.native="onCheckItem(item)">
|
|
|
- <el-col :span="12">
|
|
|
- <i class="check_default" :class="[item.isStatus ? 'check_active' : '', item.optionalFlag ? 'disabled' : '', item.noSelect ? 'noSelect' : '']"></i>
|
|
|
+ <!-- 可选课程信息集合 -->
|
|
|
+ <div class="section">
|
|
|
+ <el-row class="title-row">
|
|
|
+ <el-col :span="isShowSalePrice ? 9 : 14">服务项目</el-col>
|
|
|
+ <!-- 原价 -->
|
|
|
+ <el-col :span="5" style="text-align: right;">时间</el-col>
|
|
|
+ <el-col :span="5" style="text-align: right;">原价</el-col>
|
|
|
+ <el-col :span="5" style="text-align: right;" v-if="isShowSalePrice"
|
|
|
+ >售价</el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ class="option-row"
|
|
|
+ v-for="(item, index) in instrumentRepair"
|
|
|
+ :key="index"
|
|
|
+ @click.native="onCheckItem(item)"
|
|
|
+ >
|
|
|
+ <el-col :span="isShowSalePrice ? 9 : 14">
|
|
|
+ <i
|
|
|
+ class="check_default"
|
|
|
+ :class="[
|
|
|
+ item.isStatus ? 'check_active' : '',
|
|
|
+ item.optionalFlag ? 'disabled' : '',
|
|
|
+ item.noSelect ? 'noSelect' : ''
|
|
|
+ ]"
|
|
|
+ ></i>
|
|
|
{{ item.name }}
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <span style="color: #AAA; font-size: 12px;">{{ item.num }}(年)</span>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <span style="color: #1A1A1A">¥{{ item.actualAmount | moneyFormat }}</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <span style="color: #AAA; font-size: 12px;"
|
|
|
+ >{{ item.num }}(年)</span
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <del style="color: #AAA; font-size: 12px;"
|
|
|
+ >¥{{ item.originalAmount | moneyFormat }}</del
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" v-if="isShowSalePrice">
|
|
|
+ <span style="color: #1A1A1A"
|
|
|
+ >¥{{ item.actualAmount | moneyFormat }}</span
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <accessories
|
|
|
+ <accessories
|
|
|
+ :isShowSalePrice="isShowSalePrice"
|
|
|
:trainSmallBg="trainSmallBg"
|
|
|
:accessOries="accessOries"
|
|
|
:isGiveAccessories="giveAccessoriesStatus"
|
|
|
@onAuxiliarie="onCheckItem"
|
|
|
/>
|
|
|
<activity
|
|
|
- v-if="activityList && activityList.length > 0&&mypreViewData&&mypreViewData.isShowVipCourseForPay"
|
|
|
+ v-if="
|
|
|
+ activityList &&
|
|
|
+ activityList.length > 0 &&
|
|
|
+ mypreViewData &&
|
|
|
+ mypreViewData.isShowVipCourseForPay
|
|
|
+ "
|
|
|
+ :isShowSalePrice="isShowSalePrice"
|
|
|
:trainSmallBg="trainSmallBg"
|
|
|
:activityList="activityList"
|
|
|
@onCheckItem="onCheckItem"
|
|
|
/>
|
|
|
|
|
|
-
|
|
|
<!-- <div class="buy">
|
|
|
<div class="price">
|
|
|
<p class="oldprice">
|
|
@@ -104,17 +151,24 @@ import dayjs from "dayjs";
|
|
|
const paymentPatternType = {
|
|
|
0: "按月",
|
|
|
1: "按学期",
|
|
|
- 2: "一次性",
|
|
|
+ 2: "一次性"
|
|
|
};
|
|
|
-import Tips from './tips'
|
|
|
-import courseModel from '@/views/resetTeaming/modals/courseModel'
|
|
|
+import Tips from "./tips";
|
|
|
+import courseModel from "@/views/resetTeaming/modals/courseModel";
|
|
|
import InstrumentModel from "./instrumentModel";
|
|
|
-import accessories from './accessories'
|
|
|
-import activity from './activity'
|
|
|
-import member from './member'
|
|
|
+import accessories from "./accessories";
|
|
|
+import activity from "./activity";
|
|
|
+import member from "./member";
|
|
|
export default {
|
|
|
props: ["subjectId", "calenderId", "preViewData"],
|
|
|
- components: { Tips, courseModel, InstrumentModel, accessories, activity, member },
|
|
|
+ components: {
|
|
|
+ Tips,
|
|
|
+ courseModel,
|
|
|
+ InstrumentModel,
|
|
|
+ accessories,
|
|
|
+ activity,
|
|
|
+ member
|
|
|
+ },
|
|
|
data() {
|
|
|
const query = this.$route.query;
|
|
|
return {
|
|
@@ -145,7 +199,7 @@ export default {
|
|
|
accessPrice: 0, // 辅件现价
|
|
|
accessMarketPrice: 0, // 辅件原价
|
|
|
goodsPrice: 0, // 乐器现价
|
|
|
- goodsMarketPrice: 0, // 乐器原价
|
|
|
+ goodsMarketPrice: 0 // 乐器原价
|
|
|
}, // 金额列表,金额计算
|
|
|
toolsPackage: [], // 学习工具包
|
|
|
instrumentRepair: [], // 乐保信息
|
|
@@ -178,13 +232,14 @@ export default {
|
|
|
remissionCourseFeeStatus: false,
|
|
|
isGiveAccessories: false, // 是否赠送辅件
|
|
|
giveAccessoriesStatus: false,
|
|
|
- mypreViewData:{
|
|
|
- isShowMemberForPay:true,
|
|
|
- isShowMusicInsuranceForPay:true,
|
|
|
- isShowVipCourseForPay:true,
|
|
|
- isShowMusicCourseForPay:true,
|
|
|
- }
|
|
|
- }
|
|
|
+ mypreViewData: {
|
|
|
+ isShowMemberForPay: true,
|
|
|
+ isShowMusicInsuranceForPay: true,
|
|
|
+ isShowVipCourseForPay: true,
|
|
|
+ isShowMusicCourseForPay: true
|
|
|
+ },
|
|
|
+ isShowSalePrice: true // 是否显示原价
|
|
|
+ };
|
|
|
},
|
|
|
mounted() {
|
|
|
this.__init();
|
|
@@ -195,30 +250,35 @@ export default {
|
|
|
let params = {
|
|
|
musicGroupId: this.musicGroupId,
|
|
|
subjectId: this.subjectId,
|
|
|
- calenderId: this.calenderId,
|
|
|
+ calenderId: this.calenderId
|
|
|
};
|
|
|
- await getSubjectGoodsAndInfoPreview(params).then((res) => {
|
|
|
+ await getSubjectGoodsAndInfoPreview(params).then(res => {
|
|
|
let result = res;
|
|
|
if (result.code == 200) {
|
|
|
let tempResult = result.data;
|
|
|
- this.__dataFormat(tempResult)
|
|
|
+ this.__dataFormat(tempResult);
|
|
|
}
|
|
|
// 初始化计算金额
|
|
|
this.calcPrice();
|
|
|
});
|
|
|
},
|
|
|
__dataFormat(tempResult) {
|
|
|
- this.mypreViewData = this.preViewData&&this.preViewData.paymentCalender ? JSON.parse(JSON.stringify(this.preViewData)) : {
|
|
|
- isShowMemberForPay:true,
|
|
|
- isShowMusicInsuranceForPay:true,
|
|
|
- isShowVipCourseForPay:true,
|
|
|
- isShowMusicCourseForPay:true,
|
|
|
- }
|
|
|
+ this.mypreViewData =
|
|
|
+ this.preViewData && this.preViewData.paymentCalender
|
|
|
+ ? JSON.parse(JSON.stringify(this.preViewData))
|
|
|
+ : {
|
|
|
+ isShowMemberForPay: true,
|
|
|
+ isShowMusicInsuranceForPay: true,
|
|
|
+ isShowVipCourseForPay: true,
|
|
|
+ isShowMusicCourseForPay: true
|
|
|
+ };
|
|
|
|
|
|
this.courseViewType = tempResult.musicGroup.courseViewType || 0;
|
|
|
- this.isGiveAccessories = tempResult.musicGroup && tempResult.musicGroup.isGiveAccessories || false; // 是否赠送辅件
|
|
|
+ this.isGiveAccessories =
|
|
|
+ (tempResult.musicGroup && tempResult.musicGroup.isGiveAccessories) ||
|
|
|
+ false; // 是否赠送辅件
|
|
|
this.organId = tempResult.musicGroup.organId;
|
|
|
- const musicGroupStatus = tempResult.musicGroup.status
|
|
|
+ const musicGroupStatus = tempResult.musicGroup.status;
|
|
|
this.cloudTeacherFee = tempResult.cloudTeacherFee || 0;
|
|
|
this.cloudTeacherPlusFee = tempResult.cloudTeacherPlusFee || 0;
|
|
|
|
|
@@ -226,7 +286,7 @@ export default {
|
|
|
for (let i in memberCoursePrice) {
|
|
|
this.memberCoursePrice.push({
|
|
|
name: coursesType[i],
|
|
|
- price: memberCoursePrice[i],
|
|
|
+ price: memberCoursePrice[i]
|
|
|
});
|
|
|
}
|
|
|
this.memberCourseShowFlag =
|
|
@@ -245,60 +305,72 @@ export default {
|
|
|
tempResult.musicGroupPaymentCalender.paymentValidEndDate
|
|
|
).format("YYYY/MM/DD");
|
|
|
}
|
|
|
- const paymentCalender = this.mypreViewData&&this.mypreViewData.paymentCalender ? this.mypreViewData.paymentCalender : (tempResult.paymentCalender || null)
|
|
|
- console.log(paymentCalender,'paymentCalender')
|
|
|
- if(paymentCalender&&paymentCalender.calender&&paymentCalender.calender.paymentItemShowState){
|
|
|
-
|
|
|
- let obj = JSON.parse(paymentCalender.calender.paymentItemShowState)
|
|
|
-
|
|
|
- for(let key in obj){
|
|
|
- this.mypreViewData [key] = obj[key]
|
|
|
+ const paymentCalender =
|
|
|
+ this.mypreViewData && this.mypreViewData.paymentCalender
|
|
|
+ ? this.mypreViewData.paymentCalender
|
|
|
+ : tempResult.paymentCalender || null;
|
|
|
+
|
|
|
+ if (paymentCalender && paymentCalender.calender) {
|
|
|
+ this.isShowSalePrice =
|
|
|
+ paymentCalender.calender.isShowSalePrice || false;
|
|
|
+ if (paymentCalender.calender.paymentItemShowState) {
|
|
|
+ let obj = JSON.parse(paymentCalender.calender.paymentItemShowState);
|
|
|
+
|
|
|
+ for (let key in obj) {
|
|
|
+ this.mypreViewData[key] = obj[key];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- let tempInfo = paymentCalender && paymentCalender.course ? paymentCalender.course : [];
|
|
|
+ let tempInfo =
|
|
|
+ paymentCalender && paymentCalender.course ? paymentCalender.course : [];
|
|
|
let memberPrivilegesItemList = tempResult.memberPrivilegesItemList
|
|
|
? tempResult.memberPrivilegesItemList
|
|
|
: [];
|
|
|
let tempMember = [];
|
|
|
- memberPrivilegesItemList.forEach((member) => {
|
|
|
+ memberPrivilegesItemList.forEach(member => {
|
|
|
if (
|
|
|
member.memberPrivilegesItems &&
|
|
|
member.memberPrivilegesItems.length > 0
|
|
|
) {
|
|
|
- member.memberPrivilegesItems.forEach((item) => {
|
|
|
+ member.memberPrivilegesItems.forEach(item => {
|
|
|
tempMember.push(item.name);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
// 云教练
|
|
|
- const member = paymentCalender && paymentCalender.member ? paymentCalender.member : {}
|
|
|
+ const member =
|
|
|
+ paymentCalender && paymentCalender.member ? paymentCalender.member : {};
|
|
|
|
|
|
- member.isStatus = true
|
|
|
+ member.isStatus = true;
|
|
|
|
|
|
- this.toolsPackage = (member&&!member.memberRankSettingId)? [] : [member]
|
|
|
+ this.toolsPackage = member && !member.memberRankSettingId ? [] : [member];
|
|
|
|
|
|
// 乐器保养
|
|
|
- const repair = paymentCalender && paymentCalender.repair ? paymentCalender.repair : {}
|
|
|
- repair.name = '乐器保养'
|
|
|
- repair.isStatus = true // 默认不选择乐器保养
|
|
|
- this.instrumentRepair = repair.actualAmount+'' ? [] : [repair]
|
|
|
+ const repair =
|
|
|
+ paymentCalender && paymentCalender.repair ? paymentCalender.repair : {};
|
|
|
+ repair.name = "乐器保养";
|
|
|
+ repair.isStatus = true; // 默认不选择乐器保养
|
|
|
+
|
|
|
+ this.instrumentRepair = Number(repair.actualAmount) ? [repair] : [];
|
|
|
// 小班课
|
|
|
- const activity = paymentCalender && paymentCalender.activity ? paymentCalender.activity : []
|
|
|
+ const activity =
|
|
|
+ paymentCalender && paymentCalender.activity
|
|
|
+ ? paymentCalender.activity
|
|
|
+ : [];
|
|
|
activity.map(i => {
|
|
|
- i.isStatus = true
|
|
|
- })
|
|
|
- this.activityList = [...activity]
|
|
|
+ i.isStatus = true;
|
|
|
+ });
|
|
|
+ this.activityList = [...activity];
|
|
|
|
|
|
// 判断是否有课程
|
|
|
if (tempInfo && tempInfo.length > 0) {
|
|
|
-
|
|
|
// 默认课程都选中
|
|
|
- tempInfo.forEach((item) => {
|
|
|
+ tempInfo.forEach(item => {
|
|
|
// if (item && item.isStudentOptional) {
|
|
|
- // item.isStatus = false;
|
|
|
+ // item.isStatus = false;
|
|
|
// } else {
|
|
|
- item.isStatus = true;
|
|
|
+ item.isStatus = true;
|
|
|
// }
|
|
|
});
|
|
|
this.courseInfo = tempInfo;
|
|
@@ -307,8 +379,12 @@ export default {
|
|
|
this.musicGroupSubject = tempResult.musicGroupSubjectPlan || [];
|
|
|
let instrumentInfo = {};
|
|
|
let tempInstrument = [];
|
|
|
- let musicGroupSubjectGoodsGroupList = this.preViewData?.payUserType == "SCHOOL" || musicGroupStatus == 'PROGRESS' ? [] : tempResult.musicGroupSubjectGoodsGroupList
|
|
|
- musicGroupSubjectGoodsGroupList?.forEach((item) => {
|
|
|
+ let musicGroupSubjectGoodsGroupList =
|
|
|
+ this.preViewData?.payUserType == "SCHOOL" ||
|
|
|
+ musicGroupStatus == "PROGRESS"
|
|
|
+ ? []
|
|
|
+ : tempResult.musicGroupSubjectGoodsGroupList;
|
|
|
+ musicGroupSubjectGoodsGroupList?.forEach(item => {
|
|
|
if (item.type == "INSTRUMENT") {
|
|
|
// 获取乐器所有提供方式
|
|
|
let KGPTJ = item.kitGroupPurchaseTypeJson
|
|
@@ -319,7 +395,7 @@ export default {
|
|
|
tempItem.marketPrice = tempItem.goodsList[0].marketPrice;
|
|
|
tempItem.kitType = single; // 优惠模式
|
|
|
tempItem.coupon = KGPTJ[single]; // 优惠金额
|
|
|
- tempItem.discountPrice = tempItem.goodsList[0].discountPrice
|
|
|
+ tempItem.discountPrice = tempItem.goodsList[0].discountPrice;
|
|
|
if (instrumentInfo.id) {
|
|
|
tempItem.isStatus = false;
|
|
|
if (single == "GROUP") {
|
|
@@ -330,7 +406,7 @@ export default {
|
|
|
instrumentInfo.kitType == "LEASE" ||
|
|
|
instrumentInfo.kitType == "FREE"
|
|
|
) {
|
|
|
- this.instrumentResult.forEach((instrRes) => {
|
|
|
+ this.instrumentResult.forEach(instrRes => {
|
|
|
instrRes.isStatus = false;
|
|
|
});
|
|
|
tempItem.isStatus = true;
|
|
@@ -347,7 +423,7 @@ export default {
|
|
|
instrumentInfo.kitType == "LEASE" &&
|
|
|
instrumentInfo.price < tempItem.price
|
|
|
) {
|
|
|
- this.instrumentResult.forEach((instrRes) => {
|
|
|
+ this.instrumentResult.forEach(instrRes => {
|
|
|
instrRes.isStatus = false;
|
|
|
});
|
|
|
tempItem.isStatus = true;
|
|
@@ -364,7 +440,7 @@ export default {
|
|
|
instrumentInfo.kitType == "FREE" &&
|
|
|
instrumentInfo.price < tempItem.price
|
|
|
) {
|
|
|
- this.instrumentResult.forEach((instrRes) => {
|
|
|
+ this.instrumentResult.forEach(instrRes => {
|
|
|
instrRes.isStatus = false;
|
|
|
});
|
|
|
tempItem.isStatus = true;
|
|
@@ -386,11 +462,8 @@ export default {
|
|
|
};
|
|
|
}
|
|
|
let childGoodsNameList = [];
|
|
|
- if (
|
|
|
- tempItem.childGoodsList &&
|
|
|
- tempItem.childGoodsList.length > 0
|
|
|
- ) {
|
|
|
- tempItem.childGoodsList.forEach((child) => {
|
|
|
+ if (tempItem.childGoodsList && tempItem.childGoodsList.length > 0) {
|
|
|
+ tempItem.childGoodsList.forEach(child => {
|
|
|
if (child.type != "INSTRUMENT" && child.type != "OTHER") {
|
|
|
childGoodsNameList.push(child.name);
|
|
|
}
|
|
@@ -408,29 +481,29 @@ export default {
|
|
|
});
|
|
|
// 添加自备选项
|
|
|
if (this.instrumentResult.length > 0) {
|
|
|
- let sorted = this.groupBy(tempInstrument, (item) => {
|
|
|
+ let sorted = this.groupBy(tempInstrument, item => {
|
|
|
return [item.kitType];
|
|
|
});
|
|
|
this.instrumentResultList = sorted;
|
|
|
|
|
|
// 设置是否有减免金额
|
|
|
- this.instrumentGetStatus()
|
|
|
- this.setLeBaoStatus()
|
|
|
+ this.instrumentGetStatus();
|
|
|
+ this.setLeBaoStatus();
|
|
|
}
|
|
|
// 如果选择的是乐保,则把所有辅件价格设置为0
|
|
|
- this.giveAccessoriesSetStatus()
|
|
|
+ this.giveAccessoriesSetStatus();
|
|
|
|
|
|
// 初始化计算金额
|
|
|
this.calcPrice();
|
|
|
},
|
|
|
groupBy(array, f) {
|
|
|
var groups = {};
|
|
|
- array.forEach(function (o) {
|
|
|
+ array.forEach(function(o) {
|
|
|
var group = JSON.stringify(f(o));
|
|
|
groups[group] = groups[group] || [];
|
|
|
groups[group].push(o);
|
|
|
});
|
|
|
- return Object.keys(groups).map(function (group) {
|
|
|
+ return Object.keys(groups).map(function(group) {
|
|
|
return groups[group];
|
|
|
});
|
|
|
},
|
|
@@ -442,7 +515,7 @@ export default {
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- callback: (action) => {},
|
|
|
+ callback: action => {}
|
|
|
}
|
|
|
);
|
|
|
} else if (type == "instrument") {
|
|
@@ -452,40 +525,43 @@ export default {
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- callback: (action) => {},
|
|
|
+ callback: action => {}
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
- onCheckItem(item,type) {
|
|
|
+ onCheckItem(item, type) {
|
|
|
// 默认选中不可改
|
|
|
- if(item.optionalFlag) return
|
|
|
+ if (item.optionalFlag) return;
|
|
|
// 判断乐保是否可选
|
|
|
- if(item.noSelect) return
|
|
|
+ if (item.noSelect) return;
|
|
|
// 如果选择的是乐器先把所有选中的取消
|
|
|
- if(type == 'INSTRUMENT') {
|
|
|
+ if (type == "INSTRUMENT") {
|
|
|
this.instrumentResultList.forEach(group => {
|
|
|
group.forEach(child => {
|
|
|
- if(child.id != item.id || (child.id == item.id && child.kitType != item.kitType)) {
|
|
|
- child.isStatus = false
|
|
|
+ if (
|
|
|
+ child.id != item.id ||
|
|
|
+ (child.id == item.id && child.kitType != item.kitType)
|
|
|
+ ) {
|
|
|
+ child.isStatus = false;
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
item.isStatus = !item.isStatus;
|
|
|
- if(type == 'train') {
|
|
|
+ if (type == "train") {
|
|
|
// 如果选择的是乐保,则把所有辅件价格设置为0
|
|
|
- this.giveAccessoriesSetStatus()
|
|
|
+ this.giveAccessoriesSetStatus();
|
|
|
}
|
|
|
// 设置是否有减免金额
|
|
|
- this.instrumentGetStatus()
|
|
|
+ this.instrumentGetStatus();
|
|
|
// 重新设置乐保状态
|
|
|
- this.setLeBaoStatus()
|
|
|
+ this.setLeBaoStatus();
|
|
|
// 重新计算金额
|
|
|
this.calcPrice();
|
|
|
},
|
|
|
giveAccessoriesSetStatus() {
|
|
|
- let status = false // 是否有选中云教练
|
|
|
+ let status = false; // 是否有选中云教练
|
|
|
this.toolsPackage.forEach(item => {
|
|
|
if (item.isStatus) {
|
|
|
status = true;
|
|
@@ -496,36 +572,42 @@ export default {
|
|
|
this.giveAccessoriesStatus = this.isGiveAccessories && status;
|
|
|
},
|
|
|
instrumentGetStatus() {
|
|
|
- let childItem = {}
|
|
|
+ let childItem = {};
|
|
|
this.instrumentResultList.forEach(group => {
|
|
|
group.forEach(child => {
|
|
|
- if(child.isStatus) {
|
|
|
- childItem = child
|
|
|
+ if (child.isStatus) {
|
|
|
+ childItem = child;
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
- this.remissionCourseFeeStatus = childItem.kitType == 'GROUP' && childItem.groupRemissionCourseFee == 1 ? true : false
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.remissionCourseFeeStatus =
|
|
|
+ childItem.kitType == "GROUP" && childItem.groupRemissionCourseFee == 1
|
|
|
+ ? true
|
|
|
+ : false;
|
|
|
},
|
|
|
- setLeBaoStatus() { // 设置乐保状态
|
|
|
- let status = false // 是否有选中乐器
|
|
|
+ setLeBaoStatus() {
|
|
|
+ // 设置乐保状态
|
|
|
+ let status = false; // 是否有选中乐器
|
|
|
this.instrumentResultList.forEach(group => {
|
|
|
group.forEach(item => {
|
|
|
- if(item.isStatus) {
|
|
|
- status = true
|
|
|
+ if (item.isStatus) {
|
|
|
+ status = true;
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
this.instrumentRepair.forEach(repair => {
|
|
|
- if(status) {
|
|
|
- repair.noSelect = false
|
|
|
+ if (status) {
|
|
|
+ repair.noSelect = false;
|
|
|
} else {
|
|
|
- repair.noSelect = true
|
|
|
- repair.isStatus = false
|
|
|
+ repair.noSelect = true;
|
|
|
+ repair.isStatus = false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
calcPrice() {
|
|
|
- let ids = []
|
|
|
+ let ids = [];
|
|
|
let amount = 0,
|
|
|
marketPrice = 0,
|
|
|
goodsPrice = 0, // 乐器两现价
|
|
@@ -546,7 +628,7 @@ export default {
|
|
|
let csi = this.courseInfo;
|
|
|
// 加上判断是否有课程信息
|
|
|
if (mgs) {
|
|
|
- csi.forEach((item) => {
|
|
|
+ csi.forEach(item => {
|
|
|
if (item.isStatus) {
|
|
|
musicClassFee += parseFloat(item.courseCurrentPrice);
|
|
|
// if (this.courseViewType != 2) {
|
|
@@ -560,7 +642,7 @@ export default {
|
|
|
item.courseCurrentPrice
|
|
|
);
|
|
|
}
|
|
|
- marketPrice += parseFloat(item.courseOriginalPrice)
|
|
|
+ marketPrice += parseFloat(item.courseOriginalPrice);
|
|
|
// else {
|
|
|
// marketPrice += parseFloat(item.courseCurrentPrice);
|
|
|
// }
|
|
@@ -572,23 +654,23 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 云教练
|
|
|
- const toolsPackage = this.toolsPackage
|
|
|
- if(toolsPackage.length > 0) {
|
|
|
+ const toolsPackage = this.toolsPackage;
|
|
|
+ if (toolsPackage.length > 0) {
|
|
|
toolsPackage.forEach(item => {
|
|
|
- if(item.isStatus) {
|
|
|
- this.buyCloudTeacher = true // 临时处理,原因一条数据事要使用,如果多条数据会有问题
|
|
|
- marketPrice += parseFloat(item.originalAmount)
|
|
|
- amount += parseFloat(item.actualAmount)
|
|
|
+ if (item.isStatus) {
|
|
|
+ this.buyCloudTeacher = true; // 临时处理,原因一条数据事要使用,如果多条数据会有问题
|
|
|
+ marketPrice += parseFloat(item.originalAmount);
|
|
|
+ amount += parseFloat(item.actualAmount);
|
|
|
} else {
|
|
|
- this.buyCloudTeacher = false
|
|
|
+ this.buyCloudTeacher = false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 乐器
|
|
|
let ir = this.instrumentResult;
|
|
|
if (ir.length > 0) {
|
|
|
- ir.forEach((item) => {
|
|
|
+ ir.forEach(item => {
|
|
|
if (item.isStatus) {
|
|
|
if (item.name != "自备乐器") {
|
|
|
contractGoodsIds += item.goodsIdList;
|
|
@@ -596,7 +678,6 @@ export default {
|
|
|
if (item.kitType == "FREE") {
|
|
|
amount += 0;
|
|
|
couponPrice = 0; // 优惠金额
|
|
|
-
|
|
|
} else if (item.kitType == "LEASE") {
|
|
|
couponPrice = item.coupon; // 优惠金额
|
|
|
if (item.name != "自备乐器") {
|
|
@@ -605,7 +686,6 @@ export default {
|
|
|
} else {
|
|
|
amount += 0;
|
|
|
}
|
|
|
-
|
|
|
} else if (item.kitType == "GROUP") {
|
|
|
// 团购
|
|
|
if (
|
|
@@ -647,51 +727,51 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 乐器保养
|
|
|
- const instrumentRepair = this.instrumentRepair
|
|
|
- if(instrumentRepair.length > 0) {
|
|
|
+ const instrumentRepair = this.instrumentRepair;
|
|
|
+ if (instrumentRepair.length > 0) {
|
|
|
instrumentRepair.forEach(item => {
|
|
|
- if(item.isStatus) {
|
|
|
- this.buyMaintenance = true
|
|
|
- marketPrice += item.originalAmount
|
|
|
- amount += parseFloat(item.actualAmount)
|
|
|
+ if (item.isStatus) {
|
|
|
+ this.buyMaintenance = true;
|
|
|
+ marketPrice += item.originalAmount;
|
|
|
+ amount += parseFloat(item.actualAmount);
|
|
|
} else {
|
|
|
- this.buyMaintenance = false
|
|
|
+ this.buyMaintenance = false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
amount += parseFloat(tempCourseFee + musicClassFee);
|
|
|
|
|
|
// 辅件
|
|
|
- if (
|
|
|
- this.accessOries.length > 0) {
|
|
|
- this.accessOries.forEach((item) => {
|
|
|
+ if (this.accessOries.length > 0) {
|
|
|
+ this.accessOries.forEach(item => {
|
|
|
// && this.accessIsShowStatus
|
|
|
if (item.isStatus) {
|
|
|
- tempAccessPrice += this.giveAccessoriesStatus ? 0 : parseFloat(item.price);
|
|
|
+ tempAccessPrice += this.giveAccessoriesStatus
|
|
|
+ ? 0
|
|
|
+ : parseFloat(item.price);
|
|
|
amount += this.giveAccessoriesStatus ? 0 : parseFloat(item.price);
|
|
|
if (item.goodsList && item.goodsList.length > 0) {
|
|
|
- item.goodsList.forEach((childGoods) => {
|
|
|
+ item.goodsList.forEach(childGoods => {
|
|
|
tempAccessMarketPrice += parseFloat(childGoods.marketPrice);
|
|
|
marketPrice += parseFloat(childGoods.marketPrice);
|
|
|
});
|
|
|
}
|
|
|
goodsGroupIds[item.id] = "ACCESSORIES";
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 小班课
|
|
|
- const activityList = this.activityList
|
|
|
- if(activityList.length > 0) {
|
|
|
+ const activityList = this.activityList;
|
|
|
+ if (activityList.length > 0) {
|
|
|
activityList.forEach(item => {
|
|
|
- if(item.isStatus) {
|
|
|
- buyCalenderActivityId.push(item.id)
|
|
|
- marketPrice += item.originalAmount
|
|
|
- amount += parseFloat(item.actualAmount)
|
|
|
+ if (item.isStatus) {
|
|
|
+ buyCalenderActivityId.push(item.id);
|
|
|
+ marketPrice += item.originalAmount;
|
|
|
+ amount += parseFloat(item.actualAmount);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
let tempGroupPurchasePrice = amount;
|
|
@@ -714,13 +794,13 @@ export default {
|
|
|
accessMarketPrice: tempAccessMarketPrice,
|
|
|
accessPrice: tempAccessPrice,
|
|
|
goodsPrice: goodsPrice,
|
|
|
- goodsMarketPrice: goodsMarketPrice,
|
|
|
+ goodsMarketPrice: goodsMarketPrice
|
|
|
};
|
|
|
},
|
|
|
permission(str) {
|
|
|
return permission(str);
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|