Browse Source

修改预览显示

lex-xin 4 years ago
parent
commit
79248088ff
1 changed files with 69 additions and 43 deletions
  1. 69 43
      src/views/resetTeaming/modals/subject-preview.vue

+ 69 - 43
src/views/resetTeaming/modals/subject-preview.vue

@@ -3,18 +3,14 @@
         <div class="noticeInfo">
 			<h2>缴费说明</h2>
             1、您注册时所选择的乐团声部,即为乐团录取最终确认的声部,请您务必仔细填写;<br />
-            2、为避免因部分已注册家长放弃名额导致乐团声部失衡,系统设定各声部限额放大20%比例开放注册,系统自动按照完全完成注册的先后顺序确认录取名单,因此,超员后有可能出现无法注册的情况,请您理解。如果其他声部仍有名额,在您孩子的身体条件适合该乐器的前提下,我们将优先予以调配。
+			2、为避免因部分已注册家长放弃名额导致乐团声部失衡,系统设定各声部限额放大20%比例开放注册,系统自动按照完全完成注册的先后顺序确认录取名单,因此,超员后有可能出现无法注册的情况,请您理解。如果其他声部仍有名额,在您孩子的身体条件适合该乐器的前提下,我们将优先予以调配。
 		</div>
 
 		<div class="section">
-			<h2 class="title">服务</h2>
-            <p style="font-size: 14px; padding: 2px 0; color: #f85043" v-if="serviceValidDate">服务有效期:{{ serviceValidDate }}</p>
-			<!-- <el-row class="title-row">
-				<el-col :span="16">服务项目</el-col>
-				<el-col :span="7" :offset="1" style="text-align: right;">现价</el-col>
-			</el-row> -->
+			<h2 class="title">{{ courseViewType == 1 ? '服务' : '乐团课程' }}</h2>
+            <p style="font-size: 14px; padding: 2px 0; color: #f85043" v-if="serviceValidDate && courseViewType == 1">服务有效期:{{ serviceValidDate }}</p>
 			<!-- 所有不可选的课程合集 -->
-			<template v-if="courseShowStatus">
+			<template v-if="courseShowStatus && courseViewType == 1">
 				<el-row class="option-row"  v-for="(item, index) in courseShowInfo" :class="[!item.isStudentOptional ? 'disabled' : '']" :key="index" @click.native="onCourseChange(item)">
 					<el-col :span="16">
 						<i class="check_default" :class="[item.isStatus ? 'check_active' : '']"></i>
@@ -31,11 +27,17 @@
 					</el-col>
 				</el-row>
 			</template>
+
+            <el-row class="title-row" v-if="courseViewType == 0">
+				<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>
 			<!-- 可选课程信息集合 -->
-			<!-- <template v-for="(item, index) in courseInfo">
-				<el-row class="option-row" :class="[!item.isStudentOptional ? 'disabled' : '']" :key="index" @click.native="onCourseChange(item)" v-if="item.isStudentOptional">
+			<template v-for="(item, index) in courseInfo">
+				<el-row class="option-row" :key="index" @click.native="onCourseChange(item)" v-if="courseViewType == 0">
 					<el-col :span="12">
-						<i class="check_default" :class="[item.isStatus ? 'check_active' : '']"></i><template v-if="item.courseType == 'PROJECT'">{{ item.name }}</template><template v-else>{{ item.courseType | coursesType }}</template>
+						<i class="check_default" :class="[item.isStatus ? 'check_active' : '', !item.isStudentOptional ? 'disabled' : '']"></i><template v-if="item.courseType == 'PROJECT'">{{ item.name }}</template><template v-else>{{ item.courseType | coursesType }}</template>
 					</el-col>
 					<el-col :span="6">
 						<del style="color: #AAA; font-size: 12px;">¥{{ item.courseOriginalPrice | moneyFormat }}</del>
@@ -44,19 +46,8 @@
 						<span style="color: #1A1A1A">¥{{ item.courseCurrentPrice | moneyFormat }}</span>
 					</el-col>
 				</el-row>
-			</template> -->
+			</template>
 
-			<!-- <el-row class="option-row lines">
-				<el-col :span="12" class="fontBold">
-					仅需支付
-				</el-col>
-				<el-col :span="6">
-					<del style="color: #f85043; font-size: 12px;">¥{{ orderInfo.musicMarketClassFee | moneyFormat }}</del>
-				</el-col>
-				<el-col :span="6">
-					<span class="fontBold" style="color: #f85043;">¥{{ orderInfo.musicClassFee | moneyFormat }}</span>
-				</el-col>
-			</el-row> -->
 		</div>
 
 		<div class="section" v-if="instrumentResult.length > 0">
