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,13 +109,13 @@
@click="calendarNext"
/>
</div>
<div class="viewbox">
<q-calendar
v-model="selectedDate"
:view="viewType"
ref="calendar"
locale="zh-CN"
class="calendar-container"
style="height:calc(100% - 32px)"
class="calendar-container "
bordered
hour24-format
:interval-start="8"
......@@ -133,7 +133,7 @@
@click:interval:header2="onClickIntervalHeader2"
>
<template #day-header="{ timestamp }">
<div class="justify-center items-center " v-if="viewType == 'week'">
<div v-if="viewType == 'week'">
<q-badge
:color="item.bg"
:label="item.TeacherName"
......@@ -142,16 +142,15 @@
class="q-mr-xs"
/>
</div>
<div class="justify-center items-center " v-if="viewType == 'day'">
<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"
class="q-mr-xs"
style="height:20px"
:style="{ width: `${(1 / legendList.length) * 100}%` }"
/>
<!-- style="height:20px"
:style="{ width: `${(1 / legendList.length) * 100}%` }" -->
</div>
</template>
......@@ -195,8 +194,8 @@
"
/>
<q-icon
name="lock"
color="res"
name="lock_open"
color="dark"
style="position:absolute;top:0;right:0"
v-if="
viewType == 'week' &&
......@@ -243,7 +242,9 @@
类型:<span></span
><span v-if="__item.ClassType == 1">跟班</span
><span v-if="__item.ClassType == 2">试听课</span
><span v-if="__item.ClassType == 3">约课</span></span
><span v-if="__item.ClassType == 3"
>约课</span
></span
>
</div>
......@@ -278,7 +279,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,
......@@ -306,7 +312,10 @@
label="未成班"
style="position:absolute;top:0;right:0"
v-if="
isShowTag(__item.GuestList.length, __item.ScrollMinNum)
isShowTag(
__item.GuestList.length,
__item.ScrollMinNum
)
"
/>
<div class="flex">
......@@ -327,12 +336,18 @@
</div>
<div class="flex no-wrap">
<span class="detailLabel">时间:</span
><span>{{ __item.StartTime }}-{{ __item.EndTime }}</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>
><span
>{{ __item.Ranks }}/{{ __item.TotalPlanNum }}</span
>
<span class="q-ml-sm">{{
__item.CourseGradeName
}}</span>
</div>
<div class="flex no-wrap">
<span class="detailLabel"> 类型:</span
......@@ -363,9 +378,18 @@
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, _item.TeacherId, __item)
confirmSub(
item.ClassDate,
_item.TeacherId,
__item
)
"
/>
</span>
......@@ -386,11 +410,14 @@
</div>
</template>
</q-calendar>
</div>
<SubscribeForm
v-model="showForm"
:editType="editType"
:dateObj="dateObj"
:saveObj="saveObj"
:auth="auth"
:teacherList="TeacherList2"
@success="successHandle"
/>
......@@ -420,7 +447,6 @@ export default {
},
pickerOptions: {
disabledDate: time => {
// let timeRange = this.config.AppointDay * 24 * 60 * 60 * 1000;
// let _maxTime = Date.now() - 8.64e7 + timeRange; // 最大时间
// return (
......@@ -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) {
//小于今天,不显示弹窗
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