wkyy 2 年之前
父节点
当前提交
572af8ab9c
共有 4 个文件被更改,包括 283 次插入180 次删除
  1. 9 0
      apis/teacher/homePage.js
  2. 6 6
      pages/parents/mine/mine.vue
  3. 129 92
      pages/teacher/callNames/classCall.vue
  4. 139 82
      pages/teacher/homePage/homePage.vue

+ 9 - 0
apis/teacher/homePage.js

@@ -1,6 +1,15 @@
 import requestTeacher from '@/apis/utils/request.js';
 import Qs from 'qs';
 
+export function rptMyMonthCourse(data) {
+	var url='/mobile/teacher/course/rptMyMonthCourse';
+	return requestTeacher({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
 export function getMyLastSchedules(data) {
 	var url='/mobile/teacher/course/getMyLastSchedules';
 	return requestTeacher({

+ 6 - 6
pages/parents/mine/mine.vue

@@ -55,7 +55,7 @@
 		</view>
 
 		<view class="class-times">
-			<view class="box">
+			<!-- <view class="box">
 				<view class="times">
 					36节
 				</view>
@@ -71,7 +71,7 @@
 				<view class="text">
 					赠送课次
 				</view>
-			</view>
+			</view> -->
 		</view>
 
 		<view class="option-group">
@@ -524,10 +524,10 @@
 	}
 
 	.class-times {
-		border-radius: 12px;
-		background-color: rgba(255, 255, 255, 1);
-		display: flex;
-		padding: 20px 0;
+		// border-radius: 12px;
+		// background-color: rgba(255, 255, 255, 1);
+		// display: flex;
+		// padding: 20px 0;
 		margin: 12px 16px;
 
 		.box {

+ 129 - 92
pages/teacher/callNames/classCall.vue

@@ -4,15 +4,15 @@
 		<view class="main">
 			<view class="infos">
 				<view class="class">
-					芭蕾舞新生班
+					{{classList.className}}
 				</view>
 				<view class="item">
 					<view class="title">
 						上课时间:
 					</view>
 					<view class="value">
-						2023-01-03 08:30-10:00
-						
+						{{scheduleSheet.courseDate}} {{scheduleSheet.coursePeriods}}
+
 					</view>
 				</view>
 				<view class="item">
@@ -20,7 +20,7 @@
 						上课教室:
 					</view>
 					<view class="value">
-						二楼舞蹈一教室
+						{{classRoom.name}}
 					</view>
 				</view>
 				<view class="item">
@@ -28,7 +28,7 @@
 						授课老师:
 					</view>
 					<view class="value">
-						夏奕琳
+						{{employee.employeeName}}
 					</view>
 				</view>
 				<view class="item">
@@ -36,48 +36,55 @@
 						学员总数:
 					</view>
 					<view class="value">
-						20
+						{{studentList.length}}
 					</view>
 				</view>
 			</view>
 			<view class="tabs">
-				<u-tabs bar-width="80" inactive-color="#777777" active-color="#4F3C27" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
+				<u-tabs bar-width="80" inactive-color="#777777" active-color="#4F3C27" :list="list" :is-scroll="false"
+					:current="current" @change="change"></u-tabs>
 			</view>
 			<view class="details">
-				<view class="item" v-for="item in 2">
+				<view class="item"  v-for="(item,index) in studentList" :key="index">
 					<view class="picture">
-						<img src="../../../assets/img/photo@1x.png" alt="">
+						<u-avatar v-if="item.headPhoto != null" class="avatar" mode="square"
+							:src="item.headPhoto+'?x-oss-process=image/resize,m_fill,w_256,h_256'" size="112">
+							<img src="" alt="">
+						</u-avatar>
 					</view>
 					<view class="info">
 						<view class="name-tel">
 							<view class="name">
-								周梓轩
+								{{item.studentName}}
 							</view>
 							<view class="tel">
 								<view class="img">
 									<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
 								</view>
-								<view>17700112233</view>
+								<view>{{item.takerPhone}}</view>
 							</view>
 						</view>
 						<view class="else">
 							<view class="remain">
 								<view>剩余课时</view>
-								<view class="num">40</view>
+								<view class="num"></view>
 							</view>
 							<view class="leaved">
 								<view>已请假</view>
-								<view class="num">3</view>
+								<view class="num"></view>
 							</view>
 						</view>
-						
+
+					</view>
+					<view class="state" @click="showStudent(item)">
+						<view class="text" v-if="item.rollCallResult == '1'">到课</view>
+						<view class="text" v-if="item.rollCallResult == '2'">请假</view>
+						<view class="text" v-if="item.rollCallResult == '3'">旷课</view>
+						<view class="text" v-if="item.rollCallResult == '4'">补课</view>
+						<view class="icon">
+							<u-icon name="arrow-right" color="#cccccc"></u-icon>
+						</view>
 					</view>
-					<view class="state">
-												<view class="text">到课</view>
-												<view class="icon">
-													<u-icon name="arrow-right" color="#cccccc"></u-icon>
-												</view>
-											</view>
 				</view>
 			</view>
 			<!-- <u-cell-group>
@@ -92,7 +99,7 @@
 		</view>
 		<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="selectorObj" range-key="cateName"
 			@confirm="confirm"></u-picker>
-		<view class="student-details" v-for="(item,index) in studentList" :key="index">
+		<!-- <view class="student-details" v-for="(item,index) in studentList" :key="index">
 			<view class="photo">
 				<u-avatar v-if="item.headPhoto != null" class="avatar" mode="square"
 					:src="item.headPhoto+'?x-oss-process=image/resize,m_fill,w_256,h_256'" size="112">
@@ -112,12 +119,12 @@
 					</view>
 				</view>
 				<view class="class-leave">
-					<!-- <view class="class">
+					<view class="class">
 						剩余课时<text>40</text>
-					</view> -->
-					<!-- <view class="leave">
+					</view>
+					<view class="leave">
 						已请假<text>1</text>
-					</view> -->
+					</view>
 				</view>
 			</view>
 			<view class="to-class" @click="showStudent(item)" v-if="item.rollCallResult == '1'">
@@ -135,7 +142,7 @@
 			<view class="to-class" @click="showStudent(item)" v-else>
 				<u-icon name="arrow-right" color="#cccccc"></u-icon>
 			</view>
-		</view>
+		</view> -->
 		<!-- 底部 -->
 		<view class="bottom">
 			<view class="sign-result">
@@ -163,7 +170,7 @@
 			<view class="set-btn">
 				<view class="set">
 					<view class="set-text">点名结果批量设置</view>
-					<view class="choose">
+					<view class="choose" @click="show = true">
 						<view class="text">
 							到课
 						</view>
@@ -182,7 +189,7 @@
 
 <script>
 	import * as callNamesApi from '@/apis/teacher/callNames.js'
-	
+
 	export default {
 		data() {
 			return {
@@ -213,19 +220,19 @@
 						id: '4'
 					}
 				],
-					list: [{
-									name: '正常18'
-								}, {
-									name: '请假1	'
-								}, {
-									name: '停课1',
-									
-								}],
-								current: 0
+				list: [{
+					name: '正常18'
+				}, {
+					name: '请假1	'
+				}, {
+					name: '停课1',
+
+				}],
+				current: 0
 			}
 		},
 		onLoad(op) {
-			if(op.id) {
+			if (op.id) {
 				this.sheetId = op.id;
 				this.getRollCallDetail();
 			}
@@ -236,7 +243,7 @@
 					title: "加载中",
 					mask: true,
 				})
-				callNamesApi.rollCallSignIn(this.sheetId,this.studentList).then((response) => {
+				callNamesApi.rollCallSignIn(this.sheetId, this.studentList).then((response) => {
 					uni.hideLoading();
 					this.getRollCallDetail();
 				}).catch(error => {
@@ -252,7 +259,7 @@
 					mask: true,
 				})
 				callNamesApi.rollCallDetail({
-					sheetId: this.sheetId 
+					sheetId: this.sheetId
 				}).then((response) => {
 					uni.hideLoading();
 					this.classList = response.data.class;
@@ -275,14 +282,14 @@
 				this.studentId = item.studentId;
 			},
 			confirm(obj) {
-				if(!this.studentId){
+				if (!this.studentId) {
 					this.resultName = this.selectorObj[obj[0]].cateName;
 					for (var i = 0; i < this.studentList.length; i++) {
 						this.studentList[i].rollCallResult = this.selectorObj[obj[0]].id;
 					}
-				}else {
+				} else {
 					for (var i = 0; i < this.studentList.length; i++) {
-						if(this.studentId == this.studentList[i].studentId) {
+						if (this.studentId == this.studentList[i].studentId) {
 							this.studentList[i].rollCallResult = this.selectorObj[obj[0]].id;
 						}
 					}
@@ -290,94 +297,112 @@
 				}
 			},
 			change(index) {
-							this.current = index;
-						}
+				this.current = index;
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	.main {
-		
-		background: linear-gradient(180deg, rgba(13,186,199,1) 0%,rgba(244,246,246,1) 100%);
-		.infos{
+
+		background: linear-gradient(180deg, rgba(13, 186, 199, 1) 0%, rgba(244, 246, 246, 1) 100%);
+
+		.infos {
 			color: #fff;
 			padding: 32rpx;
-			.class{
+
+			.class {
 				color: rgba(255, 255, 255, 1);
 				font-size: 48rpx;
 				font-weight: bold;
 				margin-bottom: 16rpx;
 			}
-			.item{
+
+			.item {
 				display: flex;
 				margin-top: 16rpx;
-				.value{
+
+				.value {
 					margin-left: 8rpx;
 				}
 			}
 		}
-		.tabs{
+
+		.tabs {
 			border-radius: 16px 16px 0px 0px;
 			background-color: rgba(255, 255, 255, 1);
 			height: 88rpx;
 			padding: 0 170rpx;
 		}
-		.details{
+
+		.details {
 			background-color: #fff;
-			.item{
+
+			.item {
 				padding: 24rpx 32rpx;
 				display: flex;
 				border-top: 1px solid rgba(229, 231, 234, 1);
-				.picture{
+
+				.picture {
 					width: 112rpx;
 					height: 112rpx;
-					img{
+
+					img {
 						width: 100%;
 						height: 100%;
 					}
 				}
-				.info{
+
+				.info {
 					margin-left: 24rpx;
 					display: flex;
 					flex-direction: column;
 					justify-content: space-around;
-					.name-tel{
+
+					.name-tel {
 						display: flex;
 						align-items: center;
-						
-						.name{
+
+						.name {
 							color: rgba(51, 51, 51, 1);
 							font-size: 18px;
-							font-weight:bold
+							font-weight: bold
 						}
-						.tel{
+
+						.tel {
 							color: rgba(119, 119, 119, 1);
-                            display: flex;
-							align-items: center;	
-							line-height: 32rpx; 
+							display: flex;
+							align-items: center;
+							line-height: 32rpx;
 							margin-left: 24rpx;
-							.img{
+
+							.img {
 								width: 32rpx;
 								height: 32rpx;
 								margin-right: 8rpx;
-								img{
+
+								img {
 									width: 100%;
 									height: 100%;
-									
+
 								}
 							}
 						}
 					}
-					.else{
+
+					.else {
 						display: flex;
 						align-items: center;
-						.remain,.leaved{
+
+						.remain,
+						.leaved {
 							display: flex;
 							color: rgba(119, 119, 119, 1);
 							align-items: center;
-							margin-right:24rpx;
-							.num{
+							margin-right: 24rpx;
+
+							.num {
 								width: 40rpx;
 								height: 32rpx;
 								line-height: 32rpx;
@@ -389,19 +414,21 @@
 								margin-left: 8rpx;
 							}
 						}
-						
+
 					}
-				
+
 				}
-				.state{
+
+				.state {
 					display: flex;
-					align-items: center;
+					align-items: end;
 					margin-left: auto;
-					
-					.text{
+
+					.text {
 						color: rgba(51, 51, 51, 1);
 					}
-					.icon{
+
+					.icon {
 						margin-left: 8rpx;
 					}
 				}
@@ -578,50 +605,60 @@
 						background-color: rgba(0, 187, 170, 1);
 					}
 				}
-				.stop{
+
+				.stop {
 					color: rgba(238, 49, 56, 1);
-					text{
-						background-color: rgba(238, 49, 56, 1); ;
+
+					text {
+						background-color: rgba(238, 49, 56, 1);
+						;
 					}
 				}
 			}
 		}
 
-		.set-btn{
+		.set-btn {
 			display: flex;
-			 margin-top: 20rpx;
-			.set{
+			margin-top: 20rpx;
+
+			.set {
 				display: flex;
 				align-items: center;
-				.set-text{
+
+				.set-text {
 					color: rgba(51, 51, 51, 1);
 				}
-				.choose{
+
+				.choose {
 					margin-left: 34rpx;
 					display: flex;
 					align-items: center;
 					height: 20px;
-					.text{
+
+					.text {
 						color: rgba(13, 186, 199, 1);
 						font-weight: bold;
 					}
-					.icon{
+
+					.icon {
 						margin-left: 8rpx;
 					}
 				}
 			}
-			.btn{
+
+			.btn {
 				width: 272rpx;
 				margin-left: auto;
 			}
+
 			button {
-				
+
 				border-radius: 50px;
 				background-color: rgba(13, 186, 199, 1);
 				color: rgba(255, 255, 255, 1);
 				font-size: 16px;
 				height: 80rpx;
-				line-height:80rpx ;
+				line-height: 80rpx;
 			}
 		}
 	}

+ 139 - 82
pages/teacher/homePage/homePage.vue

@@ -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 {