Commit a3cf976a authored by 黄奎's avatar 黄奎

约课调整

parent a4c1e95d
......@@ -44,10 +44,11 @@
:options="teacherTimeList" emit-value map-options label="上课时段" class="col-12" />
</template>
<!-- 详情显示内容 end -->
<q-select filled stack-label use-input option-value="CourseId" option-label="CourseName"
v-model="saveMsg.CourseId" ref="CourseId" :options="CourseList" label="课程" :dense="false" class="col-12"
emit-value map-options @filter="filterCourse" @input="changeCourse(),getChapterTree() "
v-if="editType == 1" :rules="[val => !!val || '请选择课程']">
emit-value map-options @filter="filterCourse" @input="changeCourse() " v-if="editType == 1"
:rules="[val => !!val || '请选择课程']">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -65,7 +66,7 @@
</q-item>
</template>
</q-select>
<select-tree v-show="saveMsg.CourseId > 0 && editType == 1" :treeData="chapterList"
<select-tree v-show="saveMsg.CourseId > 0 &&saveMsg.CourseRate<10 && editType == 1" :treeData="chapterList"
:defaultArray="returnString" nodeKey="ChapterId" labelKey="ChapterName" childrenKey="ChildList"
tipText="章节" @getChild="getChapter" class="col-12" ref="selectTree"></select-tree>
......@@ -142,7 +143,8 @@
<template v-else>
<q-select filled stack-label use-input option-value="ChapterNo" option-label="ChapterName"
v-model="item.CourseGradeNo" ref="ChapterGradeNo" :options="item.CourseChapterList"
label="消课章节" :dense="false" emit-value map-options class="col-4">
label="消课章节" :dense="false" emit-value map-options class="col-4"
@input="changeStuChapter(item)">
<template v-slot:option="{ itemProps, itemEvents, opt, }">
<q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section>
......@@ -201,7 +203,6 @@
</template>
<script>
import {
GetCanTeacherClassTimeList,
getCanAppointmentStuList_V2,
setAdminScrollAppointment_V3,
getScrollCourseChapterName,
......@@ -258,6 +259,41 @@
}
}
},
data() {
return {
CourseList: [], //关联课程下拉数据
AllCourseList: [], //所有课程列表
teacherTimeList: [],
stuList: [],
allStuList: [],
stuMsg_v2: {
StuName: "",
NextCourseGradeNo: 0,
CourseGradeId: 0,
LearnCourseId: 0,
},
saveMsg: {
CourseId: 0, //预约课程Id
CourseGradeNo: 0, //消课章节
Date: "", //预约日期
RoomId: 0, //上课教室
ShiftSort: "", //上课时段
TeacherId: 0, //老师Id
ChapterNo: 0, //预约主课程章节编号
CourseRate: 0, //课程等级
ChooseStuList: [], //学生列表
},
stuInfo: "",
addLoading: false,
chapterList: [], //章节列表,
checkChapter: {}, //选择的章节
returnString: [], //章节默认值
addStuList: [], //新增时展示用
ClassRoomList: [], //教室下拉
CourseChapterName: "",
currentUser: {},
};
},
watch: {
show: {
handler(val) {
......@@ -268,14 +304,12 @@
this.saveMsg.CourseId = 0;
this.saveMsg.TeacherId = 0;
this.chapterList = [];
this.courseCheckList = [];
this.stuList = [];
this.allStuList = [];
this.stuMsg_v2.StuName = "";
this.checkChapter = {};
if (this.editType == 2 && this.saveObj.ClassType == 3) {
this.getScrollCourseChapterName();
this.getStu_V2();
}
}
},
......@@ -284,6 +318,7 @@
saveObj: {
handler(val) {
if (val) {
console.log("saveObj", this.saveObj)
this.saveMsg.Date = this.dateObj.date;
this.saveMsg.TeacherId = this.saveObj.Tid;
this.saveMsg.ShiftSort = this.saveObj.ShiftSort;
......@@ -292,67 +327,33 @@
this.saveMsg.CourseGradeNo = this.saveObj.Ranks;
this.saveMsg.CourseGradeId = this.saveObj.CourseGradeId;
this.saveMsg.ChapterNo = this.saveObj.ChapterNo;
this.saveMsg.CourseRate = this.saveObj.CourseRate;
this.saveMsg.ChooseStuList = [];
if (this.saveObj.GuestList && this.saveObj.GuestList.length > 0) {
this.saveObj.GuestList.forEach(gItem => {
var cObj = {
StuId: gItem.StuId,
StuName: gItem.GuestName,
GuestId: gItem.GuestId,
LearnCourseId: gItem.LearnCourseId,
CourseName: gItem.LearnCourseName,
CourseGradeNo: gItem.CourseGradeNo,
FinishChapterNoName: gItem.FinishChapterNoName,
CourseChapterNoName: gItem.CourseChapterNoName,
AppointmentId: gItem.AppointmentId,
CourseGradeId: gItem.CourseGradeId,
CourseChapterList: [],
}
var cObj = this.getStuItem();
cObj.StuId = gItem.StuId;
cObj.StuName = gItem.GuestName;
cObj.GuestId = gItem.GuestId;
cObj.OrderId = gItem.OrderId;
cObj.CourseId = gItem.LearnCourseId;
cObj.CourseName = gItem.LearnCourseName;
cObj.CourseGradeNo = gItem.CourseGradeNo;
cObj.FinishChapterNoName = gItem.FinishChapterNoName;
cObj.CourseChapterNoName = gItem.CourseChapterNoName;
cObj.AppointmentId = gItem.AppointmentId;
cObj.CourseGradeId = gItem.CourseGradeId;
this.saveMsg.ChooseStuList.push(cObj);
})
}
if (this.editType == 2 && this.saveObj.ClassType == 3) {
this.getStu_V2();
}
}
},
deep: true
},
},
data() {
return {
CourseList: [], //关联课程下拉数据
AllCourseList: [], //所有课程列表
teacherTimeList: [],
stuList: [],
allStuList: [],
stuMsg_v2: {
StuName: "",
NextCourseGradeNo: 0,
CourseGradeId: 0
},
detailObj: {},
saveMsg: {
Date: "",
TeacherId: 0,
ShiftSort: "",
RoomId: 0,
CourseId: 0,
ChapterNo: 0,
CourseGradeNo: 0,
ChooseStuList: []
},
stuInfo: "",
checkStuList: [],
courseCheckList: [],
addLoading: false,
chapterList: [], //章节列表,
checkChapter: {}, //选择的章节
returnString: [], //章节默认值
addStuList: [], //新增时展示用
ClassRoomList: [], //教室下拉
CourseChapterName: "",
currentUser: {},
};
},
created() {
this.currentUser = this.getLocalStorage();
this.getCourseList();
......@@ -363,6 +364,23 @@
},
methods: {
getStuItem() {
var stuItem = {
StuId: 0, //学员ID
StuName: "", //学员名称
GuestId: 0, //学员GuestId
OrderId: 0, //学员订单编号
CourseId: 0, //消课课程ID
CourseName: "", //消课课程名称
CourseGradeId: 0, //消课课程等级
CourseGradeNo: 0, //消课章节编号
FinishChapterNoName: "", //完成章节名称
CourseChapterNoName: "", //消课章节名称
AppointmentId: 0, //预约编号
CourseChapterList: [], //消课课程章节
};
return stuItem;
},
//获取可约时间段
getTimeList() {
this.teacherTimeList = [];
......@@ -415,10 +433,21 @@
});
},
changeCourse() {
const changeCourse = this.CourseList.find(
s => s.CourseId == this.saveMsg.CourseId
);
if (changeCourse) {
this.saveMsg.CourseRate = changeCourse.CourseRate;
}
this.checkChapter = {};
this.checkStuList = [];
this.stuInfo = "";
if (this.saveMsg.CourseRate < 10) {
this.$refs.selectTree.clearData();
this.getChapterTree();
} else {
this.$refs.selectTree.clearData();
this.getChapterTree();
}
},
//筛选课程
filterCourse(val, update) {
......@@ -433,7 +462,6 @@
}
});
},
//筛选学生
filterStu(val, update) {
update(() => {
......@@ -449,6 +477,7 @@
},
//获取学生列表
getStu_V2() {
this.stuMsg_v2.LearnCourseId = 0;
if (this.editType == 1) {
this.stuMsg_v2.NextCourseGradeNo = this.checkChapter.ChapterGradeNo;
this.stuMsg_v2.CourseGradeId = this.checkChapter.CourseRate;
......@@ -457,6 +486,8 @@
this.stuMsg_v2.NextCourseGradeNo = this.saveObj.Ranks;
this.stuMsg_v2.CourseGradeId = this.saveObj.CourseGradeId;
}
//一般约课学员
if (this.saveMsg.CourseRate < 10) {
if ((this.stuMsg_v2.CourseGradeId && this.stuMsg_v2.CourseGradeId > 0) ||
(this.stuMsg_v2.NextCourseGradeNo && this.stuMsg_v2.NextCourseGradeNo > 0)) {
getCanAppointmentStuList_V2(this.stuMsg_v2).then(res => {
......@@ -464,6 +495,25 @@
this.allStuList = JSON.parse(JSON.stringify(res.Data));
});
}
} else {
//VIP学员
this.stuMsg_v2.LearnCourseId = this.saveMsg.CourseId;
this.stuMsg_v2.CourseGradeId = this.saveMsg.CourseRate;
getCanAppointmentStuList_V2(this.stuMsg_v2).then(res => {
this.stuList = JSON.parse(JSON.stringify(res.Data));
this.allStuList = JSON.parse(JSON.stringify(res.Data));
});
}
},
changeStuChapter(item) {
if (item.CourseChapterList && item.CourseChapterList.length > 0) {
const changeChapter = item.CourseChapterList.find(
s => s.ChapterNo == item.CourseGradeNo
);
if (changeChapter) {
item.CourseGradeId = changeChapter.CourseRate;
}
}
},
//删除选择的学生
DeleteStu(index) {
......@@ -474,7 +524,7 @@
if (!this.saveMsg.CourseId) return;
if (this.saveMsg.CourseId == 0) return;
const msg = {
CourseId: this.saveMsg.CourseId
CourseId: this.saveMsg.CourseId,
};
queryChapterTree(msg).then(res => {
this.chapterList = res.Data;
......@@ -494,7 +544,6 @@
},
//章节选择
getChapter(data) {
this.checkStuList = [];
this.stuInfo = "";
this.chapterList.map(e => {
if (e.ChapterId == data) {
......@@ -503,8 +552,6 @@
}
});
this.saveMsg.ChapterNo = this.checkChapter.ChapterNo;
// HK 2024-09-06 注释,可以不选老师,不选老师就默认通班的时间段
// this.saveMsg.TeacherId = 0;
//获取学生列表
this.getStu_V2();
},
......@@ -534,6 +581,7 @@
})
return;
}
if (this.saveMsg.CourseRate < 10) {
if (!this.saveMsg.ChapterNo) {
this.$q.notify({
type: 'negative',
......@@ -542,6 +590,8 @@
})
return;
}
}
if (!this.saveMsg.TeacherId) {
this.$q.notify({
type: 'negative',
......@@ -560,25 +610,25 @@
return;
}
this.saveMsg.Date = this.dateObj.date;
if (this.saveMsg.CourseRate < 10) {
this.saveMsg.CourseGradeNo = this.checkChapter.ChapterGradeNo;
this.saveMsg.CourseGradeId = this.checkChapter.CourseRate;
} else {
this.saveMsg.CourseGradeId = this.saveMsg.CourseRate;
}
}
var sObj = {
StuId: this.stuInfo.StuId,
StuName: this.stuInfo.StuName,
GuestId: this.stuInfo.GuestId,
OrderId: this.stuInfo.OrderId,
LearnCourseId: this.stuInfo.CourseId,
CourseName: this.stuInfo.CourseName,
FinishChapterNoName: this.stuInfo.FinishChapterNoName,
AppointmentId: 0,
//学员消课编号
CourseChapterList: [],
};
sObj.CourseGradeId = this.stuInfo.CourseRate;
sObj.CourseGradeNo = "";
var sObj = this.getStuItem();
sObj.StuId = this.stuInfo.StuId;
sObj.StuName = this.stuInfo.StuName;
sObj.GuestId = this.stuInfo.GuestId;
sObj.OrderId = this.stuInfo.OrderId;
sObj.CourseId = this.stuInfo.CourseId;
sObj.CourseName = this.stuInfo.CourseName;
sObj.FinishChapterNoName = this.stuInfo.FinishChapterNoName;
sObj.AppointmentId = 0;
sObj.CourseGradeId = 0;
sObj.CourseChapterList = [];
// 对比是否存在改学员
if (this.saveMsg.ChooseStuList.length > 0) {
let ArrId = this.saveMsg.ChooseStuList.map(item => {
......@@ -627,8 +677,6 @@
message: "操作成功",
position: "top"
});
// this.$emit("success");
this.detailCloseHandle();
}
})
......@@ -639,7 +687,7 @@
//获取课程章节列表
getCourseChapterList(item) {
queryChapterList({
CourseId: item.LearnCourseId,
CourseId: item.CourseId,
OrderId: item.OrderId,
IsQRoot: 1,
}).then(res => {
......@@ -666,11 +714,13 @@
CourseGradeId: this.saveObj.CourseGradeId,
CourseGradeNo: this.saveObj.Ranks,
}
if (this.saveObj.CourseRate < 10) {
getScrollCourseChapterName(msg).then(res => {
this.CourseChapterName = res.Data
})
}
}
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment