Commit a3cf976a authored by 黄奎's avatar 黄奎

约课调整

parent a4c1e95d
...@@ -44,10 +44,11 @@ ...@@ -44,10 +44,11 @@
:options="teacherTimeList" emit-value map-options label="上课时段" class="col-12" /> :options="teacherTimeList" emit-value map-options label="上课时段" class="col-12" />
</template> </template>
<!-- 详情显示内容 end --> <!-- 详情显示内容 end -->
<q-select filled stack-label use-input option-value="CourseId" option-label="CourseName" <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" v-model="saveMsg.CourseId" ref="CourseId" :options="CourseList" label="课程" :dense="false" class="col-12"
emit-value map-options @filter="filterCourse" @input="changeCourse(),getChapterTree() " emit-value map-options @filter="filterCourse" @input="changeCourse() " v-if="editType == 1"
v-if="editType == 1" :rules="[val => !!val || '请选择课程']"> :rules="[val => !!val || '请选择课程']">
<template v-slot:no-option> <template v-slot:no-option>
<q-item> <q-item>
<q-item-section class="text-grey"> <q-item-section class="text-grey">
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
</q-item> </q-item>
</template> </template>
</q-select> </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" :defaultArray="returnString" nodeKey="ChapterId" labelKey="ChapterName" childrenKey="ChildList"
tipText="章节" @getChild="getChapter" class="col-12" ref="selectTree"></select-tree> tipText="章节" @getChild="getChapter" class="col-12" ref="selectTree"></select-tree>
...@@ -142,7 +143,8 @@ ...@@ -142,7 +143,8 @@
<template v-else> <template v-else>
<q-select filled stack-label use-input option-value="ChapterNo" option-label="ChapterName" <q-select filled stack-label use-input option-value="ChapterNo" option-label="ChapterName"
v-model="item.CourseGradeNo" ref="ChapterGradeNo" :options="item.CourseChapterList" 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, }"> <template v-slot:option="{ itemProps, itemEvents, opt, }">
<q-item v-bind="itemProps" v-on="itemEvents"> <q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section> <q-item-section>
...@@ -201,7 +203,6 @@ ...@@ -201,7 +203,6 @@
</template> </template>
<script> <script>
import { import {
GetCanTeacherClassTimeList,
getCanAppointmentStuList_V2, getCanAppointmentStuList_V2,
setAdminScrollAppointment_V3, setAdminScrollAppointment_V3,
getScrollCourseChapterName, getScrollCourseChapterName,
...@@ -258,6 +259,41 @@ ...@@ -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: { watch: {
show: { show: {
handler(val) { handler(val) {
...@@ -268,14 +304,12 @@ ...@@ -268,14 +304,12 @@
this.saveMsg.CourseId = 0; this.saveMsg.CourseId = 0;
this.saveMsg.TeacherId = 0; this.saveMsg.TeacherId = 0;
this.chapterList = []; this.chapterList = [];
this.courseCheckList = [];
this.stuList = []; this.stuList = [];
this.allStuList = []; this.allStuList = [];
this.stuMsg_v2.StuName = ""; this.stuMsg_v2.StuName = "";
this.checkChapter = {}; this.checkChapter = {};
if (this.editType == 2 && this.saveObj.ClassType == 3) { if (this.editType == 2 && this.saveObj.ClassType == 3) {
this.getScrollCourseChapterName(); this.getScrollCourseChapterName();
this.getStu_V2();
} }
} }
}, },
...@@ -284,6 +318,7 @@ ...@@ -284,6 +318,7 @@
saveObj: { saveObj: {
handler(val) { handler(val) {
if (val) { if (val) {
console.log("saveObj", this.saveObj)
this.saveMsg.Date = this.dateObj.date; this.saveMsg.Date = this.dateObj.date;
this.saveMsg.TeacherId = this.saveObj.Tid; this.saveMsg.TeacherId = this.saveObj.Tid;
this.saveMsg.ShiftSort = this.saveObj.ShiftSort; this.saveMsg.ShiftSort = this.saveObj.ShiftSort;
...@@ -292,67 +327,33 @@ ...@@ -292,67 +327,33 @@
this.saveMsg.CourseGradeNo = this.saveObj.Ranks; this.saveMsg.CourseGradeNo = this.saveObj.Ranks;
this.saveMsg.CourseGradeId = this.saveObj.CourseGradeId; this.saveMsg.CourseGradeId = this.saveObj.CourseGradeId;
this.saveMsg.ChapterNo = this.saveObj.ChapterNo; this.saveMsg.ChapterNo = this.saveObj.ChapterNo;
this.saveMsg.CourseRate = this.saveObj.CourseRate;
this.saveMsg.ChooseStuList = []; this.saveMsg.ChooseStuList = [];
if (this.saveObj.GuestList && this.saveObj.GuestList.length > 0) { if (this.saveObj.GuestList && this.saveObj.GuestList.length > 0) {
this.saveObj.GuestList.forEach(gItem => { this.saveObj.GuestList.forEach(gItem => {
var cObj = { var cObj = this.getStuItem();
StuId: gItem.StuId, cObj.StuId = gItem.StuId;
StuName: gItem.GuestName, cObj.StuName = gItem.GuestName;
GuestId: gItem.GuestId, cObj.GuestId = gItem.GuestId;
LearnCourseId: gItem.LearnCourseId, cObj.OrderId = gItem.OrderId;
CourseName: gItem.LearnCourseName, cObj.CourseId = gItem.LearnCourseId;
CourseGradeNo: gItem.CourseGradeNo, cObj.CourseName = gItem.LearnCourseName;
FinishChapterNoName: gItem.FinishChapterNoName, cObj.CourseGradeNo = gItem.CourseGradeNo;
CourseChapterNoName: gItem.CourseChapterNoName, cObj.FinishChapterNoName = gItem.FinishChapterNoName;
AppointmentId: gItem.AppointmentId, cObj.CourseChapterNoName = gItem.CourseChapterNoName;
CourseGradeId: gItem.CourseGradeId, cObj.AppointmentId = gItem.AppointmentId;
CourseChapterList: [], cObj.CourseGradeId = gItem.CourseGradeId;
}
this.saveMsg.ChooseStuList.push(cObj); this.saveMsg.ChooseStuList.push(cObj);
}) })
} }
if (this.editType == 2 && this.saveObj.ClassType == 3) {
this.getStu_V2();
}
} }
}, },
deep: true 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() { created() {
this.currentUser = this.getLocalStorage(); this.currentUser = this.getLocalStorage();
this.getCourseList(); this.getCourseList();
...@@ -363,6 +364,23 @@ ...@@ -363,6 +364,23 @@
}, },
methods: { 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() { getTimeList() {
this.teacherTimeList = []; this.teacherTimeList = [];
...@@ -415,10 +433,21 @@ ...@@ -415,10 +433,21 @@
}); });
}, },
changeCourse() { changeCourse() {
const changeCourse = this.CourseList.find(
s => s.CourseId == this.saveMsg.CourseId
);
if (changeCourse) {
this.saveMsg.CourseRate = changeCourse.CourseRate;
}
this.checkChapter = {}; this.checkChapter = {};
this.checkStuList = [];
this.stuInfo = ""; this.stuInfo = "";
this.$refs.selectTree.clearData(); if (this.saveMsg.CourseRate < 10) {
this.$refs.selectTree.clearData();
this.getChapterTree();
} else {
this.$refs.selectTree.clearData();
this.getChapterTree();
}
}, },
//筛选课程 //筛选课程
filterCourse(val, update) { filterCourse(val, update) {
...@@ -433,7 +462,6 @@ ...@@ -433,7 +462,6 @@
} }
}); });
}, },
//筛选学生 //筛选学生
filterStu(val, update) { filterStu(val, update) {
update(() => { update(() => {
...@@ -449,6 +477,7 @@ ...@@ -449,6 +477,7 @@
}, },
//获取学生列表 //获取学生列表
getStu_V2() { getStu_V2() {
this.stuMsg_v2.LearnCourseId = 0;
if (this.editType == 1) { if (this.editType == 1) {
this.stuMsg_v2.NextCourseGradeNo = this.checkChapter.ChapterGradeNo; this.stuMsg_v2.NextCourseGradeNo = this.checkChapter.ChapterGradeNo;
this.stuMsg_v2.CourseGradeId = this.checkChapter.CourseRate; this.stuMsg_v2.CourseGradeId = this.checkChapter.CourseRate;
...@@ -457,14 +486,35 @@ ...@@ -457,14 +486,35 @@
this.stuMsg_v2.NextCourseGradeNo = this.saveObj.Ranks; this.stuMsg_v2.NextCourseGradeNo = this.saveObj.Ranks;
this.stuMsg_v2.CourseGradeId = this.saveObj.CourseGradeId; this.stuMsg_v2.CourseGradeId = this.saveObj.CourseGradeId;
} }
if ((this.stuMsg_v2.CourseGradeId && this.stuMsg_v2.CourseGradeId > 0) || //一般约课学员
(this.stuMsg_v2.NextCourseGradeNo && this.stuMsg_v2.NextCourseGradeNo > 0)) { 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 => {
this.stuList = JSON.parse(JSON.stringify(res.Data));
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 => { getCanAppointmentStuList_V2(this.stuMsg_v2).then(res => {
this.stuList = JSON.parse(JSON.stringify(res.Data)); this.stuList = JSON.parse(JSON.stringify(res.Data));
this.allStuList = 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) { DeleteStu(index) {
this.saveMsg.ChooseStuList.splice(index, 1); this.saveMsg.ChooseStuList.splice(index, 1);
...@@ -474,7 +524,7 @@ ...@@ -474,7 +524,7 @@
if (!this.saveMsg.CourseId) return; if (!this.saveMsg.CourseId) return;
if (this.saveMsg.CourseId == 0) return; if (this.saveMsg.CourseId == 0) return;
const msg = { const msg = {
CourseId: this.saveMsg.CourseId CourseId: this.saveMsg.CourseId,
}; };
queryChapterTree(msg).then(res => { queryChapterTree(msg).then(res => {
this.chapterList = res.Data; this.chapterList = res.Data;
...@@ -494,7 +544,6 @@ ...@@ -494,7 +544,6 @@
}, },
//章节选择 //章节选择
getChapter(data) { getChapter(data) {
this.checkStuList = [];
this.stuInfo = ""; this.stuInfo = "";
this.chapterList.map(e => { this.chapterList.map(e => {
if (e.ChapterId == data) { if (e.ChapterId == data) {
...@@ -503,8 +552,6 @@ ...@@ -503,8 +552,6 @@
} }
}); });
this.saveMsg.ChapterNo = this.checkChapter.ChapterNo; this.saveMsg.ChapterNo = this.checkChapter.ChapterNo;
// HK 2024-09-06 注释,可以不选老师,不选老师就默认通班的时间段
// this.saveMsg.TeacherId = 0;
//获取学生列表 //获取学生列表
this.getStu_V2(); this.getStu_V2();
}, },
...@@ -534,14 +581,17 @@ ...@@ -534,14 +581,17 @@
}) })
return; return;
} }
if (!this.saveMsg.ChapterNo) { if (this.saveMsg.CourseRate < 10) {
this.$q.notify({ if (!this.saveMsg.ChapterNo) {
type: 'negative', this.$q.notify({
position: "top", type: 'negative',
message: `请选择章节` position: "top",
}) message: `请选择章节`
return; })
return;
}
} }
if (!this.saveMsg.TeacherId) { if (!this.saveMsg.TeacherId) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -550,7 +600,7 @@ ...@@ -550,7 +600,7 @@
}) })
return; return;
} }
if (!this.stuInfo) { if (!this.stuInfo) {
this.$q.notify({ this.$q.notify({
message: "请选择学员", message: "请选择学员",
...@@ -560,25 +610,25 @@ ...@@ -560,25 +610,25 @@
return; return;
} }
this.saveMsg.Date = this.dateObj.date; this.saveMsg.Date = this.dateObj.date;
this.saveMsg.CourseGradeNo = this.checkChapter.ChapterGradeNo; if (this.saveMsg.CourseRate < 10) {
this.saveMsg.CourseGradeId = this.checkChapter.CourseRate; this.saveMsg.CourseGradeNo = this.checkChapter.ChapterGradeNo;
this.saveMsg.CourseGradeId = this.checkChapter.CourseRate;
} else {
this.saveMsg.CourseGradeId = this.saveMsg.CourseRate;
}
} }
var sObj = { var sObj = this.getStuItem();
StuId: this.stuInfo.StuId, sObj.StuId = this.stuInfo.StuId;
StuName: this.stuInfo.StuName, sObj.StuName = this.stuInfo.StuName;
GuestId: this.stuInfo.GuestId, sObj.GuestId = this.stuInfo.GuestId;
OrderId: this.stuInfo.OrderId, sObj.OrderId = this.stuInfo.OrderId;
LearnCourseId: this.stuInfo.CourseId, sObj.CourseId = this.stuInfo.CourseId;
CourseName: this.stuInfo.CourseName, sObj.CourseName = this.stuInfo.CourseName;
FinishChapterNoName: this.stuInfo.FinishChapterNoName, sObj.FinishChapterNoName = this.stuInfo.FinishChapterNoName;
AppointmentId: 0, sObj.AppointmentId = 0;
//学员消课编号 sObj.CourseGradeId = 0;
CourseChapterList: [], sObj.CourseChapterList = [];
};
sObj.CourseGradeId = this.stuInfo.CourseRate;
sObj.CourseGradeNo = "";
// 对比是否存在改学员 // 对比是否存在改学员
if (this.saveMsg.ChooseStuList.length > 0) { if (this.saveMsg.ChooseStuList.length > 0) {
let ArrId = this.saveMsg.ChooseStuList.map(item => { let ArrId = this.saveMsg.ChooseStuList.map(item => {
...@@ -627,8 +677,6 @@ ...@@ -627,8 +677,6 @@
message: "操作成功", message: "操作成功",
position: "top" position: "top"
}); });
// this.$emit("success");
this.detailCloseHandle(); this.detailCloseHandle();
} }
}) })
...@@ -639,7 +687,7 @@ ...@@ -639,7 +687,7 @@
//获取课程章节列表 //获取课程章节列表
getCourseChapterList(item) { getCourseChapterList(item) {
queryChapterList({ queryChapterList({
CourseId: item.LearnCourseId, CourseId: item.CourseId,
OrderId: item.OrderId, OrderId: item.OrderId,
IsQRoot: 1, IsQRoot: 1,
}).then(res => { }).then(res => {
...@@ -666,9 +714,11 @@ ...@@ -666,9 +714,11 @@
CourseGradeId: this.saveObj.CourseGradeId, CourseGradeId: this.saveObj.CourseGradeId,
CourseGradeNo: this.saveObj.Ranks, CourseGradeNo: this.saveObj.Ranks,
} }
getScrollCourseChapterName(msg).then(res => { if (this.saveObj.CourseRate < 10) {
this.CourseChapterName = res.Data getScrollCourseChapterName(msg).then(res => {
}) this.CourseChapterName = res.Data
})
}
} }
} }
}; };
......
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