Commit 18a23dab authored by 罗超's avatar 罗超

2

parent d6d85367
......@@ -73,7 +73,7 @@
color="accent"
size="xs"
label="确认"
v-if="saveObj.AppointState == 1&&saveObj.GuestList.length>=saveObj.ScrollMinNum"
v-if="saveObj.AppointState == 1&&saveObj.GuestList.length>=saveObj.ScrollMinNum&&auth.IsEdit"
@click="confirmSub"
class="q-ml-md"
/>
......@@ -110,7 +110,7 @@
v-if="saveObj.ClassType == 3"
>
<template v-slot:control>
<div v-if="saveObj.AppointState == 1">
<div v-if="saveObj.AppointState == 1&&auth.IsEdit">
<div class="q-mt-sm flex justify-start">
<q-btn
color="accent"
......@@ -179,6 +179,14 @@ export default {
saveObj: {
type: Object,
default: null
},
auth:{
type:Object,
default:()=>{
return {
IsEdit:false
}
}
}
},
data() {
......
......@@ -25,6 +25,7 @@
<Detail
:dateObj="dateObj"
:saveObj="saveObj"
:auth="auth"
@success="detailSuccessHandle"
@close="detailCloseHandle"
/>
......@@ -134,7 +135,7 @@
</q-field>
<div
class="row col"
v-show="(editType == 1 || saveObj.ClassType == 3) && showAddStu()"
v-show="(editType == 1 || saveObj.ClassType == 3)&&auth.IsEdit"
>
<div class="col-10">
<q-select
......@@ -231,10 +232,20 @@ export default {
teacherList: {
type: Array,
default: () => []
},
auth:{
type:Object,
default:()=>{
return {
IsEdit:false
}
}
}
},
watch: {
show(val) {
console.log(1111111)
this.addLoading = false
if (val) {
this.stuInfo = "";
this.teaClassMsg.CourseId = 0;
......@@ -350,6 +361,7 @@ export default {
this.teacherTimeList = res.Data;
});
},
//获取学生列表
getStu() {
this.stuMsg.CourseId = this.teaClassMsg.CourseId || 0;
this.stuMsg.CourseGradeId =
......@@ -361,7 +373,7 @@ export default {
this.allStuList = JSON.parse(JSON.stringify(res.Data));
});
},
//筛选学
//筛选学
filterStu(val, update) {
update(() => {
if (val === "") {
......@@ -518,17 +530,6 @@ export default {
this.addLoading = false;
});
},
showAddStu() {
if (
new Date(this.dateObj.date).getTime() <
new Date(QCalendar.today()).getTime()
) {
return false;
} else {
return true;
}
},
detailSuccessHandle() {
this.getStu();
this.$emit("success");
......
<template>
<div class="page-body" style="width: 100%;">
<div class="page-body">
<div class="col row wrap q-mr-lg q-col-gutter-md searchBox">
<div class="col-2">
<q-select
......@@ -86,7 +86,7 @@
emit-value
map-options
label="显示模式"
@input ="changeDate"
@input="changeDate"
/>
</div>
</div>
......@@ -109,124 +109,226 @@
@click="calendarNext"
/>
</div>
<q-calendar
v-model="selectedDate"
:view="viewType"
ref="calendar"
locale="zh-CN"
class="calendar-container"
style="height:calc(100% - 32px)"
bordered
hour24-format
:interval-start="8"
:interval-count="15"
:interval-height="60"
animated
transition-prev="slide-right"
transition-next="slide-left"
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
@input="onModelChanged"
@click:date2="onClickDate2"
@click:day:header2="onClickDayHeader2"
@click:interval2="onClickInterval2"
@click:time2="onClickTime2"
@click:interval:header2="onClickIntervalHeader2"
>
<template #day-header="{ timestamp }">
<div class="justify-center items-center " v-if="viewType == 'week'">
<q-badge
:color="item.bg"
:label="item.TeacherName"
v-for="(item, index) in legendList"
:key="index"
class="q-mr-xs"
/>
</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"
class="q-mr-xs"
/>
<!-- style="height:20px"
:style="{ width: `${(1 / legendList.length) * 100}%` }" -->
</div>
</template>
<div class="viewbox">
<q-calendar
v-model="selectedDate"
:view="viewType"
ref="calendar"
locale="zh-CN"
class="calendar-container "
bordered
hour24-format
:interval-start="8"
:interval-count="15"
:interval-height="60"
animated
transition-prev="slide-right"
transition-next="slide-left"
:weekdays="[1, 2, 3, 4, 5, 6, 0]"
@input="onModelChanged"
@click:date2="onClickDate2"
@click:day:header2="onClickDayHeader2"
@click:interval2="onClickInterval2"
@click:time2="onClickTime2"
@click:interval:header2="onClickIntervalHeader2"
>
<template #day-header="{ timestamp }">
<div v-if="viewType == 'week'">
<q-badge
:color="item.bg"
:label="item.TeacherName"
v-for="(item, index) in legendList"
:key="index"
class="q-mr-xs"
/>
</div>
<div class="flex no-wrap" 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 #day-body="{ timestamp, timeStartPos, timeDurationHeight }">
<div v-for="(item, index) in events" :key="index">
<div v-if="item.ClassDate == timestamp.date">
<div v-for="(_item, _index) in item.RList" :key="_index">
<div
v-for="(__item, __index) in _item.SubList"
:key="__index"
class="my-event justify-center ellipsis courseItem"
:class="badgeClasses(__item, 'body', _item.TeacherId)"
style="overflow:hidden;box-shadow: 0px 10px 10px 0 rgba(36, 36, 36, 0.2);"
:style="
badgeStyles(
__item,
'body',
timeStartPos,
timeDurationHeight,
_index,
item.RList.length
)
"
@click.stop="
showDetail(__item, item.ClassDate, _item.TeacherId)
"
>
<el-popover placement="top-start" width="200" trigger="hover">
<div slot="reference" style="height:80vh;position:relative">
<q-badge
rounded
color="red"
label="未成班"
style="position:absolute;top:0;right:0"
v-if="
viewType == 'day' &&
isShowTag(
__item.GuestList.length,
__item.ScrollMinNum
)
"
/>
<q-icon
name="lock"
color="res"
style="position:absolute;top:0;right:0"
v-if="
viewType == 'week' &&
<template #day-body="{ timestamp, timeStartPos, timeDurationHeight }">
<div v-for="(item, index) in events" :key="index">
<div v-if="item.ClassDate == timestamp.date">
<div v-for="(_item, _index) in item.RList" :key="_index">
<div
v-for="(__item, __index) in _item.SubList"
:key="__index"
class="my-event justify-center ellipsis courseItem"
:class="badgeClasses(__item, 'body', _item.TeacherId)"
style="overflow:hidden;box-shadow: 0px 10px 10px 0 rgba(36, 36, 36, 0.2);"
:style="
badgeStyles(
__item,
'body',
timeStartPos,
timeDurationHeight,
_index,
item.RList.length
)
"
@click.stop="
showDetail(__item, item.ClassDate, _item.TeacherId)
"
>
<el-popover placement="top-start" width="200" trigger="hover">
<div slot="reference" style="height:80vh;position:relative">
<q-badge
rounded
color="red"
label="未成班"
style="position:absolute;top:0;right:0"
v-if="
viewType == 'day' &&
isShowTag(
__item.GuestList.length,
__item.ScrollMinNum
)
"
/>
<q-icon
name="lock_open"
color="dark"
style="position:absolute;top:0;right:0"
v-if="
viewType == 'week' &&
isShowTag(
__item.GuestList.length,
__item.ScrollMinNum
)
"
/>
<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="flex no-wrap" v-if="__item.ClassType !== 2">
<span class="detailLabel">进度:</span
><span
>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span
>
</div>
<div class="row flex no-wrap">
<span class="detailLabel">课程:</span>
<div class="detailValue">{{ __item.CourseName }}</div>
</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" v-if="__item.ClassType !== 2">
<span class="detailLabel">进度:</span
><span
>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span
>
<span class="q-ml-sm">{{
__item.CourseGradeName
}}</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType !== 2">
<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"
style="color:#ef5350"
>待确认</span
><span
v-if="__item.AppointState == 2"
style="color:#21ba45"
>已确认</span
>
<q-btn
color="accent"
size="xs"
label="确认"
v-if="
__item.AppointState == 1 &&
__item.GuestList.length >=
__item.ScrollMinNum &&
auth.IsEdit
"
@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 style="position:relative">
<q-badge
rounded
color="red"
label="未成班"
style="position:absolute;top:0;right:0"
v-if="
isShowTag(
__item.GuestList.length,
__item.ScrollMinNum
)
"
/>
<div
v-if="viewType == 'day' || item.RList.length == 1"
class="q-pa-xs"
>
<!-- <div class="flex">
"
/>
<div class="flex">
<span class="detailLabel">老师:</span
><span>{{ _item.TeacherName }}</span>
</div> -->
</div>
<div class="flex">
<span class="detailLabel">教室:</span
>{{ __item.RoomName }}
</div>
<div class="flex no-wrap" v-if="__item.ClassType !== 2">
<span class="detailLabel">进度:</span
><span
>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span
>
</div>
<div class="row flex no-wrap">
<span class="detailLabel">课程:</span>
<div class="detailValue">{{ __item.CourseName }}</div>
<div class="flex no-wrap">
<span class="detailLabel">课程:</span
><span>{{ __item.CourseName }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel">班级:</span
......@@ -238,15 +340,6 @@
>{{ __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" v-if="__item.ClassType !== 2">
<span class="detailLabel">进度:</span
><span
......@@ -256,6 +349,13 @@
__item.CourseGradeName
}}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel"> 类型:</span
><span v-if="__item.ClassType == 1">跟班</span
><span v-if="__item.ClassType == 2">试听课</span
><span v-if="__item.ClassType == 3">约课</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType !== 2">
<span class="detailLabel">学员:</span
><span>{{
......@@ -278,7 +378,12 @@
color="accent"
size="xs"
label="确认"
v-if="__item.AppointState == 1&&__item.GuestList.length>=__item.ScrollMinNum"
v-if="
__item.AppointState == 1 &&
__item.GuestList.length >=
__item.ScrollMinNum &&
auth.IsEdit
"
@click="
confirmSub(
item.ClassDate,
......@@ -294,103 +399,25 @@
><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 style="position:relative">
<q-badge
rounded
color="red"
label="未成班"
style="position:absolute;top:0;right:0"
v-if="
isShowTag(__item.GuestList.length, __item.ScrollMinNum)
"
/>
<div class="flex">
<span class="detailLabel">老师:</span
><span>{{ _item.TeacherName }}</span>
</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" v-if="__item.ClassType !== 2">
<span class="detailLabel">进度:</span
><span>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span>
<span class="q-ml-sm">{{ __item.CourseGradeName }}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel"> 类型:</span
><span v-if="__item.ClassType == 1">跟班</span
><span v-if="__item.ClassType == 2">试听课</span
><span v-if="__item.ClassType == 3">约课</span>
</div>
<div class="flex no-wrap" v-if="__item.ClassType !== 2">
<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"
style="color:#ef5350"
>待确认</span
><span
v-if="__item.AppointState == 2"
style="color:#21ba45"
>已确认</span
>
<q-btn
color="accent"
size="xs"
label="确认"
v-if="__item.AppointState == 1&&__item.GuestList.length>=__item.ScrollMinNum"
@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>
</el-popover>
</div>
</el-popover>
</div>
</div>
</div>
</div>
</div>
</template>
</q-calendar>
</template>
</q-calendar>
</div>
<SubscribeForm
v-model="showForm"
:editType="editType"
:dateObj="dateObj"
:saveObj="saveObj"
:auth="auth"
:teacherList="TeacherList2"
@success="successHandle"
/>
......@@ -420,12 +447,11 @@ export default {
},
pickerOptions: {
disabledDate: time => {
// let timeRange = this.config.AppointDay * 24 * 60 * 60 * 1000;
// let timeRange = this.config.AppointDay * 24 * 60 * 60 * 1000;
// let _maxTime = Date.now() - 8.64e7 + timeRange; // 最大时间
// return (
// time.getTime() < Date.now() - 8.64e7 || time.getTime() > _maxTime
// );
// );
}
},
viewType: "week",
......@@ -505,7 +531,10 @@ export default {
TeacherList2: [],
events: [],
dateObj: {},
saveObj: {}
saveObj: {},
auth: {
IsEdit: false
}
};
},
components: {
......@@ -519,6 +548,15 @@ export default {
this.msg.EndDate = this.$refs.calendar.lastEnd;
this.getData();
this.getAppointmentConfig();
const ActionMenuList = JSON.parse(localStorage.getItem("loginUserInfo")).data.ActionMenuList
const res = ActionMenuList.find(e => {
return e.FunctionCode == "subscribe_edit";
});
if (res) {
this.auth.IsEdit = true;
} else {
this.auth.IsEdit = false;
}
},
methods: {
badgeClasses(event, type, TeacherId) {
......@@ -570,7 +608,7 @@ export default {
}, 100);
},
getTeacherList() {
getTeacherDropDownList({ LeaveStatus: 1,IsShow :1 }).then(res => {
getTeacherDropDownList({ LeaveStatus: 1, IsShow: 1 }).then(res => {
if (res.Code == 1) {
this.TeacherList = JSON.parse(JSON.stringify(res.Data));
var obj = {
......@@ -605,7 +643,19 @@ export default {
},
getData() {
GetAppointmentPlanStat(this.msg).then(res => {
this.events = res.Data;
// this.events = res.Data;
let data = JSON.parse(JSON.stringify(res.Data));
res.Data.map((e, i) => {
data[i].RList = [];
e.RList.map(x => {
this.legendList.map(y => {
if (y.TId == x.TeacherId) {
data[i].RList.push(x);
}
});
});
});
this.events = data;
});
},
changeDate() {
......@@ -637,10 +687,13 @@ export default {
onClickDayHeader2(data) {},
onClickInterval2(data) {},
onClickTime2(data) {
this.showForm = true;
this.editType = 1;
this.saveObj = {};
this.dateObj = data.scope.timestamp;
//小于今天,不显示弹窗
if (this.showAddStu(data.scope.timestamp.date) && this.auth.IsEdit) {
this.showForm = true;
this.editType = 1;
this.saveObj = {};
this.dateObj = data.scope.timestamp;
}
},
onClickIntervalHeader2(data) {},
showDetail(data, date, tid) {
......@@ -690,28 +743,33 @@ export default {
this.config = res.Data;
});
},
showAddStu(date) {
if (new Date(date).getTime() < new Date(QCalendar.today()).getTime()) {
return false;
} else {
return true;
}
}
}
};
</script>
<style lang="sass">
.calendar-container
position: relative
.my-event
// width: 100%
position: absolute
font-size: 12px
// .full-width
// left: 0
// width: 100%
// .left-side
// left: 0
// width: 49.75%
// .right-side
// left: 50.25%
// width: 49.75%
</style>
<style lang="scss">
.viewbox {
// width:1500px;
overflow-x: auto;
box-sizing: border-box;
}
.calendar-container {
position: relative;
// height: calc(100% - 32px);
// width: 200%;
overflow: auto;
}
.my-event {
position: absolute;
font-size: 12px;
}
.searchBox .el-input__inner {
border: none;
background-color: transparent;
......@@ -727,25 +785,6 @@ export default {
// padding: 3px;
height: 100%;
}
.courseItem::-webkit-scrollbar {
/*滚动条整体样式*/
width: 4px; /*高宽分别对应横竖滚动条的尺寸*/
height: 4px;
scrollbar-arrow-color: #999;
}
.courseItem::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: rgba(0, 0, 0, 0.2);
scrollbar-arrow-color: #999;
}
.courseItem::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 0;
background: rgba(0, 0, 0, 0.1);
}
.detailLabel {
width: 35px;
white-space: nowrap;
......
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