Commit 48446fa6 authored by zhengke's avatar zhengke

修改

parent 528289f3
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale"
transition-hide="scale" class="addactivetype">
<q-card style="width: 500px;max-width:500px;">
<q-card-section>
<div class="text-h6">
<span v-if="postMsg.ChangeType==1">批量修改老师</span>
<span v-if="postMsg.ChangeType==2">批量修改教室</span>
<span v-if="postMsg.ChangeType==3">批量修改时段</span>
</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap q-mb-lg" v-if="postMsg.ChangeType==1">
<div class="col-12">
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="postMsg.TeacherId"
ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false" class="col-6 q-pb-lg" emit-value
map-options />
</div>
</div>
<div class="row wrap q-mb-lg" v-if="postMsg.ChangeType==2">
<div class="col-12">
<q-select filled stack-label option-value="RoomId" option-label="RoomName" v-model="postMsg.ClassRoomId"
ref="ClassRoomId" :options="ClassRoomList" label="关联教室" :dense="false" class="col-6 q-pb-lg"
emit-value map-options />
</div>
</div>
<div class="row wrap" v-if="postMsg.ChangeType==3">
<div class="col-12">
<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 postMsg.TimeList"
:key="subIndex">
<div class="col-4">
<q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg q-pb-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="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" 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="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>
</div>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeRuleForm" />
<q-btn label="保存" color="accent q-px-md" style="font-weight:400 !important" @click="saveClass" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
BatchUpdateClassPlan,
getTeacherDropDownList,
queryClassRoomList,
} from '../../api/school/index.js'
export default {
props: {
saveObj: {
type: Object,
default: null
},
},
data() {
return {
persistent: true,
//提交参数
postMsg: {
ClassId: 0,
ChangeType: 1, //调动类型(1-老师,2-教室,3-时段)
ClassPlanIdList: [], //选中的ClassPlanId数组
ClassRoomId: 0, //全局调整--教室编号
TeacherId: 0, //全局调整--教师编号
TimeList: [{
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}], //全局调整--上课时段
},
TeacherList: [],
ClassRoomList: [],
}
},
mounted() {
this.postMsg.ChangeType = this.saveObj.ChangeType
this.GetTeacherList();
this.getClassRoomList();
},
methods: {
//保存信息
saveClass() {
if (this.postMsg.ChangeType == 1 && this.postMsg.TeacherId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择老师`
})
return
}
if (this.postMsg.ChangeType == 2 && this.postMsg.ClassRoomId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择教室`
})
return
}
if (this.postMsg.ChangeType == 3) {
for (let i = 0; i < this.postMsg.TimeList.length; i++) {
if (this.postMsg.TimeList[i].StartTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课开始时间`
})
return
}
if (this.postMsg.TimeList[i].EndTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课结束时间`
})
return
}
}
}
this.postMsg.ClassPlanIdList = this.saveObj.selected;
this.postMsg.ClassId = this.saveObj.ClassId;
BatchUpdateClassPlan(this.postMsg).then(res => {
if (res.Code === 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.$emit('success');
this.$emit('close');
} else {
this.Error(res.Message);
}
})
},
//关闭窗口
closeRuleForm() {
this.$emit('close');
this.persistent = false
},
//获取教师下拉
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 = {
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}
this.postMsg.TimeList.push(obj);
},
//删除
delStep(index) {
this.postMsg.TimeList.splice(index, 1);
},
},
}
</script>
<style> <style>
.CLM-Form .el-input__inner { .classFlictTable {
background: transparent; width: 500px;
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; 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;
} }
.classFlictTable tr td {
.classForm_thursday { height: 40px;
background-color: #ccf3eb; color:#000;
color: #02C499;
} }
.classFlictTable tr th {
.classForm_friday { height: 40px;
background-color: #f7cfd6; background-color: rgb(238, 238, 239);
color: #F72E52;
} }
.classConflitDialog{
.classForm_saturday { width:400px;
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> </style>
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale"> <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale">
...@@ -82,15 +23,18 @@ ...@@ -82,15 +23,18 @@
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<q-table :pagination="pMsg" :loading="loading" no-data-label="暂无相关数据" selection="multiple" flat <q-table :pagination="pMsg" :loading="loading" no-data-label="暂无相关数据" selection="multiple" flat
:selected.sync="selected" class="sticky-column-table" separator="none" style="max-height: 500px" :data="dataList" :columns="columns" :selected.sync="selected" class="sticky-column-table sticky-header-column-table" separator="none"
row-key="ClassPlanId" hide-bottom> style="max-height: 500px" :data="dataList" :columns="columns" row-key="ClassPlanId" hide-bottom>
<template v-slot:top="props"> <template v-slot:top="props">
<div class="text-caption q-my-lg q-px-md text-grey-6 col">
变更内容 注意:需要对变更的内容进行打钩
</div>
<q-space /> <q-space />
<div class="page-option"> <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="isShowClassForm=true" label="全部重排" />
<q-select filled stack-label style="display:inline-block;width:150px;" option-value="Id" option-label="Name" v-model="msg.ChangeType" <q-select filled stack-label style="display:inline-block;width:150px;" option-value="Id"
:options="changeTypeList" label="变更类型" :dense="false" class="col-6" emit-value map-options option-label="Name" v-model="msg.ChangeType" :options="changeTypeList" label="变更类型" :dense="false"
@input="changeTypeResult" /> class="col-6" emit-value map-options />
</div> </div>
</template> </template>
<template v-slot:body-cell-TeacherName="props"> <template v-slot:body-cell-TeacherName="props">
...@@ -111,10 +55,10 @@ ...@@ -111,10 +55,10 @@
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<span> <span>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="查看" /> <q-btn flat size="xs" icon="iconfont icon-View" color="accent" style="font-weight:400" label="查看" />
<q-popup-proxy> <q-popup-proxy>
<q-banner> <q-banner>
<table class="OCourseTable" style="border-collapse:collapse;"> <table class="classFlictTable" style="border-collapse:collapse;">
<tr> <tr>
<th>班级</th> <th>班级</th>
<th>日期</th> <th>日期</th>
...@@ -150,11 +94,20 @@ ...@@ -150,11 +94,20 @@
@click="getInfo(props.row)"> @click="getInfo(props.row)">
<q-popup-proxy> <q-popup-proxy>
<q-banner v-if="isShowEdit"> <q-banner v-if="isShowEdit">
<div class="classConDialog"> <div class="classConflitDialog">
<div style="margin:10px 0 15px 0;">{{props.row.ClassDate}}课程安排</div> <div style="margin:10px 0 15px 0;">{{props.row.ClassDate}}课程安排</div>
<div class="row wrap">
<div class="col-6">
<q-select filled stack-label option-value="TId" option-label="TeacherName" <q-select filled stack-label option-value="TId" option-label="TeacherName"
v-model="props.row.TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师" v-model="props.row.TeacherId" ref="Teacher_Id" :options="TeacherList" label="关联教师"
:dense="false" class="col-6 q-pb-lg q-pr-lg" emit-value map-options />
</div>
<div class="col-6">
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="props.row.ClassRoomId" ref="ClassRoomId" :options="ClassRoomList" label="关联教室"
:dense="false" class="col-6 q-pb-lg" emit-value map-options /> :dense="false" class="col-6 q-pb-lg" emit-value map-options />
</div>
</div>
<q-input filled v-model="props.row.ClassDate" class="col-6 q-pb-lg" mask="date" label="上课时间"> <q-input filled v-model="props.row.ClassDate" class="col-6 q-pb-lg" mask="date" label="上课时间">
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
...@@ -164,11 +117,9 @@ ...@@ -164,11 +117,9 @@
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="props.row.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;"> <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" /> <q-btn @click="addStep(props.row)" size="10px" round color="primary"
icon="iconfont icon-img_haha" />
</div> </div>
<div class="row wrap" style="position:relative;" <div class="row wrap" style="position:relative;"
v-for="(subItem,subIndex) in props.row.PlanTimeList" :key="subIndex"> v-for="(subItem,subIndex) in props.row.PlanTimeList" :key="subIndex">
...@@ -208,11 +159,10 @@ ...@@ -208,11 +159,10 @@
:rules="[val => !!val || '请填写消耗课时']" @keyup.native="checkPrice(subItem,'TimeHour')" /> :rules="[val => !!val || '请填写消耗课时']" @keyup.native="checkPrice(subItem,'TimeHour')" />
</div> </div>
<div class="delBtnStyle"> <div class="delBtnStyle">
<i @click="delStep(subIndex)" class="iconfont icon-guanbi"></i> <i @click="delStep(props.row,subIndex)" class="iconfont icon-guanbi"></i>
</div> </div>
</div> </div>
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="确认调整" color="accent q-px-md" style="font-weight:400 !important" <q-btn label="确认调整" color="accent q-px-md" style="font-weight:400 !important"
@click="isShowEdit=false" /> @click="isShowEdit=false" />
</q-card-actions> </q-card-actions>
...@@ -223,20 +173,78 @@ ...@@ -223,20 +173,78 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<div class="row wrap"> <div class="row wrap" style="margin-top:20px;">
<div class="col-6"> <div class="col-4">
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="TeacherId" <template v-if="msg.ChangeType==1">
ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false" class="col-6 q-pr-lg q-pb-lg" <q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="postMsg.TeacherId"
emit-value map-options /> ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false" class="col-6 q-pb-lg" emit-value
map-options />
</template>
<template v-if="msg.ChangeType==2">
<q-select filled stack-label option-value="RoomId" option-label="RoomName" v-model="postMsg.ClassRoomId"
ref="ClassRoomId" :options="ClassRoomList" label="关联教室" :dense="false" class="col-6 q-pb-lg" emit-value
map-options />
</template>
</div> </div>
<template v-if="msg.ChangeType==3">
<div class="col-12">
<div style="display:flex;justify-content:flex-end;margin-bottom:20px;">
<q-btn @click="addStepTwo()" size="10px" round color="primary" icon="iconfont icon-img_haha" />
</div>
<div class="row wrap" style="position:relative;" v-for="(subItem,subIndex) in postMsg.TimeList"
:key="subIndex">
<div class="col-4">
<q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg q-pb-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="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" 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="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="delStepTwo(subIndex)" class="iconfont icon-guanbi"></i>
</div>
</div>
</div>
</template>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <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="忽略冲突" 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" <q-btn label="提交调整" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveClassFlict"> @click="saveClass">
</q-btn> </q-btn>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
...@@ -248,17 +256,11 @@ ...@@ -248,17 +256,11 @@
GetRepeatClassPlan, GetRepeatClassPlan,
getTeacherDropDownList, getTeacherDropDownList,
queryClassRoomList, queryClassRoomList,
UpdateClassPlanSingle UpdateClassPlanSingle,
BatchUpdateClassPlan
} from "../../api/school/index"; } from "../../api/school/index";
import classForm from '../../components/course/class-form';
import classconForm from '../../components/course/classcon-form';
export default { export default {
components: {
classForm,
classconForm
},
props: { props: {
ClassId: { ClassId: {
type: Number, type: Number,
...@@ -270,17 +272,15 @@ ...@@ -270,17 +272,15 @@
persistent: true, persistent: true,
changeTypeList: [{ changeTypeList: [{
Id: 1, Id: 1,
Name: "课程时间",
},
{
Id: 2,
Name: "老师", Name: "老师",
}, {
Id: 2,
Name: "教室",
}, },
{ {
Id: 3, Id: 3,
Name: "教室", Name: "时段",
}, }
], ],
columns: [{ columns: [{
name: "ClassDate", name: "ClassDate",
...@@ -356,8 +356,19 @@ ...@@ -356,8 +356,19 @@
selected: [] selected: []
}, },
saveClassLoading: false, saveClassLoading: false,
TeacherId: 0, //提交参数
ClassRoomId: 0 postMsg: {
ClassId: 0,
ChangeType: 1, //调动类型(1-老师,2-教室,3-时段)
ClassPlanIdList: [], //选中的ClassPlanId数组
ClassRoomId: 0, //全局调整--教室编号
TeacherId: 0, //全局调整--教师编号
TimeList: [{
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}], //全局调整--上课时段
},
} }
}, },
created() { created() {
...@@ -375,8 +386,32 @@ ...@@ -375,8 +386,32 @@
this.getList(); this.getList();
}, },
methods: { methods: {
changeTypeResult(){ //点击新增
addStep(item) {
console.log(item,'item');
var obj = {
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}
item.TimeList.push(obj);
},
//删除
delStep(item, index) {
item.TimeList.splice(index, 1);
},
//新增
addStepTwo() {
var obj = {
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}
this.postMsg.TimeList.push(obj);
},
//删除
delStepTwo(index) {
this.postMsg.TimeList.splice(index, 1);
}, },
getTeacherName(teacherId) { getTeacherName(teacherId) {
let obj = {}; let obj = {};
...@@ -514,11 +549,63 @@ ...@@ -514,11 +549,63 @@
this.isShowConForm = true; this.isShowConForm = true;
} }
}, },
//保存 //保存信息
saveClassFlict() { saveClass() {
if (this.postMsg.ChangeType == 1 && this.postMsg.TeacherId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择老师`
})
return
}
if (this.postMsg.ChangeType == 2 && this.postMsg.ClassRoomId == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择教室`
})
return
}
if (this.postMsg.ChangeType == 3) {
for (let i = 0; i < this.postMsg.TimeList.length; i++) {
if (this.postMsg.TimeList[i].StartTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课开始时间`
})
return
}
if (this.postMsg.TimeList[i].EndTime == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择第${i+1}节课结束时间`
})
return
}
} }
} }
this.postMsg.ClassPlanIdList = this.saveObj.selected;
this.postMsg.ClassId = this.ClassId;
BatchUpdateClassPlan(this.postMsg).then(res => {
if (res.Code === 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.$emit('success');
this.$emit('close');
} else {
this.Error(res.Message);
}
})
},
}
} }
</script> </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