Commit 73c168da authored by 罗超's avatar 罗超

2

parent 4d58c90d
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
> >
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
<q-card-section class="row items-center q-pb-none"> <q-card-section class="row items-center q-pb-none">
<div class="text-h6">{{ editType == 1 ? "新增" : "详情" }}</div> <div class="text-h6">{{ editType == 1 ? "新增约课" : "详情" }}</div>
<q-space /> <q-space />
<q-btn icon="close" flat round dense @click="changeDig(false)" /> <q-btn icon="close" flat round dense @click="changeDig(false)" />
</q-card-section> </q-card-section>
...@@ -20,32 +20,6 @@ ...@@ -20,32 +20,6 @@
<div>{{ dateObj.date }}</div> <div>{{ dateObj.date }}</div>
</template> </template>
</q-field> </q-field>
<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">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<!-- 详情显示内容 start--> <!-- 详情显示内容 start-->
<q-field <q-field
filled filled
...@@ -155,6 +129,14 @@ ...@@ -155,6 +129,14 @@
<span v-if="saveObj.AppointState == 1">待确认</span <span v-if="saveObj.AppointState == 1">待确认</span
><span v-if="saveObj.AppointState == 2">已确认</span> ><span v-if="saveObj.AppointState == 2">已确认</span>
</div> </div>
<q-btn
color="accent"
size="xs"
label="确认"
v-if="saveObj.AppointState == 1"
@click="confirmSub"
class="q-ml-md"
/>
</template> </template>
</q-field> </q-field>
<q-field <q-field
...@@ -194,7 +176,7 @@ ...@@ -194,7 +176,7 @@
size="xs" size="xs"
label="取消预约" label="取消预约"
@click="cancelSub()" @click="cancelSub()"
:disable="checkStuType2.length==0" :disable="checkStuType2.length == 0"
/> />
</div> </div>
...@@ -227,6 +209,32 @@ ...@@ -227,6 +209,32 @@
</template> </template>
</q-field> </q-field>
<!-- 详情显示内容 end --> <!-- 详情显示内容 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"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
<select-tree <select-tree
v-show="teaClassMsg.CourseId > 0 && editType == 1" v-show="teaClassMsg.CourseId > 0 && editType == 1"
:treeData="chapterList" :treeData="chapterList"
...@@ -304,9 +312,10 @@ ...@@ -304,9 +312,10 @@
</template> </template>
</q-field> </q-field>
<div <div
class="col-12" class="row col"
v-show="editType == 1 || saveObj.ClassType == 3" v-show="(editType == 1 || saveObj.ClassType == 3)&&showAddStu()"
> >
<div class="col-10">
<q-select <q-select
filled filled
stack-label stack-label
...@@ -316,7 +325,7 @@ ...@@ -316,7 +325,7 @@
v-model="stuInfo" v-model="stuInfo"
ref="CourseId" ref="CourseId"
:options="stuList" :options="stuList"
label="选择学员" label="添加学员"
:dense="false" :dense="false"
class="col-6" class="col-6"
@filter="filterStu" @filter="filterStu"
...@@ -330,49 +339,19 @@ ...@@ -330,49 +339,19 @@
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<div style="height:1px;background-color:#111"></div> </div>
<q-field filled label="学员列表" stack-label class="col-12"> <div class="col-2 q-pt-md">
<template v-slot:control>
<div class="q-gutter-sm">
<div
v-for="(item, index) in checkStuList"
:key="index"
class="q-my-sm"
>
<div class="row">
<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>
<q-btn <q-btn
size="xs" size="sm"
color="accent" color="accent"
label="添加" label="添加"
@click="subscribeCourse(item)" @click="subscribeCourse"
class="q-mr-md" class="q-ml-md"
/> :disable="!stuInfo.StuId || stuInfo.StuId <= 0"
<q-btn
size="xs"
color="accent"
label="取消"
@click="cancelStu(item, index)"
/> />
</div> </div>
</div> </div>
</div> </div>
</div>
</template>
</q-field>
</div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
...@@ -394,7 +373,8 @@ import { ...@@ -394,7 +373,8 @@ import {
GetCanTeacherClassTimeList, GetCanTeacherClassTimeList,
GetCanAppointmentStuList, GetCanAppointmentStuList,
SetAdminScrollAppointment, SetAdminScrollAppointment,
CancelAppointment CancelAppointment,
SetSureAppointment
} from "../../../api/studyabroad/subscribe.js"; } from "../../../api/studyabroad/subscribe.js";
import { import {
queryCourseDropdownList, queryCourseDropdownList,
...@@ -435,6 +415,7 @@ export default { ...@@ -435,6 +415,7 @@ export default {
watch: { watch: {
saveObj: { saveObj: {
handler(val) { handler(val) {
this.stuInfo = "";
if (this.editType == 2 && val.ClassType == 3) { if (this.editType == 2 && val.ClassType == 3) {
this.getStu(); this.getStu();
} }
...@@ -479,7 +460,7 @@ export default { ...@@ -479,7 +460,7 @@ export default {
chapterList: [], //章节列表, chapterList: [], //章节列表,
checkChapter: {}, //选择的章节 checkChapter: {}, //选择的章节
returnString: [], //章节默认值 returnString: [], //章节默认值
checkStuType2: [] // checkStuType2: [], //
}; };
}, },
mounted() { mounted() {
...@@ -562,36 +543,7 @@ export default { ...@@ -562,36 +543,7 @@ export default {
}); });
}, },
addStu() { addStu() {
if (this.stuInfo) { console.log(535, this.stuInfo);
this.checkStuList.push(this.stuInfo);
this.stuList.forEach(e => {
this.checkStuList.map(_e => {
if (e.StuId == _e.StuId) {
e.disable = true;
}
});
});
this.allStuList.forEach(e => {
this.checkStuList.map(_e => {
if (e.StuId == _e.StuId) {
e.disable = true;
}
});
});
}
},
cancelStu(item, index) {
this.checkStuList.splice(index, 1);
this.stuList.forEach(e => {
if (e.StuId == item.StuId) {
e.disable = false;
}
});
this.allStuList.forEach(e => {
if (e.StuId == item.StuId) {
e.disable = false;
}
});
}, },
//获取章节 //获取章节
getChapterTree() { getChapterTree() {
...@@ -628,31 +580,32 @@ export default { ...@@ -628,31 +580,32 @@ export default {
this.getStu(); this.getStu();
} }
}, },
subscribeCourse(stuInfo) { subscribeCourse() {
if ( if (
new Date(this.dateObj.date).getTime() < new Date(this.dateObj.date).getTime() <
new Date(QCalendar.today()).getTime() new Date(QCalendar.today()).getTime()
) { ) {
this.$q.notify({ this.$q.notify({
message: `日期小于今天请重新选择日期`, message: `日期小于今天,请重新选择日期`,
position: "top", position: "top",
type: "negative" type: "negative"
}); });
return; return;
} }
if (stuInfo.Date) { if (this.stuInfo.AppointDate) {
if ( if (
new Date(this.dateObj.date).getTime() < new Date(this.dateObj.date).getTime() <
new Date(stuInfo.Date).getTime() new Date(this.stuInfo.AppointDate).getTime()
) { ) {
this.$q.notify({ this.$q.notify({
message: `${stuInfo.StuName},不能预约${stuInfo.Date}之前的日期`, message: `${this.stuInfo.StuName},不能预约${this.stuInfo.AppointDate}之前的日期`,
position: "top", position: "top",
type: "negative" type: "negative"
}); });
return; return;
} }
} }
if (this.editType == 1) { if (this.editType == 1) {
if (this.courseCheckList.length === 0) { if (this.courseCheckList.length === 0) {
this.$q.notify({ this.$q.notify({
...@@ -690,13 +643,10 @@ export default { ...@@ -690,13 +643,10 @@ export default {
} }
} }
} }
}
if (this.editType == 1) {
this.saveMsg.Date = this.dateObj.date; this.saveMsg.Date = this.dateObj.date;
this.saveMsg.StuId = stuInfo.StuId; this.saveMsg.StuId = this.stuInfo.StuId;
this.saveMsg.StuName = stuInfo.StuName; this.saveMsg.StuName = this.stuInfo.StuName;
this.saveMsg.GuestId = stuInfo.GuestId; this.saveMsg.GuestId = this.stuInfo.GuestId;
this.saveMsg.CourseId = this.teaClassMsg.CourseId; this.saveMsg.CourseId = this.teaClassMsg.CourseId;
this.saveMsg.TeacherId = this.teaClassMsg.TeacherId; this.saveMsg.TeacherId = this.teaClassMsg.TeacherId;
this.saveMsg.ChapterNo = this.checkChapter.ChapterNo; this.saveMsg.ChapterNo = this.checkChapter.ChapterNo;
...@@ -704,9 +654,9 @@ export default { ...@@ -704,9 +654,9 @@ export default {
this.saveMsg.ShiftSort = newCourseCheckList.map(e => e.Sort).toString(); this.saveMsg.ShiftSort = newCourseCheckList.map(e => e.Sort).toString();
} else if (this.editType == 2) { } else if (this.editType == 2) {
this.saveMsg.Date = this.dateObj.date; this.saveMsg.Date = this.dateObj.date;
this.saveMsg.StuId = stuInfo.StuId; this.saveMsg.StuId = this.stuInfo.StuId;
this.saveMsg.StuName = stuInfo.StuName; this.saveMsg.StuName = this.stuInfo.StuName;
this.saveMsg.GuestId = stuInfo.GuestId; this.saveMsg.GuestId = this.stuInfo.GuestId;
this.saveMsg.CourseId = 0; this.saveMsg.CourseId = 0;
this.saveMsg.TeacherId = this.saveObj.Tid; this.saveMsg.TeacherId = this.saveObj.Tid;
this.saveMsg.ChapterNo = this.saveObj.Ranks; this.saveMsg.ChapterNo = this.saveObj.Ranks;
...@@ -717,14 +667,23 @@ export default { ...@@ -717,14 +667,23 @@ export default {
console.log(447, this.saveMsg); console.log(447, this.saveMsg);
SetAdminScrollAppointment(this.saveMsg).then(res => { SetAdminScrollAppointment(this.saveMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({
message: "预约成功",
position: "top"
});
this.getStu(); this.getStu();
if (this.editType == 2) { this.stuInfo = "";
this.$q
.dialog({
title: "预约成功",
message: "是否继续预约?",
cancel: "否",
ok: "是",
persistent: true
})
.onOk(() => {
// console.log(">>>> OK");
})
.onCancel(() => {
// console.log(">>>> Cancel");
this.changeDig(false); this.changeDig(false);
} });
this.$emit("success"); this.$emit("success");
} }
}); });
...@@ -746,6 +705,42 @@ export default { ...@@ -746,6 +705,42 @@ export default {
this.$emit("success"); this.$emit("success");
} }
}); });
},
//确认约课
confirmSub() {
if (this.saveObj.EnrollNum < this.saveObj.ScrollMinNum) {
this.$q.notify({
message: `最小开班人数为${this.saveObj.ScrollMinNum}`,
position: "top",
type: "negative"
});
return;
}
const msg = {
Date: this.dateObj.date,
TeacherId: this.saveObj.Tid,
ShiftSort: this.saveObj.ShiftSort
};
SetSureAppointment(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
message: "操作成功",
position: "top",
type: "positive"
});
this.$emit("success");
}
});
},
showAddStu() {
if (
new Date(this.dateObj.date).getTime() <
new Date(QCalendar.today()).getTime()
) {
return false;
}else{
return true
}
} }
} }
}; };
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
placeholder="开始日期" placeholder="开始日期"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change="getData"
> >
</el-date-picker> </el-date-picker>
</template> </template>
...@@ -128,7 +129,7 @@ ...@@ -128,7 +129,7 @@
@click:interval:header2="onClickIntervalHeader2" @click:interval:header2="onClickIntervalHeader2"
> >
<template #day-header="{ timestamp }"> <template #day-header="{ timestamp }">
<div class="justify-center items-center "> <div class="justify-center items-center " v-if="viewType == 'week'">
<q-badge <q-badge
:color="item.bg" :color="item.bg"
:label="item.TeacherName" :label="item.TeacherName"
...@@ -137,13 +138,21 @@ ...@@ -137,13 +138,21 @@
class="q-mr-xs" class="q-mr-xs"
/> />
</div> </div>
<div class="justify-center items-center " v-if="viewType == 'day'">
<q-badge
:color="item.bg"
:label="item.TeacherName"
v-for="(item, index) in legendList"
:key="index"
style="height:20px"
:style="{ width: `${(1 / legendList.length) * 100}%` }"
/>
</div>
</template> </template>
<template #day-body="{ timestamp, timeStartPos, timeDurationHeight }"> <template #day-body="{ timestamp, timeStartPos, timeDurationHeight }">
<div v-for="(item, index) in events" :key="index"> <div v-for="(item, index) in events" :key="index">
{{ item.ClassDate }}
<div v-if="item.ClassDate == timestamp.date"> <div v-if="item.ClassDate == timestamp.date">
{{ item.ClassDate }}
<div v-for="(_item, _index) in item.RList" :key="_index"> <div v-for="(_item, _index) in item.RList" :key="_index">
<div <div
v-for="(__item, __index) in _item.SubList" v-for="(__item, __index) in _item.SubList"
...@@ -160,28 +169,101 @@ ...@@ -160,28 +169,101 @@
item.RList.length item.RList.length
) )
" "
@click.stop="showDetail(__item, item.ClassDate,_item.TeacherId)" @click.stop="
showDetail(__item, item.ClassDate, _item.TeacherId)
"
> >
<div v-if="viewType == 'day' || item.RList.length == 1">
<div class="itemRow">{{ _item.TeacherName }}</div>
<div class="itemRow">{{ __item.CourseName }}</div>
<div>班级:{{ __item.ClassName }}</div>
<div>{{ __item.StartTime }}-{{ __item.EndTime }}</div>
<div>类型:{{ __item.ClassType }}</div>
<div>
进度:{{
__item.TotalPlanNum < 0 ? 0 : __item.TotalPlanNum
}}%
</div>
<div>学员名单:{{ __item.GuestList }}</div>
</div>
<el-popover <el-popover
placement="top-start" placement="top-start"
width="200" width="200"
trigger="hover" trigger="hover"
v-if="viewType == 'week' && item.RList.length > 1"
>
<div slot="reference" style="height:100vh">
<div
v-if="viewType == 'day' || item.RList.length == 1"
class="q-pa-xs"
>
<div class="flex">
<span class="detailLabel">老师:</span
><span>{{ _item.TeacherName }}</span>
</div>
<div class="flex">
<span class="detailLabel">教室:</span
>{{ __item.RoomName }}
</div>
<div class="row flex no-wrap">
<span class="detailLabel">课程:</span
><span style="flex-grow:1">{{
__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.CompleteProgress > 0
? __item.CompleteProgress
: 0
}}%</span
> >
<div slot="reference" style="height:100vh"></div> </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>
<q-btn
color="accent"
size="xs"
label="确认"
v-if="__item.AppointState == 1"
@click="
confirmSub(
item.ClassDate,
_item.TeacherId,
__item
)
"
/>
</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType == 3">
<span class="">最小成班人数:</span
><span>{{ __item.ScrollMinNum }}</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType == 3">
<span class="">最大成班人数:</span
><span>{{ __item.ScrollMaxNum }}</span>
</div>
<div></div>
</div>
</div>
<div> <div>
<div class="flex"> <div class="flex">
<span class="detailLabel">老师:</span <span class="detailLabel">老师:</span
...@@ -214,7 +296,13 @@ ...@@ -214,7 +296,13 @@
<div class="flex no-wrap"> <div class="flex no-wrap">
<span class="detailLabel">进度:</span <span class="detailLabel">进度:</span
><span>{{ __item.CompleteProgress>0?__item.CompleteProgress:0 }}%</span> ><span
>{{
__item.CompleteProgress > 0
? __item.CompleteProgress
: 0
}}%</span
>
</div> </div>
<div class="flex no-wrap"> <div class="flex no-wrap">
<span class="detailLabel">学员:</span <span class="detailLabel">学员:</span
...@@ -261,7 +349,7 @@ ...@@ -261,7 +349,7 @@
:dateObj="dateObj" :dateObj="dateObj"
:saveObj="saveObj" :saveObj="saveObj"
:teacherList="TeacherList2" :teacherList="TeacherList2"
@success="saveObj={},getData" @success="successHandle"
/> />
</div> </div>
</template> </template>
...@@ -471,7 +559,6 @@ export default { ...@@ -471,7 +559,6 @@ export default {
getData() { getData() {
GetAppointmentPlanStat(this.msg).then(res => { GetAppointmentPlanStat(this.msg).then(res => {
this.events = res.Data; this.events = res.Data;
console.log(498, this.events);
}); });
}, },
calcGap(s, e) { calcGap(s, e) {
...@@ -514,13 +601,13 @@ export default { ...@@ -514,13 +601,13 @@ export default {
onClickIntervalHeader2(data) { onClickIntervalHeader2(data) {
console.log(6, data); console.log(6, data);
}, },
showDetail(data, date,tid) { showDetail(data, date, tid) {
console.log(7, data); console.log(7, data);
this.showForm = true; this.showForm = true;
this.editType = 2; this.editType = 2;
this.dateObj.date = date; this.dateObj.date = date;
this.saveObj = data; this.saveObj = data;
this.saveObj.Tid=tid this.saveObj.Tid = tid;
}, },
confirmSub(date, id, item) { confirmSub(date, id, item) {
if (item.EnrollNum < item.ScrollMinNum) { if (item.EnrollNum < item.ScrollMinNum) {
...@@ -543,9 +630,13 @@ export default { ...@@ -543,9 +630,13 @@ export default {
position: "top", position: "top",
type: "positive" type: "positive"
}); });
this.getData() this.getData();
} }
}); });
},
successHandle() {
this.saveObj = {};
this.getData();
} }
} }
}; };
......
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