Commit df0c1fd3 authored by zhengke's avatar zhengke

修改

parent 075be593
......@@ -623,3 +623,13 @@ export function UpdateClassPlanSingle(data) {
});
}
/**
* 保存批量修改
*/
export function BatchUpdateClassPlan(data) {
return request({
url: '/Class/BatchUpdateClassPlan',
method: 'post',
data
});
}
......@@ -643,6 +643,11 @@
message: '数据保存成功!',
position: 'top'
})
if(res.Data){
this.OpenNewUrl('../../course/classConflict',{
// ClassId:this.statusMsg.ClassId
})
}
this.$emit("success")
this.closeCourseForm()
}
......
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale"
transition-hide="scale" class="addactivetype">
<q-card style="width: 450px;max-width:450px;">
<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: {
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;
BatchUpdateClassPlan(this.postMsg).then(res => {
if (res.Code === 1) {
this.Success("操作成功");
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>
......@@ -48,10 +48,10 @@
<div class="col-2 q-table__title">上课计划冲突调整</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" label="全部重排" />
<q-btn color="accent" size="sm" class="q-mr-md" label="修改教室" />
<q-btn color="accent" size="sm" class="q-mr-md" label="修改老师" />
<q-btn color="accent" size="sm" class="q-mr-md" label="修改时段" />
<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">
......@@ -173,6 +173,9 @@
</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>
......@@ -183,10 +186,17 @@
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: [{
......@@ -250,18 +260,13 @@
TeacherList: [], //老师下拉数据
ClassRoomList: [], //教室下拉数据
saveLoading: false,
//提交参数
postMsg: {
ChangeType: 1, //调动类型(1-老师,2-教室,3-时段)
ClassPlanIdList: [], //选中的ClassPlanId数组
ClassRoomId: 0, //全局调整--教室编号
TeacherId: 0, //全局调整--教师编号
TimeList: [{
StartTime: "", //开始时间
EndTime: "", //结束时间
TimeHour: 0, //消耗课时
}], //全局调整--上课时段
isShowClassForm:false,
isShowConForm:false,
//选中传入对象
selectObj:{
ChangeType:1,
selected:[]
}
};
},
......@@ -278,7 +283,7 @@
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data;
this.postMsg.PlanList = res.Data;
this.selected = [];
}
})
},
......@@ -360,6 +365,34 @@
}).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;
}
}
}
};
......
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