@@ -230,6 +221,7 @@ export default {
             courseShowStatus: false,
             chargeTypeList: [],
             chargeTypeName: null,
+            courseViewType: 0, // 收费模式,0 课程显示,1 AMR系统
         };
     },
     mounted() {
@@ -254,6 +246,7 @@ export default {
                 let result = res
                 if (result.code == 200) {
                     let tempResult = result.data
+                    this.courseViewType = tempResult.musicGroup.courseViewType || 0
                     this.paymentPattern = 2
                     if(tempResult.musicGroupPaymentCalender) {
                         this.paymentPattern = tempResult.musicGroupPaymentCalender.paymentPattern
@@ -481,32 +474,65 @@ export default {
             let csi = this.courseInfo
             // 加上判断是否有课程信息
             if (mgs) {
+                // let tempCourse = this.courseShowInfo
+                // if(tempCourse.length > 0) {
+                //     let tempPrice = 0
+                //     tempCourse.forEach(item => {
+                //         // tempPrice += parseFloat(item.courseCurrentPrice)
+                //         marketPrice += parseFloat(item.courseOriginalPrice)
+                //         musicMarketClassFee += parseFloat(item.courseOriginalPrice)
+                //     });
+                // }
+                // csi.forEach(item => {
+                //     if (item.isStatus) {
+                //         musicClassFee += parseFloat(item.courseCurrentPrice)
+                //         // musicMarketClassFee += parseFloat(item.courseOriginalPrice)
+                //         // marketPrice += parseFloat(item.courseOriginalPrice)
+                //         if (item.id > 0) {
+                //             courseKeys.push(item.id)
+                //         }
+                //         // 不可选的课程才会减免课程费用
+                //         if(!item.isStudentOptional) {
+                //             tempGroupRemissionCourseFee += parseFloat(item.courseCurrentPrice)
+                //         } else {
+                //             marketPrice += parseFloat(item.courseOriginalPrice)
+                //             musicMarketClassFee += parseFloat(item.courseOriginalPrice)
+                //         }
+                //     }
+                // })
                 let tempCourse = this.courseShowInfo
-                if(tempCourse.length > 0) {
-                    let tempPrice = 0
+                if (tempCourse.length > 0 && this.courseViewType == 1) {
                     tempCourse.forEach(item => {
-                        // tempPrice += parseFloat(item.courseCurrentPrice)
-                        marketPrice += parseFloat(item.courseOriginalPrice)
-                        musicMarketClassFee += parseFloat(item.courseOriginalPrice)
-                    });
-                }
-                csi.forEach(item => {
-                    if (item.isStatus) {
-                        musicClassFee += parseFloat(item.courseCurrentPrice)
-                        // musicMarketClassFee += parseFloat(item.courseOriginalPrice)
-                        // marketPrice += parseFloat(item.courseOriginalPrice)
                         if (item.id > 0) {
                             courseKeys.push(item.id)
                         }
+                        musicClassFee += parseFloat(item.courseCurrentPrice)
+                        marketPrice += parseFloat(item.courseOriginalPrice)
                         // 不可选的课程才会减免课程费用
-                        if(!item.isStudentOptional) {
+                        if (!item.isStudentOptional) {
                             tempGroupRemissionCourseFee += parseFloat(item.courseCurrentPrice)
-                        } else {
+                        }
+                    });
+                    buyList.unshift({
+                        name: this.chargeTypeName,
+                        type: paymentPatternType[this.paymentPattern],
+                        price: Number((musicClassFee).toFixed(2))
+                    })
+                } else {
+                    csi.forEach(item => {
+                        if (item.isStatus) {
+                            musicClassFee += parseFloat(item.courseCurrentPrice)
                             marketPrice += parseFloat(item.courseOriginalPrice)
-                            musicMarketClassFee += parseFloat(item.courseOriginalPrice)
+                            if (item.id > 0) {
+                                courseKeys.push(item.id)
+                            }
+                            // 不可选的课程才会减免课程费用
+                            if (!item.isStudentOptional) {
+                                tempGroupRemissionCourseFee += parseFloat(item.courseCurrentPrice)
+                            }
                         }
-                    }
-                })
+                    })
+                }
             }
 
             // 乐器
@@ -575,13 +601,13 @@ export default {
                 })
             }
             amount += parseFloat(tempCourseFee + musicClassFee)
-            // if (parseFloat(tempCourseFee + musicClassFee) > 0) {
+            if (parseFloat(tempCourseFee + musicClassFee) > 0 && this.courseViewType == 0) {
                 buyList.unshift({
                     name: '乐团课',
                     type: paymentPatternType[this.paymentPattern],
                     price: Number((tempCourseFee + musicClassFee).toFixed(2))
                 })
-            // }
+            }
             // 辅件
             if (this.accessOries.length > 0) {
                 this.accessOries.forEach(item => {
@@ -719,7 +745,7 @@ export default {
 }
 
 .disabled {
-    opacity: 0.7;
+    opacity: 0.5;
     .check_active {
         opacity: .5;
     }