Commit 3c8afa97 authored by 黄奎's avatar 黄奎

调出插班

parent f24647e1
<template> <template>
<view class="" :style="{'padding-bottom': `${statusBarHeight}px` }"> <view class="" :style="{'padding-bottom': `${statusBarHeight}px` }">
<view style="height: 100rpx"></view> <view style="height: 100rpx;margin-top: 20rpx;"></view>
<view class="navbar"> <view class="navbar">
<van-nav-bar title="课表" fixed title-class="navTitle"> <van-nav-bar title="课表" fixed title-class="navTitle">
<view slot="left" class="chooseDate flex flex_start_center"> <view slot="left" class="chooseDate flex flex_start_center">
...@@ -64,18 +64,23 @@ ...@@ -64,18 +64,23 @@
<view v-for="(item, index) in dataList" :key="index" v-if="dataList.length > 0"> <view v-for="(item, index) in dataList" :key="index" v-if="dataList.length > 0">
<!-- <Item :data="item" /> --> <!-- <Item :data="item" /> -->
<view class="plan-box" v-for="(x,i) in item.PlanTimeList" :key="i"> <view class="plan-box" v-for="(x,i) in item.PlanTimeList" :key="i">
<!-- :class="{ 'calendar-active': activeDay === item.day ,'calendar-leave':isLeave(item),'calendar-leave2':isLeave2(item)}"> -->
<view class="left-time"> <view class="left-time">
<view>
<view class="icon"> <view class="icon">
上课时间 上课时间
</view> </view>
<view class="time-text"> <view class="time-text">
{{x.StartTime}} {{x.StartTime}}
</view> </view>
<view class="guodu"> </view>
<!-- <view class="guodu">
<text>·</text> <text>·</text>
<text>·</text> <text>·</text>
<text>·</text> <text>·</text>
</view> </view> -->
<view>
<view class="icon"> <view class="icon">
下课时间 下课时间
</view> </view>
...@@ -83,6 +88,41 @@ ...@@ -83,6 +88,41 @@
{{x.EndTime}} {{x.EndTime}}
</view> </view>
</view> </view>
<!-- 调班时间 -->
<view v-if="item.show&&item.IsOut==1">
<view class="icon" >
上课时间:
</view>
<view class="time-text" >
{{item.OutInfo.StartTime}}
</view>
</view>
<view v-if="item.show&&item.IsOut==1">
<view class="icon" >
下课时间:
</view>
<view class="time-text" >
{{item.OutInfo.EndTime}}
</view>
</view>
<!-- 插班时间 -->
<view v-if="item.show&&item.IsIn==1">
<view class="icon" >
上课时间:
</view>
<view class="time-text" >
{{item.InInfo.StartTime}}
</view>
</view>
<view v-if="item.show&&item.IsIn==1">
<view class="icon" >
下课时间:
</view>
<view class="time-text" >
{{item.InInfo.EndTime}}
</view>
</view>
</view>
<view class="right-info"> <view class="right-info">
<view class="class-name">{{item.ClassName}}</view> <view class="class-name">{{item.ClassName}}</view>
<view class="teacher-box"> <view class="teacher-box">
...@@ -103,10 +143,69 @@ ...@@ -103,10 +143,69 @@
<text v-if="x.IsCheck==0 && item.Finished==1" style="color:#282828">出勤</text> <text v-if="x.IsCheck==0 && item.Finished==1" style="color:#282828">出勤</text>
<text v-else-if="x.IsCheck==2 && item.Finished==1" style="color:orange">请假</text> <text v-else-if="x.IsCheck==2 && item.Finished==1" style="color:orange">请假</text>
<text v-else-if="item.Finished==1" style="color:red">缺勤</text> <text v-else-if="item.Finished==1" style="color:red">缺勤</text>
<view style="width:1px;flex:1;text-align: right;display: flex;align-items: center;justify-content: flex-end;"> <view
<text :style="{background:item.Finished==1?'#ddd':'#FFD694'}" style="display: inline-block;width: 26rpx;height: 26rpx;border-radius: 50%;margin-right: 10rpx;"></text> style="width:1px;flex:1;text-align: right;display: flex;align-items: center;justify-content: flex-end;">
<text :style="{color:item.Finished==1?'#ddd':'#282828'}">{{item.Finished==1?'已上课':'未上课'}}</text> <text :style="{background:item.Finished==1?'#ddd':'#FFD694'}"
style="display: inline-block;width: 26rpx;height: 26rpx;border-radius: 50%;margin-right: 10rpx;"></text>
<text
:style="{color:item.Finished==1?'#ddd':'#282828'}">{{item.Finished==1?'已上课':'未上课'}}</text>
</view>
</view>
<!-- <view class="teacher-box" style='color: red;' v-if='item.IsOut==1'>
<text style="margin:0 10rpx;"></text>
<text>调出</text>
</view> -->
<!-- 调出 -->
<view v-if="item.show&&item.IsOut==1">
<view class="teacher-box">
<van-icon name="underway" />
<text style="margin:0 10rpx;">时间:</text>
<text>{{item.OutInfo.ClassDate}}</text>
</view>
<view class="teacher-box">
<van-icon name="wap-home" />
<text style="margin:0 10rpx;width: 120rpx;">班级:</text>
<text>{{item.OutInfo.ClassName}}</text>
</view>
<view class="teacher-box">
<van-icon name="manager" />
<text style="margin:0 10rpx;">老师:</text>
<view class="teacher-name">{{item.OutInfo.TeacherName}}</view>
</view>
<view class="teacher-box">
<van-icon name="wap-home" />
<text style="margin:0 10rpx;">教室:</text>
<text>{{item.OutInfo.RoomName}}</text>
</view>
</view>
<!-- 插班 -->
<view v-if="item.show&&item.IsIn==1">
<view class="teacher-box">
<van-icon name="underway" />
<text style="margin:0 10rpx;">时间:</text>
<text>{{item.InInfo.ClassDate}}</text>
</view>
<view class="teacher-box">
<van-icon name="wap-home" />
<text style="margin:0 10rpx;width: 100rpx;">班级:</text>
<text>{{item.InInfo.ClassName}}</text>
</view>
<view class="teacher-box">
<van-icon name="manager" />
<text style="margin:0 10rpx;">老师:</text>
<view class="teacher-name">{{item.InInfo.TeacherName}}</view>
</view>
<view class="teacher-box">
<van-icon name="wap-home" />
<text style="margin:0 10rpx;">教室:</text>
<text>{{item.InInfo.RoomName}}</text>
</view>
</view> </view>
<view class="details" v-if="!item.show&&(item.IsOut==1||item.IsIn==1)" @click="more(item)">
{{item.IsOut==1?'调出':'插班'}}详情
</view>
<view class="details" v-if="item.show&&(item.IsOut==1||item.IsIn==1)" @click="Putaway(item)">
收起
</view> </view>
</view> </view>
</view> </view>
...@@ -145,7 +244,9 @@ ...@@ -145,7 +244,9 @@
import { import {
getStundentPlanStatistical getStundentPlanStatistical
} from "../../api/erp.js"; } from "../../api/erp.js";
import { VersionUpdate } from '../../utils/index.js' import {
VersionUpdate
} from '../../utils/index.js'
export default { export default {
name: "", name: "",
props: {}, props: {},
...@@ -154,15 +255,15 @@ ...@@ -154,15 +255,15 @@
tabbar tabbar
}, },
setup(props) { setup(props) {
if(uni.getStorageSync('userInfo') && !uni.getStorageSync('erpUserInfo')){ if (uni.getStorageSync('userInfo') && !uni.getStorageSync('erpUserInfo')) {
uni.reLaunch({ uni.reLaunch({
url:'/pages/person/bind' url: '/pages/person/bind'
}) })
return; return;
} }
const Toast = inject('$toast') const Toast = inject('$toast')
const indexData=uni.getStorageSync('indexData') const indexData = uni.getStorageSync('indexData')
let weekArr = ["日", "一", "二", "三", "四", "五", "六"]; let weekArr = ["日", "一", "二", "三", "四", "五", "六"];
//年月选择 //年月选择
let currentDate = ref(0); let currentDate = ref(0);
...@@ -252,8 +353,8 @@ ...@@ -252,8 +353,8 @@
ClassId: indexData.ClassId, ClassId: indexData.ClassId,
StartTime: "", StartTime: "",
EndTime: "", EndTime: "",
CouseId:indexData.CourseId, CouseId: indexData.CourseId,
ClassScrollType:indexData.ClassScrollType ClassScrollType: indexData.ClassScrollType
}, },
statusBarHeight: 0, statusBarHeight: 0,
dataList: [], dataList: [],
...@@ -284,20 +385,28 @@ ...@@ -284,20 +385,28 @@
timer: null, //防抖 timer: null, //防抖
}); });
let methods = { let methods = {
// 查看详情
more(item) {
item.show = !item.show
},
// 收起
Putaway(item) {
item.show = !item.show
},
VersionUpdate, VersionUpdate,
// 获取当天数据 // 获取当天数据
async getData() { async getData() {
data.dataList=null data.dataList = null
data.loading = true data.loading = true
setTimeout(()=>{ setTimeout(() => {
data.dataList=[] data.dataList = []
data.allData.forEach(x=>{ data.allData.forEach(x => {
if(x.ClassDateStr==data.msg.StartTime){ if (x.ClassDateStr == data.msg.StartTime) {
data.dataList.push(x) data.dataList.push(x)
} }
}); });
data.loading = false data.loading = false
},1000) }, 1000)
//if(data.msg.ClassId<=0) return //if(data.msg.ClassId<=0) return
// data.loading = true // data.loading = true
// let res = await getStundentPlanStatistical(data.msg); // let res = await getStundentPlanStatistical(data.msg);
...@@ -308,18 +417,27 @@ ...@@ -308,18 +417,27 @@
}, },
//获取当月数据 //获取当月数据
async getAllData() { async getAllData() {
console.log(activeDay.value) console.log('lll', activeDay.value)
if(data.msg.ClassId<=0) return if (data.msg.ClassId <= 0) return
loadingS() loadingS()
try { try {
let res = await getStundentPlanStatistical(data.msg); let res = await getStundentPlanStatistical(data.msg);
Toast.clear() Toast.clear()
if (data.timer) data.timer = null if (data.timer) data.timer = null
if (res) { if (res) {
let list = res.Data;
let addList = function(arr) {
arr.forEach(item => {
item.show = false
});
};
addList(list);
//data.dataList = res.Data; //data.dataList = res.Data;
data.allData = res.Data; data.allData = list;
data.msg.StartTime = currentDate.value + "-" + activeDay.value; data.msg.StartTime = currentDate.value + "-" + activeDay.value;
methods.getData() methods.getData()
console.log('kkk', data.allData)
} }
} catch { } catch {
Toast.clear() Toast.clear()
...@@ -390,33 +508,33 @@ ...@@ -390,33 +508,33 @@
// }); // });
}, },
initSwiper(){ initSwiper() {
const date=new Date() const date = new Date()
const y=date.getFullYear() const y = date.getFullYear()
const m=date.getMonth()+1 const m = date.getMonth() + 1
const d=date.getDate() const d = date.getDate()
let obj={ let obj = {
y, y,
m, m,
} }
let obj1={ let obj1 = {
y, y,
m:m-1, m: m - 1,
} }
let obj2={ let obj2 = {
y, y,
m:m+1, m: m + 1,
} }
if(m==1){ if (m == 1) {
obj1.y=y-1 obj1.y = y - 1
obj1.m=12 obj1.m = 12
} }
if(m==12){ if (m == 12) {
obj1.y=y+1 obj1.y = y + 1
obj1.m=1 obj1.m = 1
} }
data.swiperArr=[obj1,obj,obj2] data.swiperArr = [obj1, obj, obj2]
data.swiperArrDemo=[obj1,obj,obj2] data.swiperArrDemo = [obj1, obj, obj2]
console.log(data.swiperArr, data.swiperArrDemo) console.log(data.swiperArr, data.swiperArrDemo)
}, },
changeSwiper(val, PreId) { changeSwiper(val, PreId) {
...@@ -499,9 +617,9 @@ ...@@ -499,9 +617,9 @@
sliceWeek(today); sliceWeek(today);
wx.getSystemInfo({ wx.getSystemInfo({
success(res) { success(res) {
let lift=res.screenHeight-res.safeArea.bottom let lift = res.screenHeight - res.safeArea.bottom
let tabbarHeight=Number(lift)+50 let tabbarHeight = Number(lift) + 50
data.statusBarHeight=tabbarHeight data.statusBarHeight = tabbarHeight
} }
}) })
//data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight+52; //data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight+52;
...@@ -538,6 +656,12 @@ ...@@ -538,6 +656,12 @@
</script> </script>
<style scoped> <style scoped>
.details {
font-size: 14px;
color: red;
margin-top: 20rpx;
}
.swiper { .swiper {
/* min-height: 400rpx; */ /* min-height: 400rpx; */
height: 620rpx; height: 620rpx;
...@@ -606,7 +730,7 @@ ...@@ -606,7 +730,7 @@
.calendar-active { .calendar-active {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
background-color: rgba(220,50,65, 0.9) !important; background-color: rgba(220, 50, 65, 0.9) !important;
border-radius: 50%; border-radius: 50%;
color: #FFFFFF !important; color: #FFFFFF !important;
} }
...@@ -668,35 +792,47 @@ ...@@ -668,35 +792,47 @@
width: 65px; width: 65px;
height: auto; height: auto;
} }
.plan-box{
.plan-box {
border-radius: 20rpx; border-radius: 20rpx;
background-color: #FFF; background-color: #FFF;
box-shadow: 0 0 20rpx #D0D0D0; box-shadow: 0 0 20rpx #D0D0D0;
padding:0; padding: 0;
display: flex; display: flex;
align-items: flex-start; flex-direction: row;
justify-content: center;
margin:0 32rpx; align-items:stretch;
margin: 0 32rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.plan-box .left-time{
.plan-box .left-time {
border-top-left-radius: 20rpx; border-top-left-radius: 20rpx;
border-bottom-left-radius: 20rpx; border-bottom-left-radius: 20rpx;
background-color: #F5F5F5; background-color: #F5F5F5;
padding: 40rpx; padding:0rpx 40rpx;
display: flex;
flex-direction: column;
align-items: center;
/* justify-content: center */
justify-content: space-around;
} }
.plan-box .left-time .icon{
font-size: 18rpx;
color:#666;
.plan-box .left-time .icon {
font-size: 18rpx;
color: #666;
} }
.plan-box .left-time .time-text{
.plan-box .left-time .time-text {
font-size: 40rpx; font-size: 40rpx;
font-weight:bolder; font-weight: bolder;
color:#282828; color: #282828;
} }
.plan-box .left-time .guodu{
.plan-box .left-time .guodu {
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -704,46 +840,54 @@ ...@@ -704,46 +840,54 @@
flex-direction: column; flex-direction: column;
margin: 20rpx 0; margin: 20rpx 0;
} }
.plan-box .left-time .guodu text{
.plan-box .left-time .guodu text {
font-size: 60rpx; font-size: 60rpx;
color: #eee; color: #eee;
font-weight: bolder; font-weight: bolder;
line-height: 20rpx; line-height: 20rpx;
} }
.plan-box .right-info { .plan-box .right-info {
width: 1rpx; width: 1rpx;
flex: 1; flex: 1;
padding:40rpx; padding: 40rpx;
} }
.plan-box .right-info { .plan-box .right-info {
padding:40rpx; padding: 40rpx;
} }
.plan-box .right-info .class-name{
.plan-box .right-info .class-name {
font-size: 32rpx; font-size: 32rpx;
color:#000; color: #000;
text-overflow: -o-ellipsis-lastline; text-overflow: -o-ellipsis-lastline;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
line-clamp: 2; line-clamp: 2;
} }
.plan-box .right-info .teacher-box{
margin:20rpx 0; .plan-box .right-info .teacher-box {
margin: 20rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
color:#888; color: #888;
} }
.plan-box .right-info .teacher-head{
width:60rpx; .plan-box .right-info .teacher-head {
width: 60rpx;
height: 60rpx; height: 60rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 20rpx; margin-right: 20rpx;
background-color: #DDD; background-color: #DDD;
} }
.plan-box .right-info .teacher-name{
.plan-box .right-info .teacher-name {
/* font-size: 24rpx; /* font-size: 24rpx;
color:#444; */ color:#444; */
} }
......
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