wkyy 2 năm trước cách đây
mục cha
commit
cbe6dd3242

+ 38 - 1
pages/teacher/callNames/callNames.vue

@@ -13,13 +13,17 @@
 				<view class="check" @click="beforeWeek">
 				<view class="check" @click="beforeWeek">
 					<u-icon name="arrow-left" size="32"></u-icon>前一周
 					<u-icon name="arrow-left" size="32"></u-icon>前一周
 				</view>
 				</view>
-				<view class="date">
+				<view class="date" @click="show = true">
 					{{date}}
 					{{date}}
 				</view>
 				</view>
 				<view class="check" @click="afterWeek">
 				<view class="check" @click="afterWeek">
 					后一周<u-icon name="arrow-right" size="32"></u-icon>
 					后一周<u-icon name="arrow-right" size="32"></u-icon>
 				</view>
 				</view>
 			</view>
 			</view>
+			
+			<u-picker mode="time" v-model="show" :params="params" :defaultTime="defaultTime" @confirm="confirm">
+			</u-picker>
+			
 			<view class="date-item">
 			<view class="date-item">
 				<view class="item" v-for="(item,index) in weekDate" :key="index"
 				<view class="item" v-for="(item,index) in weekDate" :key="index"
 					:class="activeClass == index ? 'checked' : ''" @click="activeClassClick(item,index)">
 					:class="activeClass == index ? 'checked' : ''" @click="activeClassClick(item,index)">
@@ -114,12 +118,43 @@
 				activeClass: 0,
 				activeClass: 0,
 				weekDate1: '',
 				weekDate1: '',
 				callList: [],
 				callList: [],
+				defaultTime: '',
+				params: {
+					year: true,
+					month: true,
+					day: true,
+					hour: false,
+					minute: false,
+					second: false,
+					timestamp: true
+				},
+				show: false,
 			}
 			}
 		},
 		},
 		onReady() {
 		onReady() {
 			this.getToday();
 			this.getToday();
 		},
 		},
 		methods: {
 		methods: {
+			confirm(params) {
+				this.weekDate = [];
+				let pickerDate = params.year + "-" + params.month + "-" + params.day;
+				let year = params.year;
+				let month = parseInt(params.month);
+				let day = parseInt(params.day);
+				let mydate = new Date(year, month - 1, day);
+				let weekday = mydate.getDay();
+				this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
+				
+				this.getWeekDate();
+				
+				for (var m = 0; m < this.weekDate.length; m++) {
+					if (pickerDate == this.weekDate[m].day) {
+						this.activeClass = m;
+						this.date = this.weekDate[m].day;
+					}
+				}
+				this.getCallList();
+			},
 			getCallList() {
 			getCallList() {
 				this.callList = [];
 				this.callList = [];
 				uni.showLoading({
 				uni.showLoading({
@@ -158,6 +193,8 @@
 				let mydate = new Date(year, month - 1, day);
 				let mydate = new Date(year, month - 1, day);
 				let weekday = mydate.getDay();
 				let weekday = mydate.getDay();
 				this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
 				this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
+				this.defaultTime = this.getFormatDate(date, true);
+				
 				this.getWeekDate(true);
 				this.getWeekDate(true);
 			},
 			},
 			getWeekDate(bl) {
 			getWeekDate(bl) {

+ 26 - 2
pages/teacher/callNames/classCall.vue

@@ -116,10 +116,13 @@
 					签到结果
 					签到结果
 				</view>
 				</view>
 				<view class="result">
 				<view class="result">
-					<view class="itemClass arrive">
+					<view class="itemClass leave" @click="qbStudent">
+						全部<text>{{dkNum+qkNum}}</text>
+					</view>
+					<view class="itemClass arrive" @click="dkStudent">
 						到课<text>{{dkNum}}</text>
 						到课<text>{{dkNum}}</text>
 					</view>
 					</view>
-					<view class="itemClass leave">
+					<view class="itemClass leave" @click="qkStudent">
 						缺课<text>{{qkNum}}</text>
 						缺课<text>{{qkNum}}</text>
 					</view>
 					</view>
 					<!-- <view class="itemClass truant">
 					<!-- <view class="itemClass truant">
@@ -209,6 +212,27 @@
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
+			qbStudent() {
+				this.rollCallList = this.studentList;
+			},
+			dkStudent() {
+				var list = [];
+				for (var i = 0; i < this.studentList.length; i++) {
+					if(this.studentList[i].rollCallResult == '1') {
+						list.push(this.studentList[i]);
+					}
+				}
+				this.rollCallList = list;
+			},
+			qkStudent() {
+				var list = [];
+				for (var i = 0; i < this.studentList.length; i++) {
+					if(this.studentList[i].rollCallResult == '6') {
+						list.push(this.studentList[i]);
+					}
+				}
+				this.rollCallList = list; 
+			},
 			getRollCallSignIn() {
 			getRollCallSignIn() {
 				uni.showLoading({
 				uni.showLoading({
 					title: "加载中",
 					title: "加载中",