Commit f9edbcbc authored by zhengke's avatar zhengke

修改

parent 74080d6e
......@@ -644,9 +644,7 @@
position: 'top'
})
if(res.Data){
this.OpenNewUrl('../../course/classConflict',{
// ClassId:this.statusMsg.ClassId
})
this.$emit('getClassFlict',this.objOption.ClassId);
}
this.$emit("success")
this.closeCourseForm()
......
<style>
.OCourseTable {
width: 450px;
text-align: center;
}
.OCourseTable tr td {
height: 40px;
color: #000;
}
.OCourseTable tr th {
height: 40px;
background-color: rgb(238, 238, 239);
}
.resStyle {
color: red;
}
.classConDialog {
width: 400px;
height: auto;
}
.delBtnStyle {
position: absolute;
right: 6px;
top: -9px;
width: 20px;
height: 20px;
border: 1px solid red;
background-color: red;
color: #fff;
line-height: 18px;
text-align: center;
border-radius: 50%;
}
</style>
<template>
<div class="page-body">
<div class="page-content">
<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">
<div class="col-2 q-table__title">上课计划冲突调整 【{{msg.ClassName}}{{msg.ClassNo}})】</div>
<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>{{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>
</div>
<class-form v-if="isShowClassForm" :save-obj="msg" @close="closeClassSaveForm" @success="refreshPage">
</class-form>
<classcon-form v-if="isShowConForm" :save-obj="selectObj" @close="closeClassSaveForm" @success="refreshPage">
</classcon-form>
</div>
</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 {
meta: {
title: "上课计划冲突调整"
},
components: {
classForm,
classconForm
},
data() {
return {
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: []
}
};
},
mounted() {
if (this.$route.query && this.$route.query.ClassId) {
this.msg.ClassId = this.$route.query.ClassId;
this.selectObj.ClassId = this.$route.query.ClassId;
}
this.GetTeacherList();
this.getClassRoomList();
this.getList();
},
methods: {
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;
}
}
}
};
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -216,7 +216,7 @@
</q-td>
</template>
</q-table>
<class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm" @success="refreshPage">
<class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm" @getClassFlict="getClassFlict" @success="refreshPage">
</class-form>
<classinfo-form v-if="isShowClassInfo" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
......@@ -224,6 +224,8 @@
<othercourseForm v-if="IsShowOtherCourse" :seting-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
</othercourseForm>
<classconflict-form :ClassId="ClassId" v-if="isShowConflict" @close="closeClassSaveForm"
@success="refreshPage"></classconflict-form>
</div>
</div>
</template>
......@@ -242,6 +244,7 @@
import classForm from '../../components/course/class-form';
import classinfoForm from '../../components/course/classinfo-form';
import othercourseForm from '../../components/course/othercourse-form';
import classconflictForm from '../../components/course/classconflict-form';
export default {
meta: {
title: "班级管理"
......@@ -249,7 +252,8 @@
components: {
classForm,
classinfoForm,
othercourseForm
othercourseForm,
classconflictForm
},
data() {
return {
......@@ -352,6 +356,9 @@
isShowClassForm: false, //是否显示新增修改弹窗
isShowClassInfo: false, //是否显示课程信息
IsShowOtherCourse: false, //是否显示其他课程
isShowConflict: false, //是否显示上课计划冲突
ClassId:53
}
},
created() {
......@@ -365,6 +372,14 @@
this.getClassList();
},
methods: {
//显示冲突切换弹窗
getClassFlict(ClassId){
this.isShowClassForm=false;
this.isShowConflict=true;
this.ClassId = ClassId;
console.log('进入');
console.log(ClassId,'ClassId');
},
//删除班级
removeClass(item, status) {
let delMsg = {
......@@ -518,6 +533,8 @@
this.isShowClassInfo = false;
//关闭关联其他课程弹窗
this.IsShowOtherCourse = false;
//关闭课程冲突
this.isShowConflict = false;
},
GetFirst(val) {
if (val) {
......
......@@ -927,11 +927,6 @@ const routes = [{
component: () =>
import("pages/course/jobinfo.vue")
},
{
path: "/course/classConflict", //上课计划冲突
component: () =>
import("pages/course/classConflict.vue")
},
{
path: "/studyAbroad/studyabroad", //留学
component: () =>
......
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