Commit 776ffde1 authored by zhengke's avatar zhengke

修改

parent ec387072
...@@ -556,3 +556,15 @@ export function propertyGetPageList(data) { ...@@ -556,3 +556,15 @@ export function propertyGetPageList(data) {
data data
}); });
} }
/**
* 保存调课申请单
*/
export function SetChangeClassPlan(data) {
return request({
url: '/ChangePlan/SetChangeClassPlan',
method: 'post',
data
});
}
<style>
.common_Style {
display: inline-block;
width: 30px;
height: 30px;
border-radius: 50%;
text-align: center;
line-height: 30px;
}
.classForm_monday {
background-color: #ced9f8;
color: #2961FE;
}
.classForm_tuesday {
background-color: #d9f3ff;
color: #3FC4FF;
}
.classForm_wednesday {
background-color: #f6e2cb;
color: #F28C1D;
}
.classForm_thursday {
background-color: #ccf3eb;
color: #02C499;
}
.classForm_friday {
background-color: #f7cfd6;
color: #F72E52;
}
.classForm_saturday {
background-color: #fff5cc;
color: #FFCC00;
}
.classForm_sunday {
background-color: #e6e3fe;
color: #8175FB;
}
.planTimeLi tbody::before {
content: '';
display: table-row;
height: 20px;
}
</style>
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
...@@ -10,15 +62,14 @@ ...@@ -10,15 +62,14 @@
<div class="text-caption q-mb-lg q-px-md text-grey-6">基本资料</div> <div class="text-caption q-mb-lg q-px-md text-grey-6">基本资料</div>
<div class="row q-col-gutter-lg"> <div class="row q-col-gutter-lg">
<!--<q-select filled stack-label option-value="SId" option-label="SName" v-model="msg.classId" ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6" emit-value map-options @input="schoolChagne" />--> <!--<q-select filled stack-label option-value="SId" option-label="SName" v-model="msg.classId" ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6" emit-value map-options @input="schoolChagne" />-->
<q-select filled stack-label option-value="SId" option-label="SName" v-model="msg.SchoolId" <q-select filled stack-label option-value="SId" option-label="SName" v-model="msg.SchoolId" ref="School_Id"
ref="School_Id" :options="schoolList" label="校区" :dense="false" class="col-6" emit-value :options="schoolList" label="校区" :dense="false" class="col-6" emit-value map-options
map-options @input="changeSchool" /> @input="changeSchool" />
<q-select filled stack-label option-value="CourseId" option-label="CourseName" <q-select filled stack-label option-value="CourseId" option-label="CourseName" v-model="msg.CouseId"
v-model="msg.CouseId" ref="CouseId" :options="courseList" label="关联课程" :dense="false" ref="CouseId" :options="courseList" label="关联课程" :dense="false" class="col-6" emit-value map-options
class="col-6" emit-value map-options @input="changeCourse" /> @input="changeCourse" />
<q-select standout="bg-dark text-white" option-value="ClassId" option-label="ClassName" <q-select filled stack-label option-value="ClassId" option-label="ClassName" v-model="msg.ClassId"
v-model="msg.ClassId" :options="classList" @input="changeClass" emit-value map-options :options="classList" @input="changeClass" emit-value map-options label="班级" class="col-6">
label="班级" class="col-6">
<template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }"> <template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }">
<q-item v-bind="itemProps" v-on="itemEvents"> <q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section> <q-item-section>
...@@ -38,16 +89,16 @@ ...@@ -38,16 +89,16 @@
<div class="text-caption q-my-lg q-px-md text-grey-6 col">变更内容 注意:需要对变更的内容进行打钩</div> <div class="text-caption q-my-lg q-px-md text-grey-6 col">变更内容 注意:需要对变更的内容进行打钩</div>
<div class="row items-center"> <div class="row items-center">
<div class="text-grey-6">变更范围:</div> <div class="text-grey-6">变更范围:</div>
<q-radio size="xs" v-model="msg.SettingType" val="1" label="单个或多个" /> <q-radio size="xs" v-model="msg.MoveType" val="1" label="单个或多个" />
<q-radio size="xs" v-model="msg.SettingType" val="2" label="全局" /> <q-radio size="xs" v-model="msg.MoveType" val="2" label="全局" />
</div> </div>
</div> </div>
<div v-if="msg.SettingType=='1'" class="row items-center"> <div v-if="msg.MoveType=='1'" class="row items-center">
<div class="col"> <div class="col">
<q-table no-data-label="暂无相关数据" flat style="max-height: 300px;" :pagination="pages" <q-table no-data-label="暂无相关数据" flat style="max-height: 300px;" :pagination="pages"
class="sticky-column-table sticky-header-column-table" separator="none" class="sticky-column-table sticky-header-column-table" separator="none" :data="currentClass"
:data="currentClass" :columns="msg.ChangeType==1?columns:columns2" :columns="msg.ChangeType==1?columns:columns2" row-key="ClassPlanId" selection="multiple"
row-key="ClassPlanId" selection="multiple" :selected.sync="selected"> :selected.sync="selected">
<template v-slot:body-cell-TimeList="props"> <template v-slot:body-cell-TimeList="props">
<q-td auto-width :props="props"> <q-td auto-width :props="props">
...@@ -61,13 +112,8 @@ ...@@ -61,13 +112,8 @@
{{props.row.NewPlan.ClassDate}} {{props.row.NewPlan.ClassDate}}
<q-popup-edit v-model="props.row.NewPlan.ClassDate" title="变更日期" persistent buttons label-set="确认" <q-popup-edit v-model="props.row.NewPlan.ClassDate" title="变更日期" persistent buttons label-set="确认"
label-cancel="取消"> label-cancel="取消">
<el-date-picker <el-date-picker v-model="props.row.NewPlan.ClassDate" type="date" :picker-options="pickerOptions"
v-model="props.row.NewPlan.ClassDate" :clearable="false" value-format="yyyy-MM-dd" placeholder="选择日期">
type="date"
:picker-options="pickerOptions"
:clearable="false"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker> </el-date-picker>
</q-popup-edit> </q-popup-edit>
</q-td> </q-td>
...@@ -77,35 +123,33 @@ ...@@ -77,35 +123,33 @@
<div v-for="(item,index) in props.row.NewPlan.TimeList" class="lessForm_Class"> <div v-for="(item,index) in props.row.NewPlan.TimeList" class="lessForm_Class">
{{index+1}}节课 {{item.StartTime}}-{{item.EndTime}} {{index+1}}节课 {{item.StartTime}}-{{item.EndTime}}
</div> </div>
<q-popup-edit :validate="proteinRangeValidation" persistent v-model="props.row.NewPlan.TimeList" title="变更时间" buttons label-set="确认" <q-popup-edit :validate="proteinRangeValidation" persistent v-model="props.row.NewPlan.TimeList"
label-cancel="取消"> title="变更时间" buttons label-set="确认" label-cancel="取消">
<div v-for="(item,index) in props.row.NewPlan.TimeList" class="q-mb-md row items-center" style="width:430px"> <div v-for="(item,index) in props.row.NewPlan.TimeList" class="q-mb-md row items-center"
style="width:430px">
<div class="lessForm_Class col"> <div class="lessForm_Class col">
{{index+1}}节课 {{index+1}}节课
</div> </div>
<div class="row items-center"> <div class="row items-center">
<el-time-select <el-time-select placeholder="起始时间" v-model="item.StartTime" style="width:100px"
placeholder="起始时间"
v-model="item.StartTime"
style="width:100px"
:picker-options="pickers"> :picker-options="pickers">
</el-time-select> </el-time-select>
<el-time-select <el-time-select placeholder="结束时间" v-model="item.EndTime"
placeholder="结束时间" style="width:100px;margin-left:12px;" :picker-options="{
v-model="item.EndTime"
style="width:100px;margin-left:12px;"
:picker-options="{
start: '09:00', start: '09:00',
step: '00:15', step: '00:15',
end: '22:30', end: '22:30',
minTime: item.StartTime minTime: item.StartTime
}"> }">
</el-time-select> </el-time-select>
<q-input filled v-model="item.TimeHour" size="xs" mask="#.#" fill-mask="0.0" label="有效课时" suffix="课时" style="width:100px;margin-left:12px" /> <q-input filled v-model="item.TimeHour" size="xs" mask="#.#" fill-mask="0.0" label="有效课时"
<q-btn v-if="props.row.NewPlan.TimeList.length>1" round color="negative" class="q-ml-md" size="xs" icon="iconfont icon-guanbi1" @click="removeTime(props.row.NewPlan,index)"></q-btn> suffix="课时" style="width:100px;margin-left:12px" />
<q-btn v-if="props.row.NewPlan.TimeList.length>1" round color="negative" class="q-ml-md"
size="xs" icon="iconfont icon-guanbi1" @click="removeTime(props.row.NewPlan,index)"></q-btn>
</div> </div>
</div> </div>
<q-btn round color="primary" size="xs" icon="iconfont icon-img_haha" @click="addTime(props.row.NewPlan)"></q-btn> <q-btn round color="primary" size="xs" icon="iconfont icon-img_haha"
@click="addTime(props.row.NewPlan)"></q-btn>
</q-popup-edit> </q-popup-edit>
</q-td> </q-td>
</template> </template>
...@@ -114,12 +158,156 @@ ...@@ -114,12 +158,156 @@
</div> </div>
</div> </div>
<div v-if="msg.ChangeType==1&&msg.MoveType==2">
<div class="row">
<q-input filled v-model="msg.AllChangePlanItem.OpenTimeStr" class="col-6 q-pr-lg q-pb-lg" mask="date" label="开班时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy1" transition-show="scale" transition-hide="scale">
<q-date v-model="msg.AllChangePlanItem.OpenTimeStr" @input="() => $refs.qDateProxy1.hide()" />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-select filled stack-label option-value="Id" option-label="Name" v-model="msg.AllChangePlanItem.ClassStyle"
ref="ClassStyle" :options="classSetList" label="排课安排" :dense="false" class="col-6 q-pr-lg q-pb-lg"
emit-value map-options @input="changeClassStyle(msg.AllChangePlanItem.ClassStyle)" />
</div>
<div class="row wrap" v-if="msg.AllChangePlanItem.ClassStyle==1">
<div class="col-6">
<q-select filled stack-label multiple option-value="value" option-label="label" v-model="checkedDays"
ref="ClassStyle" :options="weekList" label="选择周几" :dense="false" class="col-6 q-pr-lg" emit-value
map-options>
<template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }">
<q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section avatar>
<span v-if="opt.icon==1" class="common_Style classForm_monday"></span>
<span v-if="opt.icon==2" class="common_Style classForm_tuesday"></span>
<span v-if="opt.icon==3" class="common_Style classForm_wednesday"></span>
<span v-if="opt.icon==4" class="common_Style classForm_thursday"></span>
<span v-if="opt.icon==5" class="common_Style classForm_friday"></span>
<span v-if="opt.icon==6" class="common_Style classForm_saturday"></span>
<span v-if="opt.icon==7" class="common_Style classForm_sunday"></span>
</q-item-section>
<q-item-section>
<q-item-label v-html="opt.label" />
</q-item-section>
<q-item-section side>
<i style="color:#2961FE" v-if="selected" class="iconfont icon-chenggong"></i>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</div>
<div class="row wrap" v-if="msg.AllChangePlanItem.ClassStyle==2">
<q-select filled stack-label multiple option-value="value" option-label="label" v-model="checkedDays"
ref="ClassStyle" :options="dayList" label="选择日期" :dense="false" class="col-6 q-pr-lg q-pr-lg" emit-value
map-options>
</q-select>
</div>
<div class="row wrap" v-if="msg.AllChangePlanItem.ClassStyle==3">
<div class="col-12">
<q-date v-model="checkedDays" minimal multiple style="width:100%" />
</div>
</div>
<div class="row wrap" style="margin:20px 0;">
<div class="col-6">
学习时段
<q-btn style="margin-left:30px;" size="10px" @click="addPlan()" round color="primary"
icon="iconfont icon-img_haha" />
</div>
</div>
<template v-if="DefaultPlanTimeList&&DefaultPlanTimeList.length>0">
<table style="width:100%;border-collapse: collapse;" class="planTimeLi">
<thead>
<tr>
<th>
日期/周
</th>
<th colspan="2">
时间
</th>
<th>
消耗课时
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody v-for="(nItem,nIndex) in DefaultPlanTimeList" :key="nIndex+10000">
<tr v-for="(sItem,sIndex) in nItem.TimeList">
<td :rowspan="nItem.TimeList.length" v-if="sIndex==0" style="position:relative;">
<q-select filled style="width:220px;" stack-label multiple v-model="nItem.DateList" ref="DateList"
:options="checkedDays" :label="msg.AllChangePlanItem.ClassStyle==1?'选择周几':'选择日期'" :dense="false"
class="col-6" emit-value map-options clearable>
</q-select>
<a @click="deletePlan(nIndex)" style="color:blue;cursor:pointer;position:absolute;">删除</a>
</td>
<td>
<q-input filled v-model="sItem.StartTime" class="col-6 q-pl-lg" placeholder="开始时间" mask="time">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time v-model="sItem.StartTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="确定" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</td>
<td>
<q-input filled v-model="sItem.EndTime" class="col-6 q-pr-lg" placeholder="结束时间" mask="time">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy transition-show="scale" transition-hide="scale">
<q-time v-model="sItem.EndTime">
<div class="row items-center justify-end">
<q-btn v-close-popup label="确定" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</td>
<td>
<q-input filled stack-label maxlength="20" v-model="sItem.TimeHour"
@keyup.native="checkPrice(sItem,'TimeHour')" :dense="false" class="col-6 q-pr-lg"
label="消耗课时" />
</td>
<td>
<q-btn size="10px" v-if="sIndex==0" @click="addPlanTime(nItem)" round color="primary"
icon="iconfont icon-img_haha" />
<q-btn v-if="sIndex>0" size="10px" @click="deletePlanTime(nItem,sIndex)" round color="red"
icon="iconfont icon-guanbi1" />
</td>
</tr>
</tbody>
</table>
</template>
<div class="row wrap" style="margin-top:30px;">
<div class="col-6">
<q-input filled stack-label maxlength="6" v-model="msg.AllChangePlanItem.ClassHours" :dense="false"
class="col-6 q-pr-lg q-pb-lg" label="学习课时" @keyup.native="checkInteger(msg.AllChangePlanItem,'ClassHours')" />
</div>
<div class="col-6">
<q-select label="课时分钟数" filled stack-label v-model="msg.AllChangePlanItem.ClassHourMinute"
:options="ClassHourMinuteArray" option-value="Id" option-label="Name" :dense="false"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options>
</q-select>
</div>
</div>
</div>
<div v-if="msg.ChangeType==3"> <div v-if="msg.ChangeType==3">
<div class="text-caption q-mb-lg q-px-md text-grey-6 col">目标教室</div> <div class="text-caption q-mb-lg q-px-md text-grey-6 col">目标教室</div>
<div class="row"> <div class="row">
<q-select standout="bg-dark text-white" option-value="RoomId" option-label="RoomName" <q-select filled option-value="RoomId" option-label="RoomName" v-model="msg.ClassRoomId"
v-model="msg.TargetRoom" :options="roomList" emit-value map-options :options="roomList" emit-value map-options label="教室" class="col-6">
label="教室" class="col-6">
<template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }"> <template v-slot:option="{ itemProps, itemEvents, opt, selected, toggleOption }">
<q-item v-bind="itemProps" v-on="itemEvents"> <q-item v-bind="itemProps" v-on="itemEvents">
<q-item-section> <q-item-section>
...@@ -136,9 +324,8 @@ ...@@ -136,9 +324,8 @@
<div v-if="msg.ChangeType==2"> <div v-if="msg.ChangeType==2">
<div class="text-caption q-mb-lg q-px-md text-grey-6 col">目标老师</div> <div class="text-caption q-mb-lg q-px-md text-grey-6 col">目标老师</div>
<div class="row"> <div class="row">
<q-select standout="bg-dark text-white" option-value="TId" option-label="TeacherName" <q-select filled option-value="TId" option-label="TeacherName" v-model="msg.TeacherId"
v-model="msg.TargetTeacherId" :options="TeacherList" emit-value map-options :options="TeacherList" emit-value map-options label="老师" class="col-6">
label="老师" class="col-6">
</q-select> </q-select>
</div> </div>
</div> </div>
...@@ -160,7 +347,8 @@ ...@@ -160,7 +347,8 @@
getClassDropDownList, getClassDropDownList,
getSchoolDropdown, getSchoolDropdown,
queryClassRoomPage, queryClassRoomPage,
getTeacherDropDownList getTeacherDropDownList,
SetChangeClassPlan
} from "../../api/school/index"; } from "../../api/school/index";
import { import {
queryCourseDropdownList, queryCourseDropdownList,
...@@ -169,14 +357,14 @@ ...@@ -169,14 +357,14 @@
export default { export default {
data() { data() {
return { return {
TeacherList:[], TeacherList: [],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now(); return time.getTime() < Date.now();
} }
}, },
pages:{ pages: {
rowsPerPage:100000 rowsPerPage: 100000
}, },
persistent: true, persistent: true,
saveLoading: false, saveLoading: false,
...@@ -196,13 +384,26 @@ ...@@ -196,13 +384,26 @@
opacity: 0.75 opacity: 0.75
}, },
msg: { msg: {
Id: 0,
ClassId: 0, ClassId: 0,
SchoolId: -1, SchoolId: -1,
CouseId: 0, CouseId: 0,
ChangeType: 1, ChangeType: 1,
SettingType: "1", MoveType: "1",
TargetRoom:0, ClassRoomId: 0,
TargetTeacherId:0 TeacherId: 0,
OldChangePlanItemList: [],
NewChangePlanItemList: [],
AllChangePlanItem:{
OpenTimeStr:'', //开班时间
ClassStyle: 1, //排课方式(1-周,2-月,3-固定日期,4-约课)
ClassHours:0, //
ClassHourMinute:0,
WeekDayList:[], //周几
TeacherId:0,
ClassRoomId:0,
DefaultTimeList:[]
}
}, },
selected: [], selected: [],
classList: [], classList: [],
...@@ -294,7 +495,71 @@ ...@@ -294,7 +495,71 @@
Name: "取消上课" Name: "取消上课"
} }
], ],
roomList:[] classSetList: [{
Name: '按周排课',
Id: 1
}, {
Name: '按月排课',
Id: 2
}, {
Name: '固定日期',
Id: 3
}, {
Name: '约课',
Id: 4
}],
roomList: [],
//选中日期/星期
checkedDays: [],
//周几
weekList: [{
label: '周一',
value: '1',
icon: 1
}, {
label: '周二',
value: '2',
icon: 2
}, {
label: '周三',
value: '3',
icon: 3
}, {
label: '周四',
value: '4',
icon: 4
}, {
label: '周五',
value: '5',
icon: 5
}, {
label: '周六',
value: '6',
icon: 6
}, {
label: '周日',
value: '7',
icon: 7
}],
dayList: [], //日期数组1-31
//默认上课时间数组
DefaultPlanTimeList: [],
ClassHourMinuteArray: [{
Id: 45,
Name: 45
},
{
Id: 60,
Name: 60
},
],
classSetMsg: {
OpenTime: '', //开班时间
ClassStyle: 1, //排课方式(1-周,2-月,3-固定日期,4-约课)
ClassHours: '',
ClassHourMinute: '',
}
} }
}, },
mounted() { mounted() {
...@@ -307,6 +572,7 @@ ...@@ -307,6 +572,7 @@
this.getCourseList() this.getCourseList()
this.getClassRoomPage() this.getClassRoomPage()
this.GetTeacherList() this.GetTeacherList()
this.initDayList();
}, },
methods: { methods: {
GetTeacherList() { GetTeacherList() {
...@@ -333,7 +599,7 @@ ...@@ -333,7 +599,7 @@
var obj = { var obj = {
RoomName: '请选择', RoomName: '请选择',
RoomId: 0, RoomId: 0,
SchoolName:"" SchoolName: ""
} }
this.roomList.push(obj) this.roomList.push(obj)
}) })
...@@ -342,24 +608,305 @@ ...@@ -342,24 +608,305 @@
this.$emit('close') this.$emit('close')
this.persistent = false this.persistent = false
}, },
//保存修改
save() { save() {
//变更类型课程时间 变更范围单个或多个
if (this.msg.ChangeType == 1 && this.msg.MoveType == 1) {
if (this.selected.length > 0) {
this.msg.OldChangePlanItemList = [];
this.msg.NewChangePlanItemList = [];
let obj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
let newObj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
this.selected.forEach(x => {
obj.ClassPlanId = x.ClassPlanId;
obj.ClassDate = x.ClassDate;
obj.TeacherId = x.TeacherId;
obj.ClassRoomId = x.ClassRoomId;
x.TimeList.forEach(y => {
let obj2 = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj2.StartTime = y.StartTime;
obj2.EndTime = y.EndTime;
obj2.ClassTimeId = y.ClassTimeId;
obj.PlanTimeList.push(obj2);
})
this.msg.OldChangePlanItemList.push(obj);
newObj.ClassPlanId = x.NewPlan.ClassPlanId;
newObj.ClassDate = x.NewPlan.ClassDate;
newObj.TeacherId = x.NewPlan.TeacherId;
newObj.ClassRoomId = x.NewPlan.ClassRoomId;
x.NewPlan.TimeList.forEach(z => {
let obj = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj.StartTime = z.StartTime;
obj.EndTime = z.EndTime;
obj.ClassTimeId = z.ClassTimeId;
newObj.PlanTimeList.push(obj);
})
this.msg.NewChangePlanItemList.push(newObj);
})
this.msg.AllChangePlanItem={};
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择变更数据`
})
return;
}
}
//变更类型课程时间 变更范围 全局
if (this.msg.ChangeType == 1 && this.msg.MoveType == 2) {
this.msg.AllChangePlanItem.WeekDayList = this.checkedDays;
this.msg.AllChangePlanItem.DefaultTimeList = this.DefaultPlanTimeList;
}
//变更类型老师 变更范围单个或多个
if (this.msg.ChangeType == 2 && this.msg.MoveType == 1) {
if (this.selected.length > 0) {
if (this.msg.TeacherId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择目标老师`
})
return;
}
this.msg.OldChangePlanItemList = [];
this.msg.NewChangePlanItemList = [];
let obj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
let newObj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
this.selected.forEach(x => {
obj.ClassPlanId = x.ClassPlanId;
obj.ClassDate = x.ClassDate;
obj.TeacherId = x.TeacherId;
obj.ClassRoomId = x.ClassRoomId;
x.TimeList.forEach(y => {
let obj2 = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj2.StartTime = y.StartTime;
obj2.EndTime = y.EndTime;
obj2.ClassTimeId = y.ClassTimeId;
obj.PlanTimeList.push(obj2);
})
this.msg.OldChangePlanItemList.push(obj);
newObj.ClassPlanId = x.NewPlan.ClassPlanId;
newObj.ClassDate = x.NewPlan.ClassDate;
newObj.TeacherId = this.msg.TeacherId;
newObj.ClassRoomId = x.NewPlan.ClassRoomId;
x.NewPlan.TimeList.forEach(z => {
let obj = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj.StartTime = z.StartTime;
obj.EndTime = z.EndTime;
obj.ClassTimeId = z.ClassTimeId;
newObj.PlanTimeList.push(obj);
})
this.msg.NewChangePlanItemList.push(newObj);
})
this.msg.AllChangePlanItem={};
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择变更数据`
})
return;
}
}
//变更类型老师 变更范围 单全局
if (this.msg.ChangeType == 2 && this.msg.MoveType == 2) {
this.msg.AllChangePlanItem.TeacherId = this.msg.TeacherId;
}
//变更类型教室 变更范围单个或多个
if (this.msg.ChangeType == 3 && this.msg.MoveType == 1) {
if (this.selected.length > 0) {
if (this.msg.ClassRoomId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择目标教室`
})
return;
}
this.msg.OldChangePlanItemList = [];
this.msg.NewChangePlanItemList = [];
let obj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
let newObj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
this.selected.forEach(x => {
obj.ClassPlanId = x.ClassPlanId;
obj.ClassDate = x.ClassDate;
obj.TeacherId = x.TeacherId;
obj.ClassRoomId = x.ClassRoomId;
x.TimeList.forEach(y => {
let obj2 = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj2.StartTime = y.StartTime;
obj2.EndTime = y.EndTime;
obj2.ClassTimeId = y.ClassTimeId;
obj.PlanTimeList.push(obj2);
})
this.msg.OldChangePlanItemList.push(obj);
newObj.ClassPlanId = x.NewPlan.ClassPlanId;
newObj.ClassDate = x.NewPlan.ClassDate;
newObj.TeacherId = x.NewPlan.TeacherId;
newObj.ClassRoomId = this.msg.ClassRoomId;
x.NewPlan.TimeList.forEach(z => {
let obj = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj.StartTime = z.StartTime;
obj.EndTime = z.EndTime;
obj.ClassTimeId = z.ClassTimeId;
newObj.PlanTimeList.push(obj);
})
this.msg.NewChangePlanItemList.push(newObj);
})
this.msg.AllChangePlanItem={};
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择变更数据`
})
return;
}
}
//变更类型教室 变更范围全局
if (this.msg.ChangeType == 3 && this.msg.MoveType == 2) {
this.msg.AllChangePlanItem.ClassRoomId = this.msg.ClassRoomId;
}
//变更类型 取消上课 变更范围单个或多个
if (this.msg.ChangeType == 4 && this.msg.MoveType == 1) {
if (this.selected.length > 0) {
this.msg.OldChangePlanItemList = [];
this.msg.NewChangePlanItemList = [];
let obj = {
ClassPlanId: 0,
ClassDate: '',
TeacherId: 0,
ClassRoomId: 0,
PlanTimeList: []
}
this.selected.forEach(x => {
obj.ClassPlanId = x.ClassPlanId;
obj.ClassDate = x.ClassDate;
obj.TeacherId = x.TeacherId;
obj.ClassRoomId = x.ClassRoomId;
x.TimeList.forEach(y => {
let obj2 = {
ClassTimeId: 0,
StartTime: '',
EndTime: ''
}
obj2.StartTime = y.StartTime;
obj2.EndTime = y.EndTime;
obj2.ClassTimeId = y.ClassTimeId;
obj.PlanTimeList.push(obj2);
})
this.msg.OldChangePlanItemList.push(obj);
})
this.msg.AllChangePlanItem={};
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择变更数据`
})
return;
}
}
//变更类型 取消上课 变更范围 全局
if (this.msg.ChangeType == 4 && this.msg.MoveType ==2){
this.msg.OldChangePlanItemList = [];
this.msg.NewChangePlanItemList = [];
this.msg.AllChangePlanItem={}
}
SetChangeClassPlan(this.msg).then(res => {
if (res.Code == 1) {
this.closeSaveForm();
this.$emit("success")
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: res.Message,
position: "top"
});
}
})
}, },
proteinRangeValidation(val){ proteinRangeValidation(val) {
let newList=[] let newList = []
let errorMsg="" let errorMsg = ""
val.forEach(x=>{ val.forEach(x => {
if(x.StartTime&&x.EndTime&&x.TimeHour&&x.StartTime!=""&&x.EndTime!=""&&x.TimeHour!="0.0"){ if (x.StartTime && x.EndTime && x.TimeHour && x.StartTime != "" && x.EndTime != "" && x.TimeHour !=
"0.0") {
newList.push({ newList.push({
StartTime:x.StartTime, StartTime: x.StartTime,
EndTime:x.EndTime, EndTime: x.EndTime,
TimeHour:x.TimeHour TimeHour: x.TimeHour
}); });
}else{ } else {
errorMsg="存在不完善的数据,请完善数据信息" errorMsg = "存在不完善的数据,请完善数据信息"
} }
}) })
if(errorMsg!=""){ if (errorMsg != "") {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-guanbi1', icon: 'iconfont icon-guanbi1',
color: 'negative', color: 'negative',
...@@ -368,14 +915,13 @@ ...@@ -368,14 +915,13 @@
position: 'top' position: 'top'
}) })
} }
console.log(val) return errorMsg == ""
return errorMsg==""
}, },
removeTime(plan,i){ removeTime(plan, i) {
plan.TimeList.splice(i,1) plan.TimeList.splice(i, 1)
}, },
addTime(plan){ addTime(plan) {
let obj={ let obj = {
EndTime: "", EndTime: "",
StartTime: "", StartTime: "",
TimeHour: 0 TimeHour: 0
...@@ -386,9 +932,10 @@ ...@@ -386,9 +932,10 @@
this.currentClass = this.classList.find(x => { this.currentClass = this.classList.find(x => {
return x.ClassId == val return x.ClassId == val
}).PlanList }).PlanList
console.log(this.currentClass)
}, },
changeTypeResult(val) {}, changeTypeResult(val) {
this.selected=[];
},
changeSchool(val) { changeSchool(val) {
this.queryClass.SchoolId = val this.queryClass.SchoolId = val
this.getClass() this.getClass()
...@@ -400,7 +947,7 @@ ...@@ -400,7 +947,7 @@
getClass() { getClass() {
getClassDropDownList(this.queryClass).then(res => { getClassDropDownList(this.queryClass).then(res => {
this.classList = []; this.classList = [];
this.msg.classId = 0 this.msg.ClassId = 0
if (res.Code == 1) { if (res.Code == 1) {
res.Data.forEach(x => { res.Data.forEach(x => {
x.PlanList.forEach(y => { x.PlanList.forEach(y => {
...@@ -444,8 +991,74 @@ ...@@ -444,8 +991,74 @@
} }
}) })
}, },
//下拉选择改变
changeClassStyle(style) {
this.checkedDays = [];
},
//初始化日期-天
initDayList() {
this.dayList = [];
for (var i = 1; i <= 31; i++) {
this.dayList.push({
label: i,
value: i,
});
}
},
//添加学习时间
addPlan() {
var planObj = {
DateList: [],
TimeList: [{
StartTime: "",
EndTime: "",
TimeHour:''
}],
}
this.DefaultPlanTimeList.push(planObj);
},
//删除学习时间
deletePlan(index) {
this.$q.dialog({
title: '提示信息',
message: "是否要删除",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.DefaultPlanTimeList.splice(index, 1);
}).onCancel(() => {
});
}, },
//添加学习时段
addPlanTime(item) {
var obj = {
StartTime: "",
EndTime: "",
} }
item.TimeList.push(obj);
},
//删除学习时段
deletePlanTime(item, index) {
this.$q.dialog({
title: '提示信息',
message: "是否要删除此学习时间段",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
item.TimeList.splice(index, 1);
}).onCancel(() => {
});
},
},
}
</script> </script>
<style> <style>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<classmateForm :dataList="dataList" v-if="commonType==1"></classmateForm> <classmateForm :dataList="dataList" v-if="commonType==1"></classmateForm>
<change-class-form v-if="persistent" @close="closeSaveForm"></change-class-form> <change-class-form v-if="persistent" @close="closeSaveForm" @success="refreshPage"></change-class-form>
<teachTable v-if="commonType==2" :tableData="tableData" :PageCount="PageCount" :setMsg="tabMsg" @getChange="getChange"></teachTable> <teachTable v-if="commonType==2" :tableData="tableData" :PageCount="PageCount" :setMsg="tabMsg" @getChange="getChange"></teachTable>
</div> </div>
</template> </template>
...@@ -107,6 +107,9 @@ ...@@ -107,6 +107,9 @@
this.getPlanList(); this.getPlanList();
}, },
methods: { methods: {
refreshPage(){
this.getPlanList();
},
openForm() { openForm() {
this.persistent = true this.persistent = true
}, },
......
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