|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
- <view @click="show=false">
|
|
|
+ <view>
|
|
|
<view class="navigation">
|
|
|
启航教培管家·教师端
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 课时信息 -->
|
|
|
<view class="class-infos-box">
|
|
|
<view class="title">
|
|
@@ -17,24 +17,25 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 详细信息 -->
|
|
|
<view class="main">
|
|
|
- <view class="time">
|
|
|
- <u-picker mode="time" v-model="show" :params="params"></u-picker>
|
|
|
- <view class="show" @click.stop="show=!show">
|
|
|
- <view class="text">
|
|
|
- 2023年1月
|
|
|
- </view>
|
|
|
- <view class="icon">
|
|
|
- <u-icon name="arrow-down" color="#fff" size="32"></u-icon>
|
|
|
- </view>
|
|
|
-
|
|
|
+ <view class="time">
|
|
|
+ <u-picker mode="time" v-model="show" :params="params" :defaultTime="defaultTime" @confirm="confirm">
|
|
|
+ </u-picker>
|
|
|
+ <view class="show" @click="show = true">
|
|
|
+ <view class="text">
|
|
|
+ {{teachTime}}
|
|
|
</view>
|
|
|
- <view class="select" v-show="show">
|
|
|
- 2023年1月
|
|
|
+ <view class="icon">
|
|
|
+ <u-icon name="arrow-down" color="#fff" size="32"></u-icon>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
+ <!-- <view class="select" v-show="show">
|
|
|
+ 2023年1月
|
|
|
+ </view> -->
|
|
|
+ </view>
|
|
|
<!-- <view class="time">
|
|
|
|
|
|
<view class="week" v-for="(item,index) in list" :key="index"
|
|
@@ -54,7 +55,7 @@
|
|
|
<view class="infos">
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 9
|
|
|
+ {{courseRpt.chargeNum != null ? courseRpt.chargeNum : 0}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
收费课时
|
|
@@ -63,7 +64,7 @@
|
|
|
<u-line color="#E5E7EA" direction="col" length="80" />
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 9
|
|
|
+ {{courseRpt.freeNum != null ? courseRpt.freeNum : 0}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
赠送课时
|
|
@@ -72,7 +73,7 @@
|
|
|
<u-line color="#E5E7EA" direction="col" length="80" />
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 9
|
|
|
+ {{courseRpt.makeupNum != null ? courseRpt.makeupNum : 0}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
补课课时
|
|
@@ -80,7 +81,7 @@
|
|
|
</view>
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 100
|
|
|
+ {{rollcallRpt.shouldNum != null ? rollcallRpt.shouldNum : 0}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
应到人次
|
|
@@ -89,7 +90,7 @@
|
|
|
<u-line color="#E5E7EA" direction="col" length="80" />
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 99
|
|
|
+ {{rollcallRpt.realNum != null ? rollcallRpt.realNum : 0}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
实到人次
|
|
@@ -98,7 +99,7 @@
|
|
|
<u-line color="#E5E7EA" direction="col" length="80" />
|
|
|
<view class="infos-item">
|
|
|
<view class="content">
|
|
|
- 1
|
|
|
+ {{rollcallRpt.shouldNum-rollcallRpt.realNum}}
|
|
|
</view>
|
|
|
<view class="infos-name">
|
|
|
未到/请假
|
|
@@ -107,7 +108,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 最近课程 -->
|
|
|
<view class="course" v-if="courseList.length != 0">
|
|
|
<view class="title">
|
|
@@ -224,14 +225,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<Tabbar :current="0" ref="tabbarMain"></Tabbar>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import * as homePageApi from '@/apis/teacher/homePage.js'
|
|
|
-
|
|
|
+
|
|
|
import Tabbar from '@/components/Tabbar.vue'
|
|
|
export default {
|
|
|
components: {
|
|
@@ -239,15 +240,28 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ courseRpt: {
|
|
|
+ chargeNum: 0,
|
|
|
+ freeNum: 0,
|
|
|
+ makeupNum: 0
|
|
|
+ },
|
|
|
+ rollcallRpt: {
|
|
|
+ realNum: 0,
|
|
|
+ shouldNum: 0
|
|
|
+ },
|
|
|
+ rptMonth: '',
|
|
|
+ teachTime: '',
|
|
|
+ defaultTime: '',
|
|
|
params: {
|
|
|
- year: true,
|
|
|
- month: true,
|
|
|
- day: false,
|
|
|
- hour: false,
|
|
|
- minute: false,
|
|
|
- second: false
|
|
|
- },
|
|
|
- show: false,
|
|
|
+ year: true,
|
|
|
+ month: true,
|
|
|
+ day: false,
|
|
|
+ hour: false,
|
|
|
+ minute: false,
|
|
|
+ second: false,
|
|
|
+ timestamp: true
|
|
|
+ },
|
|
|
+ show: false,
|
|
|
list: [{
|
|
|
name: '今日'
|
|
|
}, {
|
|
@@ -269,27 +283,65 @@
|
|
|
onReady() {
|
|
|
this.getDateList();
|
|
|
this.getLatelyCourseList();
|
|
|
+ this.getRptMyMonthCourse();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getRptMyMonthCourse() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ homePageApi.rptMyMonthCourse({
|
|
|
+ rptMonth: this.rptMonth
|
|
|
+ }).then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if(response.data.courseRpt != null) {
|
|
|
+ this.courseRpt = response.data.courseRpt;
|
|
|
+ }
|
|
|
+ if(response.data.rollcallRpt != null) {
|
|
|
+ this.rollcallRpt = response.data.rollcallRpt;
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirm(params) {
|
|
|
+ var month = '';
|
|
|
+ if (params.month.slice(0, 1) == '0') {
|
|
|
+ month = params.month.slice(1);
|
|
|
+ } else {
|
|
|
+ month = params.month;
|
|
|
+ }
|
|
|
+ this.teachTime = params.year + '年' + month + '月';
|
|
|
+ this.rptMonth = params.year + '-' + params.month;
|
|
|
+ this.getRptMyMonthCourse();
|
|
|
+ },
|
|
|
getDateList() {
|
|
|
let date = new Date() //当前日期
|
|
|
- let year = date.getFullYear();//当前年
|
|
|
- let month = date.getMonth()+1;//当前月
|
|
|
+ let year = date.getFullYear(); //当前年
|
|
|
+ let month = date.getMonth() + 1; //当前月
|
|
|
let day = date.getDate(); //当天
|
|
|
- let mydate = new Date(year,month-1,day);
|
|
|
+ let mydate = new Date(year, month - 1, day);
|
|
|
let weekday = mydate.getDay();
|
|
|
let weekDate1 = new Date(year, month - 1, day + 1 - weekday);
|
|
|
let weekDate2 = new Date(year, month - 1, day + 7 - weekday);
|
|
|
-
|
|
|
- this.day = this.getFormatDate(date,true);
|
|
|
- this.tomorrow = this.getFormatDate(new Date(date.setDate(date.getDate() + 1)),true);
|
|
|
+
|
|
|
+ this.day = this.getFormatDate(date, true);
|
|
|
+ this.tomorrow = this.getFormatDate(new Date(date.setDate(date.getDate() + 1)), true);
|
|
|
console.log(this.tomorrow)
|
|
|
- this.weekStartDate = this.getFormatDate(weekDate1,true);
|
|
|
- this.weekEndDate = this.getFormatDate(weekDate2,true);
|
|
|
- this.monthStartDate = this.getFormatDate(date,false) + "-" + '01';
|
|
|
-
|
|
|
+ this.weekStartDate = this.getFormatDate(weekDate1, true);
|
|
|
+ this.weekEndDate = this.getFormatDate(weekDate2, true);
|
|
|
+ this.monthStartDate = this.getFormatDate(date, false) + "-" + '01';
|
|
|
+
|
|
|
let days = new Date(year, month + 1, 0).getDate();
|
|
|
- this.monthEndDate = this.getFormatDate(date,false) + "-" + days;
|
|
|
+ this.monthEndDate = this.getFormatDate(date, false) + "-" + days;
|
|
|
+
|
|
|
+ this.defaultTime = this.getFormatDate(date, true);
|
|
|
+ this.teachTime = year + '年' + month + '月';
|
|
|
+ this.rptMonth = this.getFormatDate(date, false);
|
|
|
},
|
|
|
getLatelyCourseList() {
|
|
|
uni.showLoading({
|
|
@@ -300,7 +352,7 @@
|
|
|
count: 2
|
|
|
}).then((response) => {
|
|
|
uni.hideLoading();
|
|
|
- this.courseList = response.data;
|
|
|
+ this.courseList = response.data;
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -308,23 +360,23 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- getFormatDate(date,m) {
|
|
|
+ getFormatDate(date, m) {
|
|
|
let myyear = date.getFullYear();
|
|
|
- let mymonth = date.getMonth()+1;
|
|
|
- let myweekday = date.getDate();
|
|
|
- if(mymonth < 10){
|
|
|
+ let mymonth = date.getMonth() + 1;
|
|
|
+ let myweekday = date.getDate();
|
|
|
+ if (mymonth < 10) {
|
|
|
mymonth = "0" + mymonth;
|
|
|
}
|
|
|
- if(myweekday < 10){
|
|
|
+ if (myweekday < 10) {
|
|
|
myweekday = "0" + myweekday;
|
|
|
}
|
|
|
- if(m) {
|
|
|
+ if (m) {
|
|
|
return (myyear + "-" + mymonth + "-" + myweekday);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return (myyear + "-" + mymonth);
|
|
|
}
|
|
|
},
|
|
|
- activeClassClick(item,index) {
|
|
|
+ activeClassClick(item, index) {
|
|
|
this.activeClass = index;
|
|
|
if (this.activeClass == 0) {
|
|
|
console.log(this.day)
|
|
@@ -390,40 +442,45 @@
|
|
|
margin: auto;
|
|
|
}
|
|
|
|
|
|
- .time{
|
|
|
- margin-bottom: 36rpx;
|
|
|
-
|
|
|
- .show{
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- border-radius: 50px;
|
|
|
- background-color: rgba(13, 186, 199, 1);
|
|
|
- font-size: 16px;
|
|
|
- text-align: center;
|
|
|
- height: 64rpx;
|
|
|
- margin: 0 224rpx;
|
|
|
- position: relative;
|
|
|
- .text{
|
|
|
- font-size: 32rpx;
|
|
|
- color: rgba(255, 255, 255, 1);
|
|
|
- }
|
|
|
- icon{
|
|
|
-
|
|
|
- margin-left: 8rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- .select{
|
|
|
+ .time {
|
|
|
+ margin-bottom: 36rpx;
|
|
|
+
|
|
|
+ .show {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ border-radius: 50px;
|
|
|
+ background-color: rgba(13, 186, 199, 1);
|
|
|
+ font-size: 16px;
|
|
|
+ text-align: center;
|
|
|
+ height: 64rpx;
|
|
|
+ margin: 0 224rpx;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .text {
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: rgba(255, 255, 255, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ icon {
|
|
|
+
|
|
|
+ margin-left: 8rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .select {
|
|
|
position: absolute;
|
|
|
- left: 260rpx;;
|
|
|
- right: 260rpx;;
|
|
|
+ left: 260rpx;
|
|
|
+ ;
|
|
|
+ right: 260rpx;
|
|
|
+ ;
|
|
|
background-color: #fff;
|
|
|
z-index: 999;
|
|
|
- box-shadow:0px 0px 8px 0px #E8E8E8 ;
|
|
|
- height: 72rpx;
|
|
|
- line-height: 72rpx;
|
|
|
+ box-shadow: 0px 0px 8px 0px #E8E8E8;
|
|
|
+ height: 72rpx;
|
|
|
+ line-height: 72rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.date {
|