Commit 1a29f945 authored by zhengke's avatar zhengke

1

parents ed5158c3 d762ed7f
...@@ -23,21 +23,21 @@ ...@@ -23,21 +23,21 @@
<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">
<q-card style="width: 800px;max-width:900px;" class="CLM-Form"> <q-card style="width: 800px;max-width:900px;" class="CLM-Form">
<q-card-section> <q-card-section>
<div class="text-h6">上课计划冲突调整 【{{msg.ClassName}}{{msg.ClassNo}})】</div> <div class="text-h6">上课计划冲突调整 【{{showMsg.ClassName}}{{showMsg.ClassNo}})】</div>
</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="showMsg" :loading="loading" no-data-label="暂无相关数据" selection="multiple" flat
:selected.sync="selected" class="sticky-column-table sticky-header-column-table" separator="none" :selected.sync="selectedAll" class="sticky-column-table sticky-header-column-table" separator="none"
style="max-height: 400px" :data="dataList" :columns="columns" row-key="ClassPlanId" hide-bottom> style="max-height: 450px" :data="dataList" :columns="columns" row-key="ClassPlanId" hide-bottom>
<template v-slot:top="props"> <template v-slot:top="props">
<div class="text-caption q-px-md text-grey-6 col"> <div class="text-caption q-my-lg q-px-md text-grey-6 col">
变更内容 注意:需要对变更的内容进行打钩 变更内容 注意:需要对变更的内容进行打钩
</div> </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" <q-select filled stack-label style="display:inline-block;width:150px;" option-value="Id"
option-label="Name" v-model="msg.ChangeType" :options="changeTypeList" label="变更类型" :dense="false" option-label="Name" v-model="postMsg.ChangeType" :options="changeTypeList" label="变更类型" :dense="false"
class="col-6" emit-value map-options /> class="col-6" emit-value map-options />
</div> </div>
</template> </template>
...@@ -99,8 +99,7 @@ ...@@ -99,8 +99,7 @@
</q-banner> </q-banner>
</q-popup-proxy> </q-popup-proxy>
</span> </span>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;" label="编辑" @click="getInfo()">
@click="getInfo(props.row)">
<q-popup-proxy> <q-popup-proxy>
<q-banner v-if="isShowEdit"> <q-banner v-if="isShowEdit">
<div class="classConflitDialog"> <div class="classConflitDialog">
...@@ -184,26 +183,26 @@ ...@@ -184,26 +183,26 @@
</q-table> </q-table>
<div class="row wrap" style="margin-top:20px;"> <div class="row wrap" style="margin-top:20px;">
<div class="col-4"> <div class="col-4">
<template v-if="msg.ChangeType==1"> <template v-if="postMsg.ChangeType==1">
<q-select filled stack-label option-value="TId" option-label="TeacherName" v-model="postMsg.TeacherId" <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 ref="Teacher_Id" :options="TeacherList" label="关联教师" :dense="false" class="col-6 q-pb-lg" emit-value
map-options /> map-options />
</template> </template>
<template v-if="msg.ChangeType==2"> <template v-if="postMsg.ChangeType==2">
<q-select filled stack-label option-value="RoomId" option-label="RoomName" v-model="postMsg.ClassRoomId" <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 ref="ClassRoomId" :options="ClassRoomList" label="关联教室" :dense="false" class="col-6 q-pb-lg" emit-value
map-options /> map-options />
</template> </template>
</div> </div>
<template v-if="msg.ChangeType==3"> <template v-if="postMsg.ChangeType==3">
<div class="col-12"> <div class="col-12">
<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="addStepTwo()" size="10px" round color="primary" icon="iconfont icon-img_haha" /> <q-btn @click="addStepOne(postMsg)" size="10px" round color="primary" icon="iconfont icon-img_haha" />
</div> </div>
<div class="row wrap" style="position:relative;" v-for="(subItem,subIndex) in postMsg.TimeList" <div class="row wrap" style="position:relative;" v-for="(subItem,subIndex) in postMsg.TimeList"
:key="subIndex"> :key="subIndex">
<div class="col-4"> <div class="col-4">
<q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg" placeholder="开始时间" <q-input filled v-model="subItem.StartTime" class="col-6 q-pr-lg q-pb-lg" placeholder="开始时间"
mask="time"> mask="time">
<template v-slot:append> <template v-slot:append>
<q-icon name="access_time" class="cursor-pointer"> <q-icon name="access_time" class="cursor-pointer">
...@@ -219,7 +218,7 @@ ...@@ -219,7 +218,7 @@
</q-input> </q-input>
</div> </div>
<div class="col-4"> <div class="col-4">
<q-input filled v-model="subItem.EndTime" class="col-6 q-pr-lg" placeholder="结束时间" <q-input filled v-model="subItem.EndTime" class="col-6 q-pr-lg q-pb-lg" placeholder="结束时间"
mask="time"> mask="time">
<template v-slot:append> <template v-slot:append>
<q-icon name="access_time" class="cursor-pointer"> <q-icon name="access_time" class="cursor-pointer">
...@@ -236,18 +235,16 @@ ...@@ -236,18 +235,16 @@
</div> </div>
<div class="col-4"> <div class="col-4">
<q-input filled stack-label maxlength="10" :dense="false" v-model="subItem.TimeHour" ref="TimeHour" <q-input filled stack-label maxlength="10" :dense="false" v-model="subItem.TimeHour" ref="TimeHour"
class="col-4 q-pr-lg" label="消耗课时" :rules="[val => !!val || '请填写消耗课时']" class="col-4 q-pr-lg q-pb-lg" label="消耗课时" :rules="[val => !!val || '请填写消耗课时']"
@keyup.native="checkPrice(subItem,'TimeHour')" /> @keyup.native="checkPrice(subItem,'TimeHour')" />
</div> </div>
<div class="delBtnStyle"> <div class="delBtnStyle">
<i @click="delStepTwo(subIndex)" class="iconfont icon-guanbi"></i> <i @click="delStepOne(postMsg,subIndex)" class="iconfont icon-guanbi"></i>
</div> </div>
</div> </div>
</div> </div>
</template> </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">
...@@ -268,7 +265,6 @@ ...@@ -268,7 +265,6 @@
UpdateClassPlanSingle, UpdateClassPlanSingle,
BatchUpdateClassPlan BatchUpdateClassPlan
} from "../../api/school/index"; } from "../../api/school/index";
export default { export default {
props: { props: {
ClassId: { ClassId: {
...@@ -280,6 +276,10 @@ ...@@ -280,6 +276,10 @@
return { return {
persistent: true, persistent: true,
changeTypeList: [{ changeTypeList: [{
Id: 0,
Name: "课程",
},
{
Id: 1, Id: 1,
Name: "老师", Name: "老师",
}, { }, {
...@@ -323,56 +323,27 @@ ...@@ -323,56 +323,27 @@
], ],
dataList: [], dataList: [],
loading: true, loading: true,
selected: [], //全选数据 selectedAll: [], //全选数据
pMsg: { showMsg: {
rowsPerPage: 1000,
},
msg: {
ClassId: 53,
ClassName: "", ClassName: "",
ClassNo: "", ClassNo: "",
ChangeType: 1, rowsPerPage: 1000,
}, },
isShowEdit: false, isShowEdit: false,
//单行修改参数
addMsg: {
ClassPlanId: 0,
ClassId: 0,
ClassDate: "",
ClassDateStr: "",
ClassRoomId: 0,
RoomName: "",
TeacherId: 0,
TeacherName: "",
UserIcon: "",
PlanTimeList: [{
ClassTimeId: 0,
StartTime: "",
EndTime: "",
TimeHour: 0,
}]
},
TeacherList: [], //老师下拉数据 TeacherList: [], //老师下拉数据
ClassRoomList: [], //教室下拉数据 ClassRoomList: [], //教室下拉数据
saveLoading: false, saveLoading: false,
isShowClassForm: false, isShowClassForm: false,
isShowConForm: false,
//选中传入对象
selectObj: {
ClassId: 53,
ChangeType: 1,
selected: []
},
saveClassLoading: false, saveClassLoading: false,
//提交参数 //提交参数
postMsg: { postMsg: {
ClassId: 0, ClassId: 0,
ChangeType: 1, //调动类型(1-老师,2-教室,3-时段) ChangeType: 0, //调动类型(1-老师,2-教室,3-时段)
ClassPlanIdList: [], //选中的ClassPlanId数组 ClassPlanIdList: [], //选中的ClassPlanId数组
ClassRoomId: 0, //全局调整--教室编号 PlanList: [],
TeacherId: 0, //全局调整--教师编号 ClassRoomId: "", //全局调整--教室编号
TimeList: [{ TeacherId: "", //全局调整--教师编号
PlanTimeList: [{
StartTime: "", //开始时间 StartTime: "", //开始时间
EndTime: "", //结束时间 EndTime: "", //结束时间
TimeHour: 0, //消耗课时 TimeHour: 0, //消耗课时
...@@ -383,19 +354,15 @@ ...@@ -383,19 +354,15 @@
created() { created() {
this.GetTeacherList(); this.GetTeacherList();
this.getClassRoomList(); this.getClassRoomList();
},
computed: {
}, },
mounted() { mounted() {
if (this.ClassId) { if (this.ClassId) {
this.msg.ClassId = this.ClassId; this.postMsg.ClassId = this.ClassId;
this.selectObj.ClassId = this.ClassId;
} }
this.getList(); this.getList();
}, },
methods: { methods: {
//点击新增 //点击新增上课时间段
addStepOne(item) { addStepOne(item) {
var obj = { var obj = {
StartTime: "", //开始时间 StartTime: "", //开始时间
...@@ -404,27 +371,15 @@ ...@@ -404,27 +371,15 @@
} }
item.PlanTimeList.push(obj); item.PlanTimeList.push(obj);
}, },
//删除 //删除上课时间段
delStepOne(item, index) { delStepOne(item, index) {
item.PlanTimeList.splice(index, 1); item.PlanTimeList.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 = {};
obj = this.TeacherList.find(item => { obj = this.TeacherList.find(item => {
return item.TId === teacherId; //筛选出匹配数据 return item.TId === teacherId;
}); });
var tName = ""; var tName = "";
if (obj) { if (obj) {
...@@ -432,10 +387,11 @@ ...@@ -432,10 +387,11 @@
} }
return tName; return tName;
}, },
//获取教室名称
getClassRoomName(ClassRoomId) { getClassRoomName(ClassRoomId) {
let obj = {}; let obj = {};
obj = this.ClassRoomList.find(item => { obj = this.ClassRoomList.find(item => {
return item.RoomId === ClassRoomId; //筛选出匹配数据 return item.RoomId === ClassRoomId;
}); });
var tName = ""; var tName = "";
if (obj) { if (obj) {
...@@ -448,29 +404,25 @@ ...@@ -448,29 +404,25 @@
this.$emit('close'); this.$emit('close');
this.persistent = false; this.persistent = false;
}, },
//获取冲突的数据列表
getList() { getList() {
this.loading = true; this.loading = true;
this.dataList = []; this.dataList = [];
GetRepeatClassPlan(this.msg).then(res => { this.selectedAll = [];
GetRepeatClassPlan({
ClassId: this.ClassId
}).then(res => {
this.loading = false; this.loading = false;
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.RepeatList; this.dataList = res.Data.RepeatList;
this.msg.ClassNo = res.Data.ClassNo; this.showMsg.ClassNo = res.Data.ClassNo;
this.msg.ClassName = res.Data.ClassName; this.showMsg.ClassName = res.Data.ClassName;
this.selected = [];
} }
}) })
}, },
//编辑修改 //编辑修改
getInfo(item) { getInfo() {
this.isShowEdit = true; 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() { GetTeacherList() {
...@@ -488,42 +440,43 @@ ...@@ -488,42 +440,43 @@
} }
}) })
}, },
//点击新增
addStep() { //关闭弹窗
var obj = { closeClassSaveForm() {
ClassTimeId: 0, this.isShowClassForm = false;
StartTime: '',
EndTime: '',
TimeHour: 0
}
this.addMsg.PlanTimeList.push(obj);
}, },
//删除 //刷新页面
delStep(index) { refreshPage() {
this.addMsg.PlanTimeList.splice(index, 1); this.isShowClassForm = false;
this.getList();
}, },
//保存
saveSteps() { //保存信息
for (let i = 0; i < this.addMsg.PlanTimeList.length; i++) { saveClass() {
if (this.addMsg.PlanTimeList[i].StartTime == '') { if (this.selectedAll.length == 0) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
message: `请选择第${i+1}节课开始时间` message: `请勾选需要修改的数据!`
}) })
return return
} }
if (this.addMsg.PlanTimeList[i].EndTime == '') { this.postMsg.PlanList = [];
this.$q.notify({ this.postMsg.ClassPlanIdList = [];
type: 'negative', if (this.postMsg.ChangeType == 0) {
position: "top", this.selectedAll.forEach(x => {
message: `请选择第${i+1}节课结束时间` this.postMsg.PlanList.push(x);
})
} else {
this.selectedAll.forEach(x => {
this.postMsg.ClassPlanIdList.push(x.ClassPlanId);
}) })
return
}
} }
this.saveLoading = true if (this.postMsg.ChangeType == 0) {
UpdateClassPlanSingle(this.addMsg).then(res => { this.saveLoading = true;
UpdateClassPlanSingle({
PlanList: this.postMsg.PlanList
}).then(res => {
this.saveLoading = false this.saveLoading = false
if (res.Code == 1) { if (res.Code == 1) {
this.isShowEdit = false; this.isShowEdit = false;
...@@ -534,42 +487,15 @@ ...@@ -534,42 +487,15 @@
position: "top", position: "top",
message: `还存在冲突数据请继续修改!` message: `还存在冲突数据请继续修改!`
}) })
} else {
this.$emit('success');
this.$emit('close');
} }
} }
}).catch(() => { }).catch(() => {
this.saveLoading = false 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 { } else {
this.selectObj.selected = [];
this.selectObj.ChangeType = type;
this.selected.forEach(x => {
this.selectObj.selected.push(x.ClassPlanId);
})
this.isShowConForm = true;
}
},
//保存信息
saveClass() {
if (this.postMsg.ChangeType == 1 && this.postMsg.TeacherId == 0) { if (this.postMsg.ChangeType == 1 && this.postMsg.TeacherId == 0) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -606,23 +532,25 @@ ...@@ -606,23 +532,25 @@
} }
} }
} }
this.postMsg.ClassPlanIdList = this.saveObj.selected;
this.postMsg.ClassId = this.ClassId; this.postMsg.ClassId = this.ClassId;
BatchUpdateClassPlan(this.postMsg).then(res => { BatchUpdateClassPlan(this.postMsg).then(res => {
if (res.Code === 1) { if (res.Code === 1) {
this.getList();
if (res.Data) {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', type: 'negative',
color: 'accent', position: "top",
timeout: 2000, message: `还存在冲突数据请继续修改!`
message: res.Message,
position: 'top'
}) })
} else {
this.$emit('success'); this.$emit('success');
this.$emit('close'); this.$emit('close');
}
} else { } else {
this.Error(res.Message); this.Error(res.Message);
} }
}) })
}
}, },
} }
} }
......
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