Browse Source

Merge branch 'tmp_meeting_needs' into test

lex-xin 3 năm trước cách đây
mục cha
commit
406fc9b715

+ 29 - 1
src/api/teacher.js

@@ -471,6 +471,31 @@ const queryUserById = (params) => {
   })
 }
 
+const queryPracticeGroupSellPrice = (params) => {
+  return axios({
+    url: '/api-teacher/teacherPracticeGroup/queryPracticeGroupSellPrice',
+    method: 'get',
+    params
+  })
+}
+
+const getPracticeGroupCostCount = (params) => {
+  return axios({
+    url: '/api-teacher/teacherPracticeGroup/getPracticeGroupCostCount',
+    method: 'get',
+    params
+  })
+}
+
+// vip课申请
+const practiceGroupApply = (data) => {
+  return axios({
+    url: api + '/teacherPracticeGroup/practiceGroupApply',
+    method: 'post',
+    data: data
+  })
+}
+
 export {
   queryMyCreatedList,
   queryWaitList,
@@ -523,5 +548,8 @@ export {
   newsQuery,
   newsList,
   getCourseStudents,
-  queryUserById
+  queryUserById,
+  queryPracticeGroupSellPrice,
+  practiceGroupApply,
+  getPracticeGroupCostCount
 }

+ 49 - 36
src/views/activeProgram/activeDetail.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="activeDetail">
-        <van-cell-group class="van-cell-group--inset">
+        <van-cell-group class="van-cell-group--inset" v-if="vipGroup.name">
             <van-cell :title="vipGroup.name" class="titleContent" title-class="titleStyle" label-class="labelStyle">
                 <template #label>
                     <p>{{ vipGroup.description }}</p>
@@ -11,47 +11,50 @@
         <h2 class="van-block__title">详细规则</h2>
         <van-row class="active-row">
             <van-col span="10">排课时间范围</van-col>
-            <van-col span="14">{{ vipGroup.coursesStartTime }} 至 {{ vipGroup.coursesEndTime }}</van-col>
+            <van-col span="14" v-if="vipGroup.coursesStartTime && vipGroup.coursesEndTime">{{ vipGroup.coursesStartTime }} 至 {{ vipGroup.coursesEndTime }}</van-col>
+            <van-col span="14" v-else>--</van-col>
             <van-col span="10">是否扣减课程余额</van-col>
             <van-col span="14">{{ vipGroup.payToBalance ? '是' : '否' }}</van-col>
         </van-row>
 
-        <h2 class="van-block__title">付费课程</h2>
-        <div class="active-row">
-            <van-row>
-                <van-col span="8">课程类型</van-col>
-                <van-col span="16">{{ vipGroup.courseType | coursesType }}&nbsp;</van-col>
-                <van-col span="8">课程形式</van-col>
-                <van-col span="16">{{ vipGroup.vipGroupCategoryNames }}&nbsp;</van-col>
-                <van-col span="8">上课模式</van-col>
-                <van-col span="16">{{ vipGroup.teachMode | formatTeachModel }}&nbsp;</van-col>
-                <van-col span="8">单课时时长</van-col>
-                <van-col span="16">{{ vipGroup.singleCourseTime }}分钟</van-col>
-                <van-col span="8">课时数</van-col>
-                <van-col span="16">{{ vipGroup.avgCourseNum }}&nbsp;</van-col>
-            </van-row>
-            <van-cell is-link class="teaching">
-                <template #title>
-                    剩余 <span style="color: #01C1B5">
-                        {{vipGroup.courseType == 'VIP' ? vipDetail.vipNum : null}}
-                        {{vipGroup.courseType == 'PRACTICE' ? vipDetail.practiceNum : null}}
-                    </span> 名学员未排课
-                </template>
-                <template #default>
-                    <span style="color: #01C1B5" @click="onProgram('pay')">立即排课</span>
-                </template>
-            </van-cell>
-        </div>
+        <template v-if="vipGroup.courseType == 'VIP' && vipDetail.vipNum || vipGroup.courseType == 'PRACTICE' && vipDetail.practiceNum">
+            <h2 class="van-block__title">付费课程</h2>
+            <div class="active-row">
+                <van-row>
+                    <van-col span="8">课程类型</van-col>
+                    <van-col span="16">{{ vipGroup.courseType | coursesType }}&nbsp;</van-col>
+                    <van-col span="8" v-if="vipGroup.courseType == 'VIP'">课程形式</van-col>
+                    <van-col span="16" v-if="vipGroup.courseType == 'VIP'">{{ vipGroup.vipGroupCategoryNames }}&nbsp;</van-col>
+                    <van-col span="8">上课模式</van-col>
+                    <van-col span="16">{{ vipGroup.teachMode | formatTeachModel }}&nbsp;</van-col>
+                    <van-col span="8">单课时时长</van-col>
+                    <van-col span="16">{{ vipGroup.singleCourseTime }}分钟</van-col>
+                    <van-col span="8">课时数</van-col>
+                    <van-col span="16">{{ vipGroup.avgCourseNum }}&nbsp;</van-col>
+                </van-row>
+                <van-cell is-link class="teaching">
+                    <template #title>
+                        剩余 <span style="color: #01C1B5">
+                            {{vipGroup.courseType == 'VIP' ? vipDetail.vipNum : null}}
+                            {{vipGroup.courseType == 'PRACTICE' ? vipDetail.practiceNum : null}}
+                        </span> 名学员未排课
+                    </template>
+                    <template #default>
+                        <span style="color: #01C1B5" @click="onProgram('pay')">立即排课</span>
+                    </template>
+                </van-cell>
+            </div>
+        </template>
 
         <!-- 赠送课程类型,只有VIP和网管课的时候才有赠送课程 -->
-        <template v-if="vipGroup.giveCourseType == 'VIP' || vipGroup.giveCourseType == 'PRACTICE'">
+        <template v-if="vipGroup.giveCourseType == 'VIP' && vipDetail.giveVipNum || vipGroup.giveCourseType == 'PRACTICE' && vipDetail.givePracticeNum">
             <h2 class="van-block__title">赠送课程</h2>
             <div class="active-row">
                 <van-row>
                     <van-col span="8">课程类型</van-col>
                     <van-col span="16">{{ vipGroup.giveCourseType | coursesType }}&nbsp;</van-col>
-                    <van-col span="8">课程形式</van-col>
-                    <van-col span="16">{{ vipGroup.giveCategoryName }}&nbsp;</van-col>
+                    <van-col span="8" v-if="vipGroup.giveCourseType == 'VIP'">课程形式</van-col>
+                    <van-col span="16" v-if="vipGroup.giveCourseType == 'VIP'">{{ vipGroup.giveCategoryName }}&nbsp;</van-col>
                     <van-col span="8">上课模式</van-col>
                     <van-col span="16">{{ vipGroup.giveTeachMode | formatTeachModel }}&nbsp;</van-col>
                     <van-col span="8">单课时时长</van-col>
@@ -72,13 +75,19 @@
                 </van-cell>
             </div>
         </template>
+
+        <m-empty v-if="!vipDetail.giveVipNum && !vipDetail.givePracticeNum && !vipDetail.vipNum && !vipDetail.practiceNum" msg="暂无排课内容" />
     </div>
 </template>
 
 <script>
 import { getActivityWaitCourseStudentNum } from './api'
+import MEmpty from '@/components/MEmpty'
 import dayjs from 'dayjs'
 export default {
+    components: {
+        MEmpty
+    },
     data() {
         const query = this.$route.query
         return {
@@ -97,12 +106,16 @@ export default {
                 let res = await getActivityWaitCourseStudentNum({ activityId: this.activityId })
                 this.vipDetail = res.data
                 let vipGroup = res.data.vipGroupActivity
-                vipGroup.coursesStartTime = dayjs(vipGroup.coursesStartTime).format('YYYY-MM-DD')
-                vipGroup.coursesEndTime = dayjs(vipGroup.coursesEndTime).format('YYYY-MM-DD')
-                if(vipGroup.minCourseNum != vipGroup.maxCourseNum) {
-                    vipGroup.avgCourseNum = vipGroup.minCourseNum + '课时 ~ ' + vipGroup.maxCourseNum + '课时'
+                vipGroup.coursesStartTime = vipGroup.coursesStartTime ? dayjs(vipGroup.coursesStartTime).format('YYYY-MM-DD') : null
+                vipGroup.coursesEndTime = vipGroup.coursesEndTime ? dayjs(vipGroup.coursesEndTime).format('YYYY-MM-DD') : null
+                if(vipGroup.minCourseNum > 0) {
+                    if(vipGroup.minCourseNum != vipGroup.maxCourseNum) {
+                        vipGroup.avgCourseNum = vipGroup.minCourseNum + '课时 ~ ' + vipGroup.maxCourseNum + '课时'
+                    } else {
+                        vipGroup.avgCourseNum = vipGroup.maxCourseNum + '课时'
+                    }
                 } else {
-                    vipGroup.avgCourseNum = vipGroup.maxCourseNum + '课时'
+                    vipGroup.avgCourseNum = '自定义'
                 }
                 this.vipGroup = vipGroup
             } catch {

+ 3 - 1
src/views/activeProgram/modal/studentList.vue

@@ -25,7 +25,7 @@
             > -->
             <div class="studentContainer" v-if="dataShow" key="data">
                 <van-checkbox-group v-model="checkboxSelect">
-                    <van-cell-group>
+                    <van-cell-group :border="false">
                         <van-cell
                             v-for="(item, index) in dataList"
                             :key="index"
@@ -169,6 +169,8 @@ export default {
 <style lang="less" scoped>
 @import url("../../../assets/commonLess/variable.less");
 .studentContainer {
+    padding-top: .1rem;
+    background-color: #fff;
     /deep/.van-cell__title {
         font-size: 0.16rem;
         color: @mFontColor;

+ 81 - 19
src/views/activeProgram/program.vue

@@ -4,7 +4,7 @@
             <van-cell :title="vipGroup.name" class="titleContent" title-class="titleStyle" label-class="labelStyle">
                 <template #label>
                     <p>{{ vipGroup.description }}</p>
-                    <p>排课时间范围:{{ vipGroup.coursesStartTime }} 至 {{ vipGroup.coursesEndTime }}</p>
+                    <!-- <p>排课时间范围:{{ vipGroup.coursesStartTime }} 至 {{ vipGroup.coursesEndTime }}</p> -->
                 </template>
             </van-cell>
         </van-cell-group>
@@ -22,6 +22,7 @@
             <van-field
                 :value="typeStatus ? vipGroup.vipGroupCategoryNames : vipGroup.giveCategoryName"
                 label="课程形式"
+                v-if="courseTypeIsVip"
                 :readonly="true"
                 input-align="right"
                 size="large"
@@ -100,7 +101,7 @@
                 placeholder="请选择"
             />
             <van-field
-                :value="form.studentNum + '人'"
+                :value="(form.studentNum || 0) + '人'"
                 label="班级人数"
                 :readonly="true"
                 input-align="right"
@@ -117,14 +118,40 @@
 
         <h2 class="van-block__title">课时安排</h2>
         <van-cell-group>
+            <van-cell
+                title="最早排课时间"
+                :readonly="true"
+                v-if="vipGroup.coursesStartTime"
+                input-align="right"
+                size="large"
+                value-class="showText"
+                :value="vipGroup.coursesStartTime"
+            >
+            </van-cell>
+            <van-cell
+                title="最晚排课时间"
+                :readonly="true"
+                v-if="vipGroup.coursesEndTime"
+                input-align="right"
+                size="large"
+                value-class="showText"
+                :value="vipGroup.coursesEndTime"
+            >
+            </van-cell>
+            <!-- 为了处理,付费网管课程 -->
+            <!-- {{ !courseTypeIsVip && isLimitNum && typeStatus ? false : true }} -->
             <van-field
-                :value="((typeStatus ? vipGroup.minCourseNum : vipGroup.giveCourseNum) || 0) + '课时'"
+                v-model="form.totalClassTime"
                 label="课时总数"
-                :readonly="true"
+                :readonly="!courseTypeIsVip && !isLimitNum && typeStatus ? false : true"
                 input-align="right"
                 size="large"
                 placeholder="请输入排课课时数"
-            />
+            >
+                <template #extra v-if="form.totalClassTime">
+                    <span style="color: #808080; font-size: 16px;">课时</span>
+                </template>
+            </van-field>
             <van-field
                 v-model="form.courseStart"
                 label="排课开始时间"
@@ -322,6 +349,9 @@ export default {
         courseTypeIsVip() { // 目前只有两种课程,VIP 网管课,则可以这样判断
             const type = this.typeStatus ? this.vipGroup.courseType : this.vipGroup.giveCourseType
             return type == 'VIP' ? true : false
+        },
+        isLimitNum() { // 是否限制排课
+            return this.vipGroup.minCourseNum > 0 ? true : false
         }
     },
     mounted() {
@@ -333,20 +363,31 @@ export default {
                 let res = await getActivityWaitCourseStudentNum({ activityId: this.activityId })
                 this.vipDetail = res.data
                 let vipGroup = res.data.vipGroupActivity
-                vipGroup.coursesStartTime = dayjs(vipGroup.coursesStartTime).format('YYYY-MM-DD')
-                vipGroup.coursesEndTime = dayjs(vipGroup.coursesEndTime).format('YYYY-MM-DD')
+                vipGroup.coursesStartTime = vipGroup.coursesStartTime ? dayjs(vipGroup.coursesStartTime).format('YYYY-MM-DD') : null
+                vipGroup.coursesEndTime = vipGroup.coursesEndTime ? dayjs(vipGroup.coursesEndTime).format('YYYY-MM-DD') : null
                 this.vipGroup = vipGroup
                 let form = this.form
                 // 课程形式
                 form.vipGroupCategoryId = this.typeStatus ? vipGroup.vipGroupCategoryIdList : vipGroup.giveCategoryId
                 // 单课时长
                 form.singleClassMinutes = this.typeStatus ? vipGroup.singleCourseTime : vipGroup.giveSingleCourseTime
-                // 排课次数,活动排课没有范围一说,最大次数和最小次数必须一致
-                form.totalClassTime = this.typeStatus ? vipGroup.minCourseNum : vipGroup.giveCourseNum
-                // 每班人数
-                form.studentNum = this.typeStatus ? vipGroup.vipGroupCategoryNum : vipGroup.giveCategoryNum
-                this.statusList.hasOnline = this.typeStatus ? this.formatStatus('online', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
-                this.statusList.hasOffline = this.typeStatus ? this.formatStatus('offline', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
+
+                if(this.courseTypeIsVip) {
+                    // 每班人数
+                    form.studentNum = this.typeStatus ? vipGroup.vipGroupCategoryNum : vipGroup.giveCategoryNum
+                    this.statusList.hasOnline = this.typeStatus ? this.formatStatus('online', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
+                    this.statusList.hasOffline = this.typeStatus ? this.formatStatus('offline', vipGroup.teachMode) : this.formatStatus('online', vipGroup.giveTeachMode)
+                } else {
+                    form.totalClassTime = null
+                    form.studentNum = 1
+                    this.statusList.hasOnLine = false
+                    this.statusList.hasOffLine = false
+                }
+
+                if(this.isLimitNum) { // 是否限制了排课
+                    // 排课次数,活动排课没有范围一说,最大次数和最小次数必须一致
+                    form.totalClassTime = this.typeStatus ? vipGroup.minCourseNum : vipGroup.giveCourseNum
+                }
 
                 // 如果
                 if(this.teachMode == 0) {
@@ -516,22 +557,31 @@ export default {
             form.studentIdList = this.checkboxSelectIds.join(",");
 
             form.firstStudentId = this.studentList.length > 0 ? this.studentList[0].userId : null;
+            form.onlineClassesNum = Number(form.onlineClassesNums);
+            form.offlineClassesNum = Number(form.offlineClassesNums);
             let params = {
-                courseSchedules: this.timeTable,
-                vipGroupApplyBaseInfo: form,
+                courseSchedules: this.timeTable
             }
-            console.log(params)
             if(this.courseTypeIsVip) {
-                params.giveFlag = false
+                params.vipGroupApplyBaseInfo = form
+                params.giveFlag = !this.typeStatus
                 await this.onPayVip(params)
             } else {
-                params.giveFlag = true
+                params.practiceGroupApplyBaseInfoDto = form
+                params.practiceGroupApplyBaseInfoDto.studentId = form.studentIdList
+                params.practiceGroupApplyBaseInfoDto.allCourseNum = form.totalClassTime
+                params.practiceGroupApplyBaseInfoDto.subjectId = form.subjectIdList
+                params.giveFlag = !this.typeStatus
                 await this.onPayPractice(params)
             }
         },
         async onPayVip(params) {
             try {
                 await createVipGroup(params)
+                this.$toast("排课成功");
+                setTimeout(() => {
+                    this.$router.back()
+                }, 1000);
             } catch {
                 //
             }
@@ -539,6 +589,10 @@ export default {
         async onPayPractice(params) {
             try {
                 await createPracticeGroup(params)
+                this.$toast("排课成功");
+                setTimeout(() => {
+                    this.$router.back()
+                }, 1000);
             } catch {
                 //
             }
@@ -547,6 +601,9 @@ export default {
             // 选中的数据
             const tempItems = items || []
             this.studentList = tempItems
+            if(tempItems.length <= 0) { // 判断是否有选择学员
+                this.checkboxSelectIds = []
+            }
             tempItems.forEach(item => {
                 this.checkboxSelectIds.push(item.userId)
             })
@@ -633,6 +690,10 @@ export default {
             let offline = parseInt(
                 form.offlineClassesNums ? form.offlineClassesNums : 0
             );
+            // 网管课默认只有线上课次
+            if(!this.courseTypeIsVip) {
+                online = parseInt(form.totalClassTime || 0)
+            }
             // 判断是否有课程安排
             if (scheduleList.length <= 0) {
                 return;
@@ -865,8 +926,9 @@ export default {
 /deep/.van-field__label {
     color: #1A1A1A;
 }
-/deep/.van-field__control {
+/deep/.van-field__control, .showText {
     font-size: 16px;
+    color: #808080;
 }
 .addButton {
     margin: .1rem .28rem;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 323 - 295
src/views/teacher/VIP00Apply.vue


+ 23 - 19
src/views/teacher/VIPApply.vue

@@ -1,5 +1,5 @@
 <template>
-	<van-tabs v-model="active" swipe-threshold="3" sticky class="vanTabs" @change="onChange" color="#01C1B5"> 
+	<!-- <van-tabs v-model="active" swipe-threshold="3" sticky class="vanTabs" @change="onChange" color="#01C1B5"> 
 		<van-tab title="VIP申请" :name="1">
 			<vip-00-apply v-if="active === 1" />
 		</van-tab>
@@ -12,38 +12,42 @@
 		<van-tab title="考级乐理排课" :name="4">
 			<theory-course v-if="active === 4" />
 		</van-tab>
-	</van-tabs>
+	</van-tabs> -->
+	<vip-00-apply />
 </template>
 
 <script>
 import vip00Apply from './VIP00Apply'
-import vip11Apply from './VIP11Apply'
-import VipCourse from "../applyActive/components/vipCourse";
-import TheoryCourse from "../applyActive/components/theoryCourse";
+// import vip11Apply from './VIP11Apply'
+// import VipCourse from "../applyActive/components/vipCourse";
+// import TheoryCourse from "../applyActive/components/theoryCourse";
 export default {
 	components: {
 		vip00Apply,
-		vip11Apply,
-		VipCourse,
-		TheoryCourse
+		// vip11Apply,
+		// VipCourse,
+		// TheoryCourse
 	},
 	data() {
 		return {
 			active: 1
 		}
 	},
+	mounted() {
+		document.title = '课程申请'
+	},
 	methods: {
-		onChange(value) {
-			if(value == 1) {
-				document.title = 'VIP课程申请'
-			} else if(value == 2) {
-				document.title = '双十一排课'
-			} else if(value == 3) {
-				document.title = '考级VIP排课'
-			} else if(value == 4) {
-				document.title = '考级乐理排课'
-			}
-		}
+		// onChange(value) {
+		// 	if(value == 1) {
+		// 		document.title = 'VIP课程申请'
+		// 	} else if(value == 2) {
+		// 		document.title = '双十一排课'
+		// 	} else if(value == 3) {
+		// 		document.title = '考级VIP排课'
+		// 	} else if(value == 4) {
+		// 		document.title = '考级乐理排课'
+		// 	}
+		// }
 	}
 }
 </script>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác