Commit 8bdb6865 authored by zhengke's avatar zhengke

1

parent f9edbcbc
<style>
.CLM-Form .el-input__inner {
background: transparent;
border: 0;
}
.CLM-Form .el-input-group__append {
background: transparent;
border: 0;
}
.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;
}
.CLM-Form .Emp_Line {
width: 3px;
height: 10px;
background-color: #3FC4FF;
margin-right: 10px;
}
.CLM-Form .EmpLine_title {
display: flex;
align-items: center;
font-size: 12px;
margin-bottom: 20px;
}
.planTimeLi2 tbody::before {
content: '';
display: table-row;
height: 20px;
}
</style>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale">
<q-card style="width: 800px;max-width:900px;" class="CLM-Form">
<q-card-section>
<div class="text-h6">上课计划冲突调整 【{{msg.ClassName}}{{msg.ClassNo}})】</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<q-table :pagination="pMsg" :loading="loading" no-data-label="暂无相关数据" selection="multiple" flat
:selected.sync="selected" class="sticky-column-table" separator="none" :data="dataList" :columns="columns"
row-key="ClassPlanId" hide-bottom>
<template v-slot:top="props">
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" @click="isShowClassForm=true" label="全部重排" />
<q-btn color="accent" size="sm" class="q-mr-md" @click="getCommonEdit(2)" label="修改教室" />
<q-btn color="accent" size="sm" class="q-mr-md" @click="getCommonEdit(1)" label="修改老师" />
<q-btn color="accent" size="sm" class="q-mr-md" @click="getCommonEdit(3)" label="修改时段" />
</div>
</template>
<template v-slot:body-cell-PlanTimeList="props">
<q-td>
<div v-for="(item,index) in props.row.PlanTimeList" :key="index">
{{item.StartTime}}-{{item.EndTime}}
</div>
</q-td>
</template>
<template v-slot:bottom>
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<span>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="查看" />
<q-popup-proxy>
<q-banner>
<table class="OCourseTable" style="border-collapse:collapse;">
<tr>
<th>班级</th>
<th>日期</th>
<th>老师</th>
<th>教室</th>
<th>上课时段</th>
</tr>
<tr v-for="(subItem,subIndex) in props.row.PlanRepeatList" :key="subIndex">
<td style="width:200px;text-align:left;">
{{subItem.ClassName}}
</td>
<td>{{subItem.ClassDate}}</td>
<td><span :class="{'resStyle':props.row.TeacherId==subItem.TeacherId}">
{{subItem.TeacherName}}</span>
</td>
<td>
<span
:class="{'resStyle':props.row.ClassRoomId==subItem.ClassRoomId}">{{subItem.RoomName}}</span>
</td>
<td>
<template v-if="subItem.PlanTimeList&&subItem.PlanTimeList.length>0">
<div v-for="(cItem,cIndex) in subItem.PlanTimeList" :key="cIndex">
{{cItem.StartTime}}-{{cItem.EndTime}}
</div>
</template>
</td>
</tr>
</table>
</q-banner>
</q-popup-proxy>
</span>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;" label="编辑"
@click="getInfo(props.row)">
<q-popup-proxy>
<q-banner v-if="isShowEdit">
<div class="classConDialog">
<div style="margin:10px 0 15px 0;">{{props.row.ClassDate}}课程安排</div>
<q-select filled stack-label option-value="TId" option-label="TeacherName"
v-model="addMsg.TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false"
class="col-6 q-pb-lg" emit-value map-options />
<q-input filled v-model="addMsg.ClassDate" class="col-6 q-pb-lg" mask="date" label="上课时间">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy3" transition-show="scale" transition-hide="scale">
<q-date v-model="addMsg.ClassDate" @input=' () => $refs.qDateProxy3[0].hide()' />
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="addMsg.ClassRoomId" ref="ClassRoomId" :options="ClassRoomList" label="关联教室"
:dense="false" class="col-6 q-pb-lg" emit-value map-options />
<div style="display:flex;justify-content:flex-end;margin-bottom:20px;">
<q-btn @click="addStep()" size="10px" round color="primary" icon="iconfont icon-img_haha" />
</div>
<div class="row wrap" style="position:relative;" v-for="(subItem,subIndex) in addMsg.PlanTimeList"
:key="subIndex">
<div class="col-4">
<q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg q-pb-lg" 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="subItem.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>
</div>
<div class="col-4">
<q-input filled v-model="subItem.EndTime" class="col-6 q-pr-lg q-pb-lg" 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="subItem.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>
</div>
<div class="col-4">
<q-input filled stack-label maxlength="10" :dense="false" v-model="subItem.TimeHour"
ref="TimeHour" class="col-4 q-pr-lg q-pb-lg" label="消耗课时"
:rules="[val => !!val || '请填写消耗课时']" @keyup.native="checkPrice(subItem,'TimeHour')" />
</div>
<div class="delBtnStyle">
<i @click="delStep(subIndex)" class="iconfont icon-guanbi"></i>
</div>
</div>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" @click="isShowEdit=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" style="font-weight:400 !important"
:loading="saveLoading" @click="saveSteps" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</q-btn>
</q-td>
</template>
</q-table>
</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="closeCourseForm" />
<q-btn label="提交调整" color="accent q-px-md" style="font-weight:400 !important" :loading="saveClassLoading"
@click="saveClassFlict">
</q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
GetRepeatClassPlan,
getTeacherDropDownList,
queryClassRoomList,
UpdateClassPlanSingle
} from "../../api/school/index";
import classForm from '../../components/course/class-form';
import classconForm from '../../components/course/classcon-form';
export default {
components: {
classForm,
classconForm
},
props: {
ClassId: {
type: Number,
default: null
}
},
data() {
return {
persistent: true,
columns: [{
name: "ClassDate",
label: "日期",
field: "ClassDate",
align: "left"
},
{
name: "TeacherName",
label: "老师",
field: "TeacherName",
align: "left"
},
{
name: "RoomName",
label: "教室",
field: "RoomName",
align: "left"
},
{
name: "PlanTimeList",
label: "上课时段",
field: "PlanTimeList",
align: "left",
},
{
name: "optioned",
label: "操作",
field: "CourseId"
}
],
dataList: [],
loading: true,
selected: [], //全选数据
pMsg: {
rowsPerPage: 1000,
},
msg: {
ClassId: 53,
ClassName: "",
ClassNo: "",
},
isShowEdit: false,
//单行修改参数
addMsg: {
ClassPlanId: 0,
ClassId: 0,
ClassDate: "",
ClassDateStr: "",
ClassRoomId: 0,
RoomName: "",
TeacherId: 0,
TeacherName: "",
UserIcon: "",
PlanTimeList: [{
ClassTimeId: 0,
StartTime: "",
EndTime: "",
TimeHour: 0,
}]
},
TeacherList: [], //老师下拉数据
ClassRoomList: [], //教室下拉数据
saveLoading: false,
isShowClassForm: false,
isShowConForm: false,
//选中传入对象
selectObj: {
ClassId: 53,
ChangeType: 1,
selected: []
},
saveClassLoading:false
}
},
created() {
},
mounted() {
if (this.ClassId) {
this.msg.ClassId = this.ClassId;
this.selectObj.ClassId = this.ClassId;
}
this.GetTeacherList();
this.getClassRoomList();
this.getList();
},
methods: {
//关闭弹窗
closeCourseForm() {
this.$emit('close');
this.persistent = false;
},
getList() {
this.loading = true;
this.dataList = [];
GetRepeatClassPlan(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.RepeatList;
this.msg.ClassNo = res.Data.ClassNo;
this.msg.ClassName = res.Data.ClassName;
this.selected = [];
}
})
},
//编辑修改
getInfo(item) {
this.isShowEdit = true;
var Obj = JSON.parse(JSON.stringify(item));
this.addMsg.ClassPlanId = Obj.ClassPlanId;
this.addMsg.ClassId = Obj.ClassId;
this.addMsg.ClassDate = Obj.ClassDate;
this.addMsg.ClassRoomId = Obj.ClassRoomId;
this.addMsg.TeacherId = Obj.TeacherId;
this.addMsg.PlanTimeList = Obj.PlanTimeList;
},
//获取教师下拉
GetTeacherList() {
getTeacherDropDownList({}).then(res => {
if (res.Code == 1) {
this.TeacherList = res.Data;
}
})
},
//获取教室下拉
getClassRoomList() {
queryClassRoomList({}).then(res => {
if (res.Code == 1) {
this.ClassRoomList = res.Data;
}
})
},
//点击新增
addStep() {
var obj = {
ClassTimeId: 0,
StartTime: '',
EndTime: '',
TimeHour: 0
}
this.addMsg.PlanTimeList.push(obj);
},
//删除
delStep(index) {
this.addMsg.PlanTimeList.splice(index, 1);
},
//保存
saveSteps() {
for (let i = 0; i < this.addMsg.PlanTimeList.length; i++) {
if (this.addMsg.PlanTimeList[i].StartTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课开始时间`
})
return
}
if (this.addMsg.PlanTimeList[i].EndTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课结束时间`
})
return
}
}
this.saveLoading = true
UpdateClassPlanSingle(this.addMsg).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.isShowEdit = false;
this.getList();
if (res.Data) {
this.$q.notify({
type: 'negative',
position: "top",
message: `还存在冲突数据请继续修改!`
})
}
}
}).catch(() => {
this.saveLoading = false
})
},
//关闭弹窗
closeClassSaveForm() {
this.isShowClassForm = false;
this.isShowConForm = false;
},
//刷新页面
refreshPage() {
this.isShowClassForm = false;
this.getList();
},
//点击修改教师 老师 时段
getCommonEdit(type) {
if (this.selected.length == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请勾选需要修改的数据!`
})
return
} else {
this.selectObj.selected = [];
this.selectObj.ChangeType = type;
this.selected.forEach(x => {
this.selectObj.selected.push(x.ClassPlanId);
})
this.isShowConForm = true;
}
},
//保存
saveClassFlict(){
}
}
}
</script>
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