|
@@ -0,0 +1,284 @@
|
|
|
+<template>
|
|
|
+ <div class="program">
|
|
|
+ <van-cell-group class="van-cell-group--inset">
|
|
|
+ <van-cell title="2020年双十一1v1活动" class="titleContent" title-class="titleStyle" label-class="labelStyle">
|
|
|
+ <template #label>
|
|
|
+ <p>2020年双十一VIP1v1活动</p>
|
|
|
+ <p>11.11抵扣1111</p>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
+ <h2 class="van-block__title">付费课程排课</h2>
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field
|
|
|
+ v-model="formName.courseType"
|
|
|
+ label="课程类型"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formName.vipGroupCategoryName"
|
|
|
+ label="课程形式"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formName.subjectListName"
|
|
|
+ label="排课声部"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formName.educationalTeacherName"
|
|
|
+ label="乐团主管"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
+ <template v-if="studentList.length > 0">
|
|
|
+ <h2 class="van-block__title">上课学员</h2>
|
|
|
+ <van-cell-group>
|
|
|
+ <van-cell title-style="flex: 1 auto;" size="large" v-for="(item, index) in studentList" :key="index">
|
|
|
+ <template #title>
|
|
|
+ {{ item.userName }} - {{ item.phone }}
|
|
|
+ </template>
|
|
|
+ <template #default>
|
|
|
+ <span @click="onDelete('student', item)"><van-icon name="delete-o" size=".14rem" /> <span style="font-size: .12rem;">删除</span></span>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ </template>
|
|
|
+ <div class="addButton" @click="studentStatus = true">
|
|
|
+ <van-icon name="plus" /> 添加学员
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h2 class="van-block__title">课时组成</h2>
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field
|
|
|
+ v-model="formName.subjectListName"
|
|
|
+ label="班级人数"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formName.vipGroupCategoryName"
|
|
|
+ label="单课时时长"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
+ <h2 class="van-block__title">课时安排</h2>
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field
|
|
|
+ v-model="formName.subjectListName"
|
|
|
+ label="课时总数"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请输入排课课时数"
|
|
|
+ />
|
|
|
+ <van-field
|
|
|
+ v-model="formName.vipGroupCategoryName"
|
|
|
+ label="排课开始时间"
|
|
|
+ :readonly="true"
|
|
|
+ input-align="right"
|
|
|
+ is-link
|
|
|
+ size="large"
|
|
|
+ placeholder="请选择"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
+ <van-cell-group :border="false" style="margin-top: .1rem">
|
|
|
+ <van-cell
|
|
|
+ title-class="title-time"
|
|
|
+ v-for="(item, index) in scheduleList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <template slot="title">
|
|
|
+ <span class="online">{{ item.type }}</span>
|
|
|
+ <span class="week">{{ item.weekStr }}</span>
|
|
|
+ <span class="timer">{{ item.startTime + "~" + item.endTime }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="default">
|
|
|
+ <span @click="onDelete('class', item)"><van-icon name="delete-o" size=".14rem" /> <span style="font-size: .12rem;">删除</span></span>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ <div class="addButton" @click="teachingStatus = true">
|
|
|
+ <van-icon name="plus" /> 添加课时安排
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="button-group">
|
|
|
+ <van-button type="primary" @click="onSubmit" round size="large">确认</van-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 选择上课学生 -->
|
|
|
+ <van-popup
|
|
|
+ v-model="studentStatus"
|
|
|
+ :lock-scroll="true"
|
|
|
+ position="bottom"
|
|
|
+ :style="{ height: '180%' }"
|
|
|
+ class="studentChiose"
|
|
|
+ >
|
|
|
+ <student-list @close="studentStatus = false" :studentList="studentList" @submit="onSelectStudent" />
|
|
|
+ </van-popup>
|
|
|
+ <!-- 课时安排 -->
|
|
|
+ <van-popup v-model="teachingStatus" position="bottom">
|
|
|
+ <course-modal :scheduleList="scheduleList" :singleClassMinutes="form.singleClassMinutes" @close="teachingStatus = false" />
|
|
|
+ </van-popup>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import studentList from './modal/studentList'
|
|
|
+import courseModal from './modal/course'
|
|
|
+export default {
|
|
|
+ components: { studentList, courseModal },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ studentStatus: false,
|
|
|
+ studentList: [],
|
|
|
+ form: {
|
|
|
+ singleClassMinutes: 45
|
|
|
+ },
|
|
|
+ formName: {
|
|
|
+ courseType: 'VIP课',
|
|
|
+ },
|
|
|
+ scheduleList: [],
|
|
|
+ // 排课弹窗
|
|
|
+ teachingStatus: false, // 课时安排状态
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onSubmit() {
|
|
|
+ console.log('排课了')
|
|
|
+ },
|
|
|
+ onSelectStudent(items) {
|
|
|
+ // 选中的数据
|
|
|
+ this.studentList = items
|
|
|
+ this.studentStatus = false
|
|
|
+ },
|
|
|
+ onDelete(type, item) {
|
|
|
+ if(type == 'student') {
|
|
|
+ // 删除上课学员
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '提示',
|
|
|
+ message: '是否删除该学员?',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonColor: '#269a93',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(() => {
|
|
|
+ let index = this.studentList.indexOf(item);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.studentList.splice(index, 1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if(type == 'class') {
|
|
|
+ // 删除上课学员
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '提示',
|
|
|
+ message: '是否删除该课时安排?',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ confirmButtonColor: '#269a93',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(() => {
|
|
|
+ let index = this.scheduleList.indexOf(item);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.scheduleList.splice(index, 1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+@import url("../../assets/commonLess/variable.less");
|
|
|
+.program {
|
|
|
+ background-color: #F5F5F5;
|
|
|
+ min-height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.van-cell-group--inset {
|
|
|
+ margin: .12rem .12rem 0;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 8px;
|
|
|
+ .titleContent {
|
|
|
+ padding: .14rem .16rem;
|
|
|
+ }
|
|
|
+ .titleStyle {
|
|
|
+ font-size: .2rem;
|
|
|
+ color: #333333;
|
|
|
+ font-size: 500;
|
|
|
+ }
|
|
|
+ .labelStyle {
|
|
|
+ padding-top: .08rem;
|
|
|
+ color: #666666;
|
|
|
+ font-size: .13rem;
|
|
|
+ line-height: .2rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+.van-block__title {
|
|
|
+ padding: .12rem .14rem .06rem;
|
|
|
+ color: #808080;
|
|
|
+ font-size: .14rem;
|
|
|
+ line-height: .2rem;
|
|
|
+}
|
|
|
+.button-group {
|
|
|
+ margin: 0.3rem 0.26rem 0.2rem;
|
|
|
+
|
|
|
+ .van-button--primary {
|
|
|
+ background: @mColor;
|
|
|
+ border-color: @mColor;
|
|
|
+ font-size: 0.18rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+.title-time {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex: 1 auto;
|
|
|
+ color: #1A1A1A;
|
|
|
+ font-size: .16rem;
|
|
|
+ .week {
|
|
|
+ padding-left: 0.4rem;
|
|
|
+ padding-right: 0.15rem;
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.studentChiose {
|
|
|
+ border-radius: 0 0 0px 0px;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+.addButton {
|
|
|
+ margin: .1rem .28rem;
|
|
|
+ border: 1px dashed #CFCFCF;
|
|
|
+ line-height: .42rem;
|
|
|
+ text-align: center;
|
|
|
+ background: #FBFBFB;
|
|
|
+ color: #666666;
|
|
|
+ font-size: .14rem;
|
|
|
+ border-radius: .05rem;
|
|
|
+}
|
|
|
+</style>
|