|
@@ -9,6 +9,7 @@ import request from '@/helpers/request'
|
|
|
import OPopup from '@/components/o-popup'
|
|
|
import Teacher from './compontent/teacher'
|
|
|
import { courseEmnu } from '@/constant'
|
|
|
+import ODialog from '@/components/o-dialog'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'unbind',
|
|
@@ -19,7 +20,11 @@ export default defineComponent({
|
|
|
teacherStatus: false,
|
|
|
classList: [] as any,
|
|
|
selectTeacher: {} as any,
|
|
|
- teacherId: route.query.id
|
|
|
+ teacherId: route.query.id,
|
|
|
+ dialogStatus: false,
|
|
|
+ dialogMessage: '',
|
|
|
+ dialogStatus1: false,
|
|
|
+ dialogMessage1: ''
|
|
|
})
|
|
|
const getClassDetail = async () => {
|
|
|
try {
|
|
@@ -67,30 +72,68 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- showDialog({
|
|
|
- title: '提示',
|
|
|
- message: '是否确认交接',
|
|
|
- showCancelButton: true
|
|
|
- }).then(async () => {
|
|
|
- const { data } = await request.post('/api-school/classGroup/handoverTeacher', {
|
|
|
- data: {
|
|
|
- teacherId: route.query.id,
|
|
|
- courseUpdateList: [...courseInfo]
|
|
|
- }
|
|
|
- })
|
|
|
+ state.dialogStatus = true
|
|
|
|
|
|
- if (data.finish === true) {
|
|
|
+ // showDialog({
|
|
|
+ // title: '提示',
|
|
|
+ // message: '是否确认交接',
|
|
|
+ // showCancelButton: true
|
|
|
+ // }).then(async () => {
|
|
|
+ // const { data } = await request.post('/api-school/classGroup/handoverTeacher', {
|
|
|
+ // data: {
|
|
|
+ // teacherId: route.query.id,
|
|
|
+ // courseUpdateList: [...courseInfo]
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // if (data.finish === true) {
|
|
|
+ // router.replace('/companion-teacher')
|
|
|
+ // } else {
|
|
|
+ // router.push({
|
|
|
+ // path: '/course-preview',
|
|
|
+ // query: {
|
|
|
+ // cacheId: data.cacheId,
|
|
|
+ // type: 'unbind'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const onConfirm = async () => {
|
|
|
+ try {
|
|
|
+ const courseInfo = [] as any
|
|
|
+ state.classList.forEach((item: any) => {
|
|
|
+ if (item.sTeacher) {
|
|
|
+ courseInfo.push({
|
|
|
+ courseType: item.courseType,
|
|
|
+ teacherId: item.sTeacher.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const res = await request.post('/api-school/classGroup/handoverTeacher', {
|
|
|
+ data: {
|
|
|
+ teacherId: route.query.id,
|
|
|
+ courseUpdateList: [...courseInfo]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code === 999) {
|
|
|
+ state.dialogStatus1 = true
|
|
|
+ state.dialogMessage1 = res.message
|
|
|
+ } else {
|
|
|
+ if (res.data.finish === true) {
|
|
|
router.replace('/companion-teacher')
|
|
|
} else {
|
|
|
router.push({
|
|
|
path: '/course-preview',
|
|
|
query: {
|
|
|
- cacheId: data.cacheId,
|
|
|
+ cacheId: res.data.cacheId,
|
|
|
type: 'unbind'
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -177,6 +220,25 @@ export default defineComponent({
|
|
|
onSelect={onSelectItem}
|
|
|
/>
|
|
|
</OPopup>
|
|
|
+
|
|
|
+ <ODialog
|
|
|
+ title="提示"
|
|
|
+ v-model:show={state.dialogStatus}
|
|
|
+ message={'是否确认交接?'}
|
|
|
+ confirmButtonText="确定"
|
|
|
+ showCancelButton
|
|
|
+ onConfirm={onConfirm}
|
|
|
+ />
|
|
|
+
|
|
|
+ <ODialog
|
|
|
+ title="提示"
|
|
|
+ v-model:show={state.dialogStatus1}
|
|
|
+ message={state.dialogMessage1}
|
|
|
+ confirmButtonText="确定"
|
|
|
+ onConfirm={() => {
|
|
|
+ router.back()
|
|
|
+ }}
|
|
|
+ />
|
|
|
</>
|
|
|
)
|
|
|
}
|