|
@@ -1,6 +1,6 @@
|
|
|
import OHeader from '@/components/o-header'
|
|
|
import OSticky from '@/components/o-sticky'
|
|
|
-import { Button, Cell, CellGroup, Image, showDialog, showToast } from 'vant'
|
|
|
+import { Button, Cell, CellGroup, Field, Grid, GridItem, Image, showDialog, showToast } from 'vant'
|
|
|
import { defineComponent, onMounted, reactive } from 'vue'
|
|
|
import styles from './unbind.module.less'
|
|
|
import { state as baseState } from '@/state'
|
|
@@ -8,6 +8,7 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
import request from '@/helpers/request'
|
|
|
import OPopup from '@/components/o-popup'
|
|
|
import Teacher from './compontent/teacher'
|
|
|
+import { courseEmnu } from '@/constant'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'unbind',
|
|
@@ -22,15 +23,11 @@ export default defineComponent({
|
|
|
})
|
|
|
const getClassDetail = async () => {
|
|
|
try {
|
|
|
- const { data } = await request.post('/api-school/classGroup/page', {
|
|
|
- data: {
|
|
|
- teacherId: state.teacherId,
|
|
|
- schoolId: baseState.user.data.school.id,
|
|
|
- page: 1,
|
|
|
- rows: 100
|
|
|
- }
|
|
|
- })
|
|
|
- state.classList = data.rows || []
|
|
|
+ const { data } = await request.post(
|
|
|
+ '/api-school/classGroup/teacherHandoverList/' + state.teacherId,
|
|
|
+ {}
|
|
|
+ )
|
|
|
+ state.classList = data || []
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -58,7 +55,7 @@ export default defineComponent({
|
|
|
|
|
|
if (item.sTeacher) {
|
|
|
courseInfo.push({
|
|
|
- classGroupId: item.id,
|
|
|
+ courseType: item.courseType,
|
|
|
teacherId: item.sTeacher.id
|
|
|
})
|
|
|
}
|
|
@@ -78,17 +75,12 @@ export default defineComponent({
|
|
|
const { data } = await request.post('/api-school/classGroup/handoverTeacher', {
|
|
|
data: {
|
|
|
teacherId: route.query.id,
|
|
|
- updateTeacherList: [...courseInfo]
|
|
|
+ courseUpdateList: [...courseInfo]
|
|
|
}
|
|
|
})
|
|
|
|
|
|
if (data.finish === true) {
|
|
|
- setTimeout(() => {
|
|
|
- showToast('交接成功')
|
|
|
- }, 100)
|
|
|
- setTimeout(() => {
|
|
|
- router.replace('/companion-teacher')
|
|
|
- }, 1000)
|
|
|
+ router.replace('/companion-teacher')
|
|
|
} else {
|
|
|
router.push({
|
|
|
path: '/course-preview',
|
|
@@ -113,39 +105,61 @@ export default defineComponent({
|
|
|
|
|
|
<div class={styles.unbindTips}>该伴学指导存在以下班级及课程未开始,请选择交接伴学指导</div>
|
|
|
|
|
|
- <CellGroup inset class={styles.detailCellGroup}>
|
|
|
- {state.classList.map((item: any) => (
|
|
|
- <Cell
|
|
|
- center
|
|
|
- class={styles.detailCell}
|
|
|
+ {/* <CellGroup inset class={styles.detailCellGroup}> */}
|
|
|
+ {state.classList.map((item: any) => (
|
|
|
+ // <Cell
|
|
|
+ // center
|
|
|
+ // class={styles.detailCell}
|
|
|
+ // isLink
|
|
|
+ // onClick={() => onSelectTeacher(item)}
|
|
|
+ // valueClass={styles.valueClass}
|
|
|
+ // >
|
|
|
+ // {{
|
|
|
+ // title: () => (
|
|
|
+ // <div class={styles.teacherContent}>
|
|
|
+ // <div class={styles.classInfo}>
|
|
|
+ // <p class={styles.className}>{item.name}</p>
|
|
|
+ // <p class={[styles.musicName, 'van-ellipsis']}>{item.orchestraName}</p>
|
|
|
+ // </div>
|
|
|
+ // <div class={styles.classNum}>
|
|
|
+ // <p class={styles.nums}>
|
|
|
+ // {item.courseScheduleNum - item.completeCourseScheduleNum}
|
|
|
+ // </p>
|
|
|
+ // <p class={styles.numTip}>剩余课时</p>
|
|
|
+ // </div>
|
|
|
+ // </div>
|
|
|
+ // ),
|
|
|
+ // value: () => (
|
|
|
+ // <div class={[styles.teacherName, 'van-ellipsis']}>
|
|
|
+ // {item.sTeacher && item.sTeacher.nickname}
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ // }}
|
|
|
+ // </Cell>
|
|
|
+ <CellGroup inset class={styles.classCellGroup} border={false}>
|
|
|
+ {/* <Cell center titleStyle={{ flex: '0 auto' }}></Cell> */}
|
|
|
+ <Field
|
|
|
isLink
|
|
|
+ placeholder="请选择交接老师"
|
|
|
+ inputAlign="right"
|
|
|
+ readonly
|
|
|
+ modelValue={item.sTeacher ? item.sTeacher.nickname : ''}
|
|
|
onClick={() => onSelectTeacher(item)}
|
|
|
- valueClass={styles.valueClass}
|
|
|
>
|
|
|
- {{
|
|
|
- title: () => (
|
|
|
- <div class={styles.teacherContent}>
|
|
|
- <div class={styles.classInfo}>
|
|
|
- <p class={styles.className}>{item.name}</p>
|
|
|
- <p class={[styles.musicName, 'van-ellipsis']}>{item.orchestraName}</p>
|
|
|
- </div>
|
|
|
- <div class={styles.classNum}>
|
|
|
- <p class={styles.nums}>
|
|
|
- {item.courseScheduleNum - item.completeCourseScheduleNum}
|
|
|
- </p>
|
|
|
- <p class={styles.numTip}>剩余课时</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ),
|
|
|
- value: () => (
|
|
|
- <div class={[styles.teacherName, 'van-ellipsis']}>
|
|
|
- {item.sTeacher && item.sTeacher.nickname}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- </Cell>
|
|
|
- ))}
|
|
|
- </CellGroup>
|
|
|
+ {{ label: () => <div class={styles.classTitle}>{courseEmnu[item.courseType]}</div> }}
|
|
|
+ </Field>
|
|
|
+ <Grid border={false} columnNum={2}>
|
|
|
+ <GridItem>
|
|
|
+ <p class={styles.title}>{item.classNum}</p>
|
|
|
+ <p class={styles.name}>班级数量</p>
|
|
|
+ </GridItem>
|
|
|
+ <GridItem>
|
|
|
+ <p class={[styles.title]}>{item.courseNum}</p>
|
|
|
+ <p class={styles.name}>剩余课时</p>
|
|
|
+ </GridItem>
|
|
|
+ </Grid>
|
|
|
+ </CellGroup>
|
|
|
+ ))}
|
|
|
|
|
|
<OSticky position="bottom">
|
|
|
<div class={['btnGroup']} style={{ paddingLeft: '13px', paddingRight: '13px' }}>
|
|
@@ -155,7 +169,7 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</OSticky>
|
|
|
|
|
|
- <OPopup v-model:modelValue={state.teacherStatus} destroy>
|
|
|
+ <OPopup v-model:modelValue={state.teacherStatus} destroy style={{ background: '#F8F8F8' }}>
|
|
|
<Teacher
|
|
|
courseType={state.selectTeacher.courseType}
|
|
|
teacherId={state.teacherId as any}
|