Commit 51b7815f authored by 罗超's avatar 罗超

22

parent a75ba11d
<template> <template>
<div>
<q-dialog <q-dialog
v-model="show" v-model="show"
content-class="bg-grey-1"
persistent persistent
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
@input="changeDig" @input="changeDig"
> >
<!-- content-class="bg-grey-1" -->
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
<q-card-section> <q-card-section>
<div class="text-h6">编辑</div> <div class="text-h6">编辑</div>
...@@ -33,10 +34,24 @@ ...@@ -33,10 +34,24 @@
emit-value emit-value
map-options map-options
@filter="filterCourse" @filter="filterCourse"
@input="getCanTeacherClassTimeList(),getStu()" @input="getCanTeacherTimeList(), getStu(), getChapterTree()"
/> />
<q-field filled label="章节" stack-label class="col-12">
<template v-slot:control>
<select-tree
:treeData="chapterList"
:defaultArray="returnString"
nodeKey="ChapterId"
labelKey="ChapterName"
childrenKey="ChildList"
tipText="课程系列"
@getChild="getChild"
></select-tree>
</template>
</q-field>
<q-select <q-select
v-if="teaClassMsg.CourseId>0" v-if="teaClassMsg.CourseId > 0"
filled filled
v-model="teaClassMsg.TeacherId" v-model="teaClassMsg.TeacherId"
option-value="TId" option-value="TId"
...@@ -46,15 +61,75 @@ ...@@ -46,15 +61,75 @@
map-options map-options
label="老师" label="老师"
class="col-12" class="col-12"
@input="getCanTeacherClassTimeList()" @input="getCanTeacherTimeList()"
/> />
<q-field filled label="上课时段" stack-label class="col-12" v-if="teaClassMsg.TeacherId>0"> <q-field
filled
label="上课时段"
stack-label
class="col-12"
v-if="teaClassMsg.TeacherId > 0"
>
<template v-slot:control> <template v-slot:control>
<div v-if="teacherTimeList.length > 0">
<div v-for="(item, index) in teacherTimeList" :key="index">
<div> <div>
<!-- {{ teacherTimeList }} --> <div
<div v-for="(item,index) in teacherTimeList" :key="index"> v-for="(_item, _index) in item.CourseTimeList"
<div v-for="(_item,_index) in item.CourseTimeList" :key="_index" class="timeItem"> :key="_index"
{{item.SchoolName}} {{item.RoomName}} {{ _item.StartTime }}-{{_item.EndTime}} class="timeItem"
>
<q-checkbox v-model="courseCheckList" :val="_item">
{{ item.SchoolName }} {{ item.RoomName }}
{{ _item.StartTime }}-{{ _item.EndTime }}
</q-checkbox>
</div>
</div>
</div>
</div>
<div v-else>
暂无可约课程
</div>
</template>
</q-field>
{{ courseCheckList }}
<q-field
filled
label="学生列表"
stack-label
class="col-12"
v-if="teaClassMsg.CourseId > 0 && stuList.length > 0"
>
<template v-slot:control>
<div class="q-gutter-sm">
<div
v-for="(item, index) in checkStuList"
:key="index"
class="q-my-sm"
>
<div>
<span>
{{ item.StuName }}
</span>
<span> 当前课章节:{{ item.CourseChapterNo }}</span>
<span> 下次课章节:{{ item.NextChapterNo }}</span>
<span> 已约次数:{{ item.AppointNum }}</span>
<span v-if="item.AppointDate">
已约至:{{ item.AppointDate }}
</span>
</div>
</div>
<div class="full-width">
<div @click="showAddStu">
<q-chip
icon="add"
label="添加学员"
color="primary"
text-color="white"
size="sm"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -82,6 +157,52 @@ ...@@ -82,6 +157,52 @@
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
<q-dialog
v-model="showStu"
persistent
content-class="bg-grey-1"
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 600px;max-width:600px;">
<q-card-section>
<div class="text-h6">选择学员</div>
</q-card-section>
<q-card-section>
<q-select
filled
stack-label
use-input
option-value="StuId"
option-label="StuName"
v-model="stuInfo"
ref="CourseId"
:options="stuList"
label="选择学员"
:dense="false"
class="col-12"
@filter="filterStu"
/>
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn
label="取消"
flat
color="grey-10"
style="font-weight:400 !important"
@click="showStu = false"
/>
<q-btn
label="添加"
color="accent"
class="q-px-md"
style="font-weight:400 !important"
@click="addStu"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template> </template>
<script> <script>
import { import {
...@@ -90,8 +211,15 @@ import { ...@@ -90,8 +211,15 @@ import {
GetStuAppointmentInfo, GetStuAppointmentInfo,
SetAdminScrollAppointment SetAdminScrollAppointment
} from "../../../api/studyabroad/subscribe.js"; } from "../../../api/studyabroad/subscribe.js";
import { queryCourseDropdownList } from "../../../api/course/index"; import {
queryCourseDropdownList,
queryChapterTree
} from "../../../api/course/index";
import selectTree from "../../../components/common/select-tree";
export default { export default {
components: {
selectTree
},
model: { model: {
prop: "show", prop: "show",
event: "changeshow" event: "changeshow"
...@@ -133,6 +261,7 @@ export default { ...@@ -133,6 +261,7 @@ export default {
CourseId: 0 CourseId: 0
}, },
stuList: [], stuList: [],
allStuList: [],
stuMsg: { stuMsg: {
CourseId: 0, CourseId: 0,
NextChapterNo: 0 NextChapterNo: 0
...@@ -150,7 +279,13 @@ export default { ...@@ -150,7 +279,13 @@ export default {
GuestId: 0, GuestId: 0,
CourseId: 0, CourseId: 0,
ChapterNo: 0 ChapterNo: 0
} },
showStu: false,
stuInfo: "",
checkStuList: [],
courseCheckList: [],
chapterList: [],
returnString: [], //默认值
}; };
}, },
created() {}, created() {},
...@@ -180,35 +315,87 @@ export default { ...@@ -180,35 +315,87 @@ export default {
}); });
}, },
//筛选课程 //筛选课程
filterCourse(val, update) { filterStu(val, update) {
update(() => { update(() => {
if (val === "") { if (val === "") {
this.CourseList = JSON.parse(JSON.stringify(this.AllCourseList)); this.CourseList = JSON.parse(JSON.stringify(this.AllCourseList));
} else { } else {
const needle = val.toLowerCase(); const needle = val.toLowerCase();
this.CourseList = this.AllCourseList.filter( this.CourseList = this.AllCourseList.filter(
v => v.CourseName.toLowerCase().indexOf(needle) > -1 v => v.StuName.toLowerCase().indexOf(needle) > -1
); );
} }
}); });
}, },
//获取老师的空闲上课时段 //获取老师的空闲上课时段
getCanTeacherClassTimeList() { getCanTeacherTimeList() {
this.teaClassMsg.Date=this.dateObj.date this.teaClassMsg.Date = this.dateObj.date;
if(this.teaClassMsg.TeacherId==0) return if (this.teaClassMsg.TeacherId == 0) return;
GetCanTeacherClassTimeList(this.teaClassMsg).then(res=>{ GetCanTeacherClassTimeList(this.teaClassMsg).then(res => {
console.log(187,res) console.log(187, res);
this.teacherTimeList=res.Data this.teacherTimeList = res.Data;
}); });
}, },
getStu(){ getStu() {
this.stuMsg.CourseId=this. this.stuMsg.CourseId = this.teaClassMsg.CourseId;
GetCanAppointmentStuList(this.stuMsg).then(res=>{ GetCanAppointmentStuList(this.stuMsg).then(res => {
console.log(199,res) console.log(199, res);
}) this.stuList = JSON.parse(JSON.stringify(res.Data));
this.allStuList = JSON.parse(JSON.stringify(res.Data));
});
},
//筛选学员
filterCourse(val, update) {
update(() => {
if (val === "") {
this.stuList = JSON.parse(JSON.stringify(this.allStuList));
} else {
const needle = val.toLowerCase();
this.stuList = this.allStuList.filter(
v => v.CourseName.toLowerCase().indexOf(needle) > -1
);
}
});
},
getStuDetail(item) {
const msg = {
StuId: item.StuId,
GuestId: item.GuestId
};
console.log(msg);
return;
GetStuAppointmentInfo(msg).then(res => {
console.log(res);
});
},
showAddStu() {
this.showStu = true;
this.stuInfo = "";
},
addStu() {
this.showStu = false;
if (this.stuInfo) {
console.log(this.stuInfo);
this.checkStuList.push(this.stuInfo);
} }
}, },
//获取章节
getChapterTree() {
if (this.teaClassMsg.CourseId == 0) return;
const msg = { CourseId: this.teaClassMsg.CourseId };
queryChapterTree(msg).then(res => {
console.log(387, res);
this.chapterList=res.Data
});
},
//章节选择
getChild(data) {
console.log(data)
},
},
watch: {} watch: {}
}; };
</script> </script>
...@@ -249,7 +436,7 @@ export default { ...@@ -249,7 +436,7 @@ export default {
.upload-assiatant-box .q-uploader { .upload-assiatant-box .q-uploader {
width: auto; width: auto;
} }
.timeItem{ .timeItem {
margin: 10px 0; margin: 10px 0;
} }
</style> </style>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
emit-value emit-value
map-options map-options
label="老师" label="老师"
@input="getData"
/> />
</div> </div>
<div class="col-2"> <div class="col-2">
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
emit-value emit-value
map-options map-options
label="教室" label="教室"
@input="getData"
/> />
</div> </div>
<div class="col-2"> <div class="col-2">
...@@ -38,6 +40,7 @@ ...@@ -38,6 +40,7 @@
emit-value emit-value
map-options map-options
label="课程类型" label="课程类型"
@input="getData"
/> />
</div> </div>
<div class="col-2"> <div class="col-2">
...@@ -51,13 +54,14 @@ ...@@ -51,13 +54,14 @@
emit-value emit-value
map-options map-options
label="约课状态" label="约课状态"
@input="getData"
/> />
</div> </div>
<!-- <div class="col-2"> <div class="col-2">
<q-field filled dense label="开始日期" stack-label> <q-field filled dense label="选择日期" stack-label>
<template v-slot:control> <template v-slot:control>
<el-date-picker <el-date-picker
v-model="msg.StartDate" v-model="selectedDate"
type="date" type="date"
size="mini" size="mini"
placeholder="开始日期" placeholder="开始日期"
...@@ -68,21 +72,6 @@ ...@@ -68,21 +72,6 @@
</template> </template>
</q-field> </q-field>
</div> </div>
<div class="col-2">
<q-field filled dense label="结束日期" stack-label>
<template v-slot:control>
<el-date-picker
v-model="msg.EndDate"
type="date"
size="mini"
placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
>>
</el-date-picker>
</template>
</q-field>
</div> -->
<div class="col-2"> <div class="col-2">
<q-select <q-select
filled filled
...@@ -97,10 +86,24 @@ ...@@ -97,10 +86,24 @@
/> />
</div> </div>
</div> </div>
<div class="row justify-center items-center"> <div class="row justify-center items-center q-mt-sm">
<q-btn dense flat label="上一周" @click="calendarPrev" /> <q-btn
dense
text-color="primary"
flat
unelevated
:label="viewType == 'day' ? '上一天' : '上一周'"
@click="calendarPrev"
/>
<q-separator vertical /> <q-separator vertical />
<q-btn dense flat label="下一周" @click="calendarNext" /> <q-btn
dense
text-color="primary"
flat
unelevated
:label="viewType == 'day' ? '下一天' : '下一周'"
@click="calendarNext"
/>
</div> </div>
<q-calendar <q-calendar
v-model="selectedDate" v-model="selectedDate"
...@@ -147,7 +150,6 @@ ...@@ -147,7 +150,6 @@
:key="__index" :key="__index"
class="my-event justify-center ellipsis courseItem" class="my-event justify-center ellipsis courseItem"
:class="badgeClasses(__item, 'body', _item.TeacherId)" :class="badgeClasses(__item, 'body', _item.TeacherId)"
style="overflow:auto"
:style=" :style="
badgeStyles( badgeStyles(
__item, __item,
...@@ -160,28 +162,84 @@ ...@@ -160,28 +162,84 @@
" "
@click.stop="showDetail(__item)" @click.stop="showDetail(__item)"
> >
<div v-if="viewType == 'day'"> <div v-if="viewType == 'day' || item.RList.length == 1">
<div class="itemRow">{{ _item.TeacherName }}</div> <div class="itemRow">{{ _item.TeacherName }}</div>
<div class="itemRow">{{ __item.CourseName }}</div> <div class="itemRow">{{ __item.CourseName }}</div>
<div>{{ __item.ClassName }}</div> <div>班级:{{ __item.ClassName }}</div>
<div>{{ __item.StartTime }}-{{ __item.EndTime }}</div> <div>{{ __item.StartTime }}-{{ __item.EndTime }}</div>
<div>类型:{{ __item.ClassType }}</div>
<div> <div>
进度:{{ 进度:{{
__item.TotalPlanNum < 0 ? 0 : __item.TotalPlanNum __item.TotalPlanNum < 0 ? 0 : __item.TotalPlanNum
}}% }}%
</div> </div>
<div>学员名单:{{ __item.GuestList }}</div>
</div> </div>
<el-popover placement="top-start" width="200" trigger="hover" v-if="viewType == 'week'"> <el-popover
placement="top-start"
width="200"
trigger="hover"
v-if="viewType == 'week' && item.RList.length > 1"
>
<div slot="reference" style="height:100vh"></div> <div slot="reference" style="height:100vh"></div>
<div> <div>
<div class="itemRow">{{ _item.TeacherName }}</div> <div class="flex">
<div class="itemRow">{{ __item.CourseName }}</div> <span class="detailLabel">老师:</span
<div>{{ __item.ClassName }}</div> ><span>{{ _item.TeacherName }}</span>
<div>{{ __item.StartTime }}-{{ __item.EndTime }}</div> </div>
<div class="flex">
<span class="detailLabel">教室:</span
>{{ __item.RoomName }}
</div>
<div class="flex no-wrap">
<span class="detailLabel">课程:</span
><span>{{ __item.CourseName }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel">班级:</span
><span>{{ __item.ClassName }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel">时间:</span
><span>{{ __item.StartTime }}-{{ __item.EndTime }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel">
类型:<span></span
><span v-if="__item.ClassType == 1">跟班</span
><span v-if="__item.ClassType == 2">试听课</span
><span v-if="__item.ClassType == 3">约课</span></span
>
</div>
<div class="flex no-wrap">
<span class="detailLabel">进度:</span
><span>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel">学员:</span
><span>{{
__item.GuestList.map(e => e.GuestName).toString()
}}</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType == 3">
<span class="detailLabel">
预约状态:<span></span
><span v-if="__item.AppointState == 1">待确认</span
><span v-if="__item.AppointState == 2">已确认</span
></span
>
</div>
<div class="flex no-wrap">
<span class="">最小成班人数:</span
><span>{{ __item.ScrollMinNum }}</span>
</div>
<div class="flex no-wrap">
<span class="">最大成班人数:</span
><span>{{ __item.ScrollMaxNum }}</span>
</div>
<div> <div>
进度:{{
__item.TotalPlanNum < 0 ? 0 : __item.TotalPlanNum
}}%
</div> </div>
</div> </div>
</el-popover> </el-popover>
...@@ -201,13 +259,14 @@ ...@@ -201,13 +259,14 @@
<script> <script>
import { GetAppointmentPlanStat } from "../../api/studyabroad/subscribe.js"; import { GetAppointmentPlanStat } from "../../api/studyabroad/subscribe.js";
import {queryChapterTree} from "../../api/course/index";
import { date } from "quasar"; import { date } from "quasar";
import { import {
getTeacherDropDownList, getTeacherDropDownList,
queryClassRoomList queryClassRoomList
} from "../../api/school/index"; } from "../../api/school/index";
import SubscribeForm from "../../components/stuMan/subscribe/subscribeForm"; import SubscribeForm from "../../components/stuMan/subscribe/subscribeForm";
// import QCalendar from "@quasar/quasar-ui-qcalendar"; import QCalendar from "@quasar/quasar-ui-qcalendar";
export default { export default {
data() { data() {
...@@ -305,6 +364,7 @@ export default { ...@@ -305,6 +364,7 @@ export default {
}, },
mounted() { mounted() {
// console.log(336, this.$refs.calendar); // console.log(336, this.$refs.calendar);
this.selectedDate = QCalendar.today();
this.getTeacherList(); this.getTeacherList();
this.getclassroom(); this.getclassroom();
this.msg.StartDate = this.$refs.calendar.lastStart; this.msg.StartDate = this.$refs.calendar.lastStart;
...@@ -492,4 +552,8 @@ export default { ...@@ -492,4 +552,8 @@ export default {
border-radius: 0; border-radius: 0;
background: rgba(0, 0, 0, 0.1); background: rgba(0, 0, 0, 0.1);
} }
.detailLabel {
width: 40px;
white-space: nowrap;
}
</style> </style>
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