import { Button, Cell, CellGroup, Checkbox, CheckboxGroup, DatePicker, Dialog, Field, Icon, Picker, Popup, Radio, RadioGroup, showLoadingToast, showToast, Sticky, Tag } from 'vant' import { defineComponent, onMounted, reactive } from 'vue' import { weekdays, weekFormat } from '../../create' import styles from './index.module.less' import { forms } from '../../create' import dayjs from 'dayjs' import { useRouter } from 'vue-router' import OPopup from '@/components/o-popup' import ClassList from '../../modal/class-list' import request from '@/helpers/request' import { state } from '@/state' import OSticky from '@/components/o-sticky' export default defineComponent({ name: 'practice', props: { address: { type: String, default: '' } }, setup(props) { const router = useRouter() // 查询没有设置指导老师的班级 // const getClasses = async (show = true) => { // try { // const { data } = await request.post('/api-school/classGroup/page', { // data: { // page: 1, // rows: 200, // schoolId: state.user.data.school.id, // hasTeacher: false, // orchestraType: 'DELIVERY' // } // }) // // 班级数据 // forms.classList = data.rows || [] // // 判断没有设置伴学指导的班级 // if (forms.classList.length > 0 && show) { // forms.status = true // } // } catch { // // // } // } const onSubmit = () => { // showLoadingToast({ // message: '加载中...', // forbidClick: true, // loadingType: 'spinner' // }) // setTimeout(() => { // showToast('请选择课程类型请选择课程类型') // }, 1000) // return // 判断是否有班级没有设置伴学指导 if (forms.classList.length > 0) { forms.status = true return } if (forms.classType.length <= 0) { showToast('请选择课程类型') return } if (!forms.trainStartDate) { showToast('请选择课程开始日期') return } if (!forms.week) { showToast('请选择周次') return } if (!props.address) { showToast('您所在的学校暂未设置地址') return } // 初始化 训练详情 const classPracticeList: any = [] forms.classType.forEach((item: any) => { classPracticeList.push({ classType: item, startTime: null as any, endTime: null as any, trainTimer: null as any, times: null as any, classIdList: [] as any }) }) forms.classPracticeList = classPracticeList router.push('/practice-detail') } onMounted(() => { // getClasses() }) return () => (
乐团加练可对任意班级进行排课
{{ value: () => ( 声部课 乐理课 合奏课 ) }} (forms.calendarStatus = true)} /> { // forms.weekStatus = true if (!forms.trainStartDate) { showToast('请选择课程开始日期') return } }} /> {{ value: () => ( ) }}
{/* 训练周次 */} (forms.weekStatus = false)} onConfirm={(val: any) => { forms.week = val.selectedValues[0] forms.weekStatus = false }} /> {/* 训练开始日期 */} (forms.calendarStatus = false)} onConfirm={(date: any) => { forms.calendarStatus = false forms.trainStartDate = date.selectedValues.join('-') const days = dayjs(forms.trainStartDate).day() const selectDays = weekdays[days === 0 ? 6 : days - 1] forms.week = selectDays.value }} /> {/* { forms.classStatus = true }} > {{ title: () => (
指定伴学指导
) }}
(forms.classStatus = false)} onConfirm={() => { getClasses(false) }} /> */}
) } })