Commit 37fbe8a2 authored by Mac's avatar Mac

修改

parent d8361888
......@@ -45,4 +45,15 @@ export function delScrollShiftInfo(data) {
method: 'post',
data
})
}
/**
* 新增排班计划
* @param {JSON参数} data
*/
export function setScrollPlanInfo(data) {
return request({
url: '/Scroll/SetScrollPlanInfo',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -194,7 +194,7 @@ export default {
if (res.Code == 1) {
this.shiftList = res.Data;
if(res.Data.length>0){
this.$emit('getList',res.Data)
this.$emit('getLists',res.Data)
}
}
})
......
......@@ -10,20 +10,27 @@
border: 1px solid #d2d2d2;
background: #FFF;
}
.workutaTeaching td:first-child{background-color: #E6E6E6;position: sticky;left:0px;}
.workutaTeaching td:first-child{position: sticky;left:0px;background-color: #FFF;}
.workutaTeaching th:first-child{position: sticky;left:0px;}
.workutaTeaching .finger{
cursor: pointer;
}
.workutaTeaching .yuan{
width: 16px;
height: 16px;
display: inline-block;
border-radius: 50%;
margin-right: 10px;
}
</style>
<template>
<div class="page-body workutaTeaching">
<div >
<shiftform :shiftList="shiftList" @getList="getshift"></shiftform>
<shiftform :shiftList="shiftList" @getLists="getshift"></shiftform>
</div>
<div style="width: 100%;margin-top: 20px">
<div style="width: 100%;height: 50px;display: flex;align-items: center;justify-content: center;border: 1px solid #d2d2d2;color: #409EFF;">
<div style="width: 100%;margin-top: 20px;border: 1px solid #d2d2d2;">
<div style="width: 100%;height: 50px;display: flex;align-items: center;justify-content: center;color: #409EFF;">
<i class="el-icon-d-arrow-left" @click="reduceMonth" style="font-size: 18px;"></i>
<span style="margin: 0 10px;">{{month.split('-')[0]}}{{month.split('-')[1]}}</span>
<i class="el-icon-d-arrow-right" @click="addMonth" style="font-size: 18px;"></i>
......@@ -38,7 +45,7 @@
>
<tr >
<th width="100" style="min-width: 100px;">
名字
</th>
<th width="50" style="min-width: 50px;" v-for="(item,index) in dayArry" :key="index">
<div>
......@@ -49,18 +56,63 @@
</tr>
<tr v-for="(item,index) in dataList.TeacherList" :key="index" v-if="dataList.TeacherList && dataList.TeacherList.length>0">
<td>{{item.TeacherName}}</td>
<td v-for="(x,y) in item.RDateList" :key="y" class="finger" @click="choicedate(x,index,y)" :style="{background:getcolor(x).background,color:getcolor(x).color}">
{{x.ShiftName}}
<td v-for="(x,y) in item.RDateList" :key="y" class="finger" @click="choicedate(item,x,index,y)" :style="{background:getcolor(x).background,color:getcolor(x).color}">
{{x.ShiftName?x.ShiftName.substring(0,1):''}}
<q-popup-proxy>
<q-banner v-if="isShowpopup">
<div style="width: 300px;" v-if="InfoMsg">
<q-card-section style="padding:10px 0">
<div class="text-h6">排课计划</div>
</q-card-section>
<div class="col-6">
<q-select filled stack-label option-value="Id" option-label="Name"
v-model="InfoMsg.row.ShiftId" ref="Id" :options="shiftList" label="关联班次"
dense class="col-6 q-pb-lg" emit-value map-options />
</div>
<div class="col-6" v-if="InfoMsg.row.ShiftId>0">
<q-select filled stack-label option-value="RoomId" option-label="RoomName"
v-model="InfoMsg.row.RoomId" ref="RoomId" :options="ClassRoomList" label="关联教室"
dense class="col-6 q-pb-lg" emit-value map-options />
</div>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" size="sm" @click="isShowpopup=false"
style="font-weight:400 !important" />
<q-btn label="确认" color="accent q-px-md" size="sm" style="font-weight:400 !important"
@click="addRowList()" />
</q-card-actions>
</div>
</q-banner>
</q-popup-proxy>
</td>
</tr>
</table>
<table
class="po_content singeRowTable"
style="border:1px solid #E6E6E6;margin-top: 50px;"
cellspacing="0"
cellpadding="0"
v-if="dataList.ShiftList&& dataList.ShiftList.length>0"
>
<tr v-for="(item,index) in dataList.ShiftList" :key="index" v-if="dataList.TeacherList && dataList.TeacherList.length>0">
<td width="100" style="min-width: 100px;">
<span class="yuan" :style="{ background: getcolor(item).background }" ></span>
{{item.ShiftName}}
</td>
<td width="50" style="min-width: 50px;" v-for="(x,y) in item.RDateList" :key="y" class="finger" >
<!-- <span v-if="x.Number==0">{{x.Number}}</span> -->
<span v-if="x.Number>0" style="color:#409EFF ;">{{x.Number}}</span>
</td>
<td width="50" style="min-width: 50px;" v-for="(x,y) in item.RDateList1" :key="y" class="finger" >
<!-- <span v-if="x.Number==0">{{x.Number}}</span> -->
<span v-if="x.Number>0" style="color:#409EFF ;">{{x.Number}}</span>
</td>
</tr>
</table>
</div>
<div v-if='!dataList.TeacherList||(dataList.TeacherList && dataList.TeacherList.length==0)'
style="width: 100%;border:1px solid #E6E6E6;display: flex;align-items: center;justify-content: center;height: 60px;">
暂无数据
......@@ -75,6 +127,7 @@
import {
getScrollPlanMonthList,
setScrollPlanInfo
} from '../../api/course/roll'
import {
queryClassRoomList,
......@@ -102,7 +155,7 @@ export default {
dataList:[],
dayArry:[],//天数列表
ClassRoomList:[],//教室列表
InfoMsg:null
}
},
created() {
......@@ -175,10 +228,10 @@ export default {
},
getshift(data){//从子组件获取班次的列表
this.shiftList = data;
this.shiftList = JSON.parse(JSON.stringify(data));
let obj = {
ShiftId: 0,
ShiftName: "休息"
Id: 0,
Name: "休息"
}
this.shiftList.push(obj)
......@@ -196,7 +249,7 @@ export default {
background:'#FFF',
color:'#111'
}
if(row.ShiftId>=0){//判断下 节约性能
if(row.ShiftId>0){//判断下 节约性能
for(let i = 0;i<this.shiftList.length;i++){
if(this.shiftList[i].Id == row.ShiftId){
obj.background = this.shiftList[i].Color
......@@ -205,11 +258,26 @@ export default {
}
}
}
if(row.ShiftId==0){
obj.background = '#E1E1E1'
obj.color = '#FFF';
}
return obj
},
choicedate(item,index,y){//点击某一个弹出
this.isShowpopup =true
console.log(item)
choicedate(item,x,index,y){//点击某一个弹出
console.log(item,x);
this.InfoMsg = {
index:index,
y:y,
row: JSON.parse(JSON.stringify(x)),
TeacherId:item.TeacherId
};
if(this.InfoMsg.row.ShiftId==-1){
this.InfoMsg.row.ShiftId = '';
this.InfoMsg.row.RoomId = ''
}
this.isShowpopup =true;
},
getList(type) {
this.loading = true;
......@@ -222,6 +290,49 @@ export default {
});
},
addRowList(){
let addMsg = {
Id:this.InfoMsg.row.PlanId,
Date:this.InfoMsg.row.Date,
ShiftId:this.InfoMsg.row.ShiftId,
RoomId:this.InfoMsg.row.RoomId,
TeacherId:this.InfoMsg.TeacherId,
}
if(addMsg.ShiftId===''){
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择关联班次`
})
return
}
if(addMsg.ShiftId>0 && addMsg.RoomId==''){
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择关联教室`
})
return
}
if(addMsg.ShiftId==0){
addMsg.RoomId = 0
}
setScrollPlanInfo(addMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.getList();
this.isShowpopup =false;
})
.catch(() => {
this.loading = false;
});
},
......
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