Commit e1f145ab authored by 罗超's avatar 罗超

2

parent 8140af14
<template>
<div>
<q-dialog
v-model="show"
persistent
transition-show="scale"
transition-hide="scale"
@input="changeDig"
>
<q-dialog v-model="show" persistent transition-show="scale" transition-hide="scale" @input="changeDig">
<q-card style="width: 800px;max-width:900px;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">{{ editType == 1 ? "新增约课" : "详情" }}</div>
......@@ -14,7 +8,7 @@
<q-btn icon="close" flat round dense @click="changeDig(false)" />
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row col q-mr-lg q-col-gutter-md" >
<div class="row col q-mr-lg q-col-gutter-md">
<q-field filled label="日期" stack-label class="col-12">
<template v-slot:control>
<div>{{ dateObj.date }}</div>
......@@ -22,33 +16,14 @@
</q-field>
<!-- 详情显示内容 start-->
<div class="col-12" v-if="editType == 2">
<Detail
:dateObj="dateObj"
:saveObj="saveObj"
:auth="auth"
@success="detailSuccessHandle"
@close="detailCloseHandle"
/>
<Detail :dateObj="dateObj" :saveObj="saveObj" :auth="auth" @success="detailSuccessHandle"
@close="detailCloseHandle" />
</div>
<!-- 详情显示内容 end -->
<q-select
filled
stack-label
use-input
option-value="CourseId"
option-label="CourseName"
v-model="teaClassMsg.CourseId"
ref="CourseId"
:options="CourseList"
label="课程"
:dense="false"
class="col-12"
emit-value
map-options
@filter="filterCourse"
@input="getCanTeacherTimeList(), getChapterTree(), changeCourse()"
v-if="editType == 1"
>
<q-select filled stack-label use-input option-value="CourseId" option-label="CourseName"
v-model="teaClassMsg.CourseId" ref="CourseId" :options="CourseList" label="课程" :dense="false"
class="col-12" emit-value map-options @filter="filterCourse"
@input="getCanTeacherTimeList(), getChapterTree(), changeCourse()" v-if="editType == 1">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -57,49 +32,19 @@
</q-item>
</template>
</q-select>
<select-tree
v-show="teaClassMsg.CourseId > 0 && editType == 1"
:treeData="chapterList"
:defaultArray="returnString"
nodeKey="ChapterId"
labelKey="ChapterName"
childrenKey="ChildList"
tipText="章节"
@getChild="getChapter"
class="col-12"
ref="selectTree"
></select-tree>
<select-tree v-show="teaClassMsg.CourseId > 0 && editType == 1" :treeData="chapterList"
:defaultArray="returnString" nodeKey="ChapterId" labelKey="ChapterName" childrenKey="ChildList"
tipText="章节" @getChild="getChapter" class="col-12" ref="selectTree"></select-tree>
<q-select
v-if="teaClassMsg.CourseId > 0 && editType == 1"
filled
v-model="teaClassMsg.TeacherId"
option-value="TId"
option-label="TeacherName"
:options="teacherList"
emit-value
map-options
label="老师"
class="col-12"
@input="getCanTeacherTimeList"
/>
<q-field
filled
label-slot
stack-label
class="col-12"
v-if="teaClassMsg.TeacherId > 0"
>
<q-select v-if="teaClassMsg.CourseId > 0 && editType == 1" filled v-model="teaClassMsg.TeacherId"
option-value="TId" option-label="TeacherName" :options="teacherList" emit-value map-options label="老师"
class="col-12" @input="getCanTeacherTimeList" />
<q-field filled label-slot stack-label class="col-12" v-if="teaClassMsg.TeacherId > 0">
<template #label>
<div class="row flex">
上课时段
<span
style="color:#f5576c;font-size:13px;margin-left:5px;font-weight:500"
>(按顺序选择)</span
>
<div
style="color:#333;font-size:13px;margin-left:10px;font-weight:500"
>
<span style="color:#f5576c;font-size:13px;margin-left:5px;font-weight:500">(按顺序选择)</span>
<div style="color:#333;font-size:13px;margin-left:10px;font-weight:500">
需选课时:{{ checkChapter.StudyMinutes }}分钟
</div>
</div>
......@@ -107,16 +52,10 @@
<template v-slot:control>
<div v-if="teacherTimeList.length > 0">
<div v-for="(item, index) in teacherTimeList" :key="index">
<div
v-if="
<div v-if="
item.CourseTimeList && item.CourseTimeList.length > 0
"
>
<div
v-for="(_item, _index) in item.CourseTimeList"
:key="_index"
class="timeItem"
>
">
<div v-for="(_item, _index) in item.CourseTimeList" :key="_index" class="timeItem">
<q-checkbox v-model="courseCheckList" :val="_item">
{{ item.SchoolName }} {{ item.RoomName }}
{{ _item.StartTime }}-{{ _item.EndTime }}
......@@ -133,29 +72,14 @@
</div>
</template>
</q-field>
<div
class="row col"
v-show="
<div class="row col" v-show="
(editType == 1 ||
(saveObj.ClassType == 3 && saveObj.AppointState == 1)) &&
auth.IsEdit&&showAddStu()
"
>
">
<div class="col-10">
<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-6"
@filter="filterStu"
>
<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-6" @filter="filterStu">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -166,48 +90,42 @@
</q-select>
</div>
<div class="col-2 q-pt-md">
<q-btn
size="sm"
color="accent"
label="添加"
@click="subscribeCourse"
:loading="addLoading"
class="q-ml-md"
:disable="!stuInfo.StuId || stuInfo.StuId <= 0"
/>
<q-btn size="sm" color="accent" label="添加" @click="subscribeCourse" :loading="addLoading"
class="q-ml-md" :disable="!stuInfo.StuId || stuInfo.StuId <= 0" />
</div>
</div>
<q-field filled label="已约学员" stack-label disable class="col-12" v-if="editType == 1&&addStuList.length>0">
<template v-slot:control>
<div v-for="(item,index) in addStuList" :key="index" class="q-mr-md">
{{ item }}
</div>
</template>
</q-field>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn
label="取消"
flat
color="grey-10"
style="font-weight:400 !important"
@click="changeDig(false)"
/>
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="changeDig(false)" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {
import {
GetCanTeacherClassTimeList,
GetCanAppointmentStuList,
SetAdminScrollAppointment
} from "../../../api/studyabroad/subscribe.js";
import {
} from "../../../api/studyabroad/subscribe.js";
import {
queryCourseDropdownList,
queryChapterTree
} from "../../../api/course/index";
import selectTree from "../../../components/common/select-tree";
import Detail from "./detail.vue";
import QCalendar from "@quasar/quasar-ui-qcalendar";
export default {
} from "../../../api/course/index";
import selectTree from "../../../components/common/select-tree";
import Detail from "./detail.vue";
import QCalendar from "@quasar/quasar-ui-qcalendar";
export default {
components: {
selectTree,
Detail
......@@ -249,6 +167,7 @@ export default {
watch: {
show(val) {
this.addLoading = false;
this.addStuList = []
if (val) {
this.stuInfo = "";
this.teaClassMsg.CourseId = 0;
......@@ -301,7 +220,8 @@ export default {
addLoading: false,
chapterList: [], //章节列表,
checkChapter: {}, //选择的章节
returnString: [] //章节默认值
returnString: [], //章节默认值
addStuList: [], //新增时展示用
};
},
mounted() {
......@@ -368,12 +288,12 @@ export default {
getStu() {
this.stuMsg.CourseId = this.teaClassMsg.CourseId || 0;
if (this.editType == 1) {
this.stuMsg.CourseGradeId = this.checkChapter.CourseRate||0;
this.stuMsg.NextChapterNo = this.checkChapter.ChapterNo||0;
this.stuMsg.CourseGradeId = this.checkChapter.CourseRate || 0;
this.stuMsg.NextChapterNo = this.checkChapter.ChapterNo || 0;
}
if (this.editType == 2) {
this.stuMsg.CourseGradeId = this.saveObj.CourseGradeId||0;
this.stuMsg.NextChapterNo = this.saveObj.Ranks||0;
this.stuMsg.CourseGradeId = this.saveObj.CourseGradeId || 0;
this.stuMsg.NextChapterNo = this.saveObj.Ranks || 0;
}
GetCanAppointmentStuList(this.stuMsg).then(res => {
......@@ -397,7 +317,9 @@ export default {
//获取章节
getChapterTree() {
if (this.teaClassMsg.CourseId == 0) return;
const msg = { CourseId: this.teaClassMsg.CourseId };
const msg = {
CourseId: this.teaClassMsg.CourseId
};
queryChapterTree(msg).then(res => {
this.chapterList = res.Data;
this.chapterList.forEach(e => {
......@@ -522,6 +444,9 @@ export default {
message: "操作成功",
position: "top"
});
if (this.editType == 1) {
this.addStuList.push(this.stuInfo.StuName)
}
if (this.editType == 2) {
this.saveObj.GuestList.push({
GuestName: this.stuInfo.StuName,
......@@ -553,46 +478,50 @@ export default {
}
}
}
};
};
</script>
<style>
.q-calendar-daily__day-interval:hover {
.q-calendar-daily__day-interval:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-weekly__workweek:hover {
.q-calendar-weekly__workweek:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-weekly__day:hover {
.q-calendar-weekly__day:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-weekly__head-weekday:hover {
.q-calendar-weekly__head-weekday:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-scheduler__day:hover {
.q-calendar-scheduler__day:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-resource__resource-interval:hover {
.q-calendar-resource__resource-interval:hover {
background: rgba(0, 0, 255, 0.1);
}
}
.q-calendar-daily__day:hover {
.q-calendar-daily__day:hover {
background: rgba(0, 0, 255, 0.1);
}
}
</style>
<style>
.upload-assiatant-box .q-uploader__list {
.upload-assiatant-box .q-uploader__list {
display: none;
}
}
.upload-assiatant-box .q-uploader {
.upload-assiatant-box .q-uploader {
width: auto;
}
.timeItem {
}
.timeItem {
margin: 10px 0;
}
}
</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