|
@@ -32,6 +32,7 @@ export default defineComponent({
|
|
|
const query = this.$route.query
|
|
|
return {
|
|
|
teacherId: query.teacherId,
|
|
|
+ subjectId: query.subjectId,
|
|
|
teacherSubjectList: [],
|
|
|
subjectStatus: false,
|
|
|
subjectInfo: {
|
|
@@ -63,11 +64,10 @@ export default defineComponent({
|
|
|
)
|
|
|
const result = res.data || []
|
|
|
if (result.length > 0) {
|
|
|
- const userSubjectId = state.user.data?.subjectId
|
|
|
+ const userSubjectId = this.subjectId || state.user.data?.subjectId
|
|
|
const findItem = result.find((item: any) => {
|
|
|
return item.subjectId === Number(userSubjectId)
|
|
|
})
|
|
|
- console.log(findItem)
|
|
|
// 判断是否有跟学生相同的科目,如果没有则默认取第一个
|
|
|
const tempRes = findItem || result[0]
|
|
|
const { subjectName, subjectPrice, courseMinutes, subjectId } = tempRes
|
|
@@ -244,21 +244,22 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- async _unLookCourse() {
|
|
|
- this.selectStatus = false
|
|
|
- this.coursePlanList.forEach((item: any) => {
|
|
|
- item.startTime = ''
|
|
|
- item.endTime = ''
|
|
|
- })
|
|
|
- },
|
|
|
async onReset() {
|
|
|
// 是否有锁课状态 或 是锁课类型的
|
|
|
if (this.coursePlanStatus || this.selectType === 'enough') {
|
|
|
- await this._unLookCourse()
|
|
|
+ this.selectStatus = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.coursePlanList.forEach((item: any) => {
|
|
|
+ item.startTime = ''
|
|
|
+ item.endTime = ''
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
} else if (this.selectType === 'noEnough') {
|
|
|
this.selectStatus = false
|
|
|
}
|
|
|
- this.coursePlanStatus = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.coursePlanStatus = false
|
|
|
+ }, 500)
|
|
|
},
|
|
|
async onSure() {
|
|
|
const status = this.coursePlanStatus
|