Browse Source

我的请假

zzp 2 years ago
parent
commit
b2a1ce98be
5 changed files with 386 additions and 47 deletions
  1. 6 4
      config/api.js
  2. 5 0
      pages.json
  3. 5 0
      pages/user/index.vue
  4. 207 0
      pagesMain/leaveRecord.vue
  5. 163 43
      pagesMember/venueDetail.vue

+ 6 - 4
config/api.js

@@ -1,11 +1,11 @@
 // const API_BASE = 'https://xinghuolanqiu.com/newApi'
 //const API_BASE = 'http://192.168.1.126:30000'
-const API_BASE = 'http://192.168.1.145/newApi'
+// const API_BASE = 'http://192.168.1.145/newApi'
 
-//const API_BASE = 'http://192.168.1.109/newApi'
+const API_BASE = 'http://192.168.1.109/newApi'
 // const API_BASE = 'http://192.168.1.117:8089/'
 // const API_BASE = 'http://192.168.1.126:30000'
-//const API_BASE = 'http://192.168.1.117:8089'
+// const API_BASE = 'http://192.168.1.117:8089'
 
 module.exports = {
 	//  微信授权登录
@@ -48,10 +48,12 @@ module.exports = {
 	setSignRemark: API_BASE + '/v2/class/setSignRemark',
 	//  学员报名
 	enlistStudent: API_BASE + '/v2/class/apply',
+	//  我的请假记录
+	stuLeaveLessonsList: API_BASE + '/v2/student/myCenter/stuLeaveLessonsList',
 	//  获取可预约学员列表
 	getSubscribeAbleList: API_BASE + '/v2/class/selectStudent',
 	//  学员预约
-	subscribeStudent: API_BASE + '/v2/class/appointment',
+	appointment: API_BASE + '/v2/class/appointment',
 	//  提交新增学员表单
 	submitStudentForm: API_BASE + '/v2/student/info/add',
 	//  提交学员预约表单

+ 5 - 0
pages.json

@@ -100,6 +100,11 @@
 			"style": {
 				"navigationBarTitleText": "我的评价"
 			}
+		}, {
+			"path": "leaveRecord",
+			"style": {
+				"navigationBarTitleText": "请假记录"
+			}
 		}, {
 			"path": "subscribeInfo",
 			"style": {

+ 5 - 0
pages/user/index.vue

@@ -102,6 +102,11 @@
 						path: 'evaluateList',
 						icon: API.getServerImg + 'pingjia.png'
 					},
+					{
+					 	label: '请假记录',
+					 	path: 'leaveRecord',
+					 	icon: API.getServerImg + 'yuyueList.png'
+					},
 					{
 					 	label: '预约体验记录',
 					 	path: 'subscribeListAll',

+ 207 - 0
pagesMain/leaveRecord.vue

@@ -0,0 +1,207 @@
+<template>
+	<view class="content">
+	<!-- 	<view class="filter-box">
+			<u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
+		</view> -->
+		<template v-if="tableList.length">
+			<scroll-view scroll-y class="scroll-box" :refresher-enabled="true" refresher-background="white">
+				<u-card :show-head="false" :foot-border-top="false" margin="10px 15px" borderRadius="40" :foot-style="{padding: '0 10px 5px 0'}" v-for="(site, index2) in tableList"
+				 :key="index2" class="card-box">
+					<view slot="body" class="card-content">
+						<view class="student-info">
+							<view style="width: 100%;margin-bottom: 5px;">
+								<text class="info-name" style="margin-right: 10px;">{{site.studentName}}</text>
+								<text class="info-name">{{site.className}}</text>
+							</view>
+							<view style="width: 100%;margin-bottom: 5px;">
+								<text class="info-name" style="margin-right: 10px;">{{site.leaveReason}}</text>
+								<text class="info-name">{{site.time}}</text>
+							</view>
+							<view class="info-phone" style="margin-bottom: 5px;">{{ site.type == 1 ? '事假' : '病假' }}</view>
+							<view class="info-phone">{{ site.agreeType == 1 ? '同意' : '不同意' }}</view>
+						</view>
+					</view>
+				</u-card>
+				<u-divider v-if="item.isOver" bg-color="transparent" :style="{paddingTop : tabList[0].tableList.length == 0 ? '10px' : ''}">没有更多了</u-divider>
+			</scroll-view>
+		</template>
+		<template v-else>
+			<u-empty mode="data"></u-empty>
+		</template>
+		</u-popup>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	import {
+		mapGetters
+	} from 'vuex'
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	export default {
+		computed: {
+			...mapGetters([
+				'customStyle',
+				'handleCustomStyle',
+			])
+		},
+		data() {
+			return {
+				customerId: '',
+				tableList: [],
+			}
+		},
+		onShow() {
+			this.tabList = Object.assign([], this.$options.data().tabList)
+			this.getTableList()
+		},
+		methods: {
+			//  获取列表数据
+			getTableList() {
+				NET.request(API.stuLeaveLessonsList, {
+					page: 1,
+					size: 100,
+				}, 'POST').then(res => {
+					this.triggered = false
+					this.tableList = res.data.row
+				})
+			},
+		},
+	}
+</script>
+
+<style>
+	page {
+		width: 100%;
+		height: 100%;
+		background-color: #f7f7f7;
+	}
+</style>
+<style lang="scss" scoped>
+	@import "@/static/css/themes.scss";
+
+	.content {
+		width: 100%;
+		float: left;
+		
+		.filter-box {
+			height: 48px;
+			padding: 10px 15px;
+			background-color: #FFFFFF;
+		}
+
+		.swiper-box {
+			height: calc(100vh - 82px);
+
+			.swiper-item {
+				height: calc(100vh - 82px);
+
+				.scroll-box {
+					width: 100%;
+					height: calc(100vh - 82px);
+
+					.card-box {
+						.card-content {
+							display: flex;
+							align-items: center;
+
+							.student-info {
+								flex: 1;
+
+								.info-name {
+									// width: 64px;
+									// float: left;
+									line-height: 28px;
+									font-size: 14px;
+									font-weight: bold;
+								}
+
+								.info-type {
+									padding: 0 10px;
+									margin-top: 3px;
+									border-radius: 20px;
+									float: left;
+									line-height: 20px;
+									font-size: 10px;
+									color: #FFFFFF;
+									background-color: #999999;
+								}
+
+								.info-type-active {
+									background-color: $mainColor;
+								}
+
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	.menber-box {
+		width: 100%;
+		// float: left;
+		padding: 10px 15px;
+		margin-bottom: 10px;
+		
+		.menber-col {
+			width: 100%;
+			padding: 15px;
+			margin-bottom: 10px;
+			display: inline-block;
+			background-color: #FFFFFF;
+			border-radius: 15px;
+			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+			position: relative;
+			overflow: hidden;
+			box-sizing: border-box;
+			
+			.menber-label {
+				width: 100%;
+				margin-bottom: 5px;
+				float: left;
+				font-size: 14px;
+				// line-height: 20px;
+			}
+	
+			.menber-num {
+				width: 100%;
+				float: left;
+				font-size: 26px;
+				line-height: 28px;
+				color: $mainColor;
+			}
+	
+			.menber-icon {
+				font-size: 100px;
+				color: $mainColor;
+				position: absolute;
+				right: -5px;
+				bottom: -30px;
+				opacity: 0.5;
+			}
+		}
+	}
+	.common-title {
+		width:100%;
+		text-align: center;
+		font-size: 20px;
+		margin: 10px 0;
+	}
+	.fix-add-icon {
+		position: fixed;
+		bottom: 15px;
+		right: 15px;
+	}
+	.button-box {
+		// width: 100%;
+		padding: 10px 15px;
+		box-sizing: border-box;
+	}
+	.info-phone {
+		font-size: 12px;
+		color: #999999;
+	}
+</style>
+

+ 163 - 43
pagesMember/venueDetail.vue

@@ -52,8 +52,11 @@
 					</view>
 				</view>
 				<view class="class-content" slot="foot" style="padding-bottom: 10px;text-align: right;">
-					<u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
-					 :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button>
+	<!-- 				<u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
+					 :hair-line="false" plain @click.stop="cardHandle(item, 1)">体验</u-button -->
+					 
+					 <u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
+					  :hair-line="false" plain @click.stop="cardHandle(item)">体验</u-button>
 					<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="cardHandle(item, 2)">报名</u-button> -->
 				</view>
 			</u-card>
@@ -70,18 +73,35 @@
 			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
 			 @click="goToSubscribelForm()">新增学员</u-button>
 		</u-popup>
-		<u-popup v-model="subscribeShow" mode="bottom" border-radius="30">
+		
+		<!-- 体验 -->
+		<u-popup v-model="appointShow" mode="center" border-radius="30" width="600rpx">
+			<view class="common-title">预约体验</view>
+			<view class="menber-box">
+				<u-form :model="form" ref="uForm" :rules="formRules">
+					<u-form-item label="学生" prop="studentName" required><u-input v-model="form.studentName" type="select" placeholder="请选择学生" @click="subscribeShow = true" /></u-form-item>
+					<u-form-item label="时间" prop="appointmentDate" required><u-input v-model="form.appointmentDate" type="select" placeholder="请选择时间"  @click="timeShow = true" /></u-form-item>
+				</u-form>
+			</view>
+			<view class="button-box">
+				<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="handleSubmitClick">确定</u-button>
+			</view>
+		</u-popup>
+		<!-- 学生 -->
+		<u-popup v-model="subscribeShow" mode="bottom" border-radius="30" z-index="11111">
 			<scroll-view scroll-y class="student-box">
 				<u-card :title="item.studentName" title-size="32" :head-style="cardStyle" :head-border-bottom="false" :show-foot="false"
-				 margin="10px" borderRadius="20" v-for="(item, index) in studentList2" :key="index" @click="subscribeStudent(item)">
+				 margin="10px" borderRadius="20" v-for="(item, index) in studentList2" :key="index" @click="handleChooseStudentClick(item)">
 					<view class="student-card" slot="body">
 						<view class="class-info-text">性别:{{item.sex}}&nbsp;&nbsp;年龄:{{item.age}}</view>
 					</view>
 				</u-card>
 			</scroll-view>
 			<u-button type="warning" shape="circle" :ripple="true" :custom-style="{...customStyle,margin:'15px',float: 'left',width: 'calc(100% - 30px)'}"
-			 @click="goToSubscribelForm()">新增学员</u-button>
+			 @click="goToSubscribelForm">新增学员</u-button>
 		</u-popup>
+		<!-- 时间 -->
+		<u-picker v-model="timeShow" mode="time" @confirm="handleChooseTimeClick"></u-picker>
 		<u-top-tips ref="uTips" zIndex="100000"></u-top-tips>
 	</view>
 </template>
@@ -111,6 +131,28 @@
 					desc: '',
 					classListResList: [],
 				},
+				formRules: {
+					studentName: [
+						{
+							required: true,
+							message: '请选择学生',
+							trigger: ['change']
+						}
+					],
+					appointmentDate: [
+						{
+							required: true,
+							message: '请选择时间',
+							trigger: ['change']
+						}
+					]
+				},
+				form: {
+					studentId: 0,
+					studentName: '',
+					appointmentDate: ''
+				},
+				appointShow: false,
 				menberList: [],
 				checkedCardList: [],
 				classId: '',
@@ -121,6 +163,7 @@
 				studentList1: [],
 				subscribeShow: false,
 				studentList2: [],
+				timeShow: false
 			}
 		},
 		onLoad(options) {
@@ -145,6 +188,9 @@
 				})
 			})
 		},
+		onReady() {
+			this.$refs.uForm.setRules(this.formRules);
+		},
 		onPullDownRefresh() {
 			this.initialize()
 			setTimeout(() => {
@@ -210,48 +256,44 @@
 			},
 			//  弹出
 			cardHandle(item, type) {
+				this.appointShow = true
 				this.classId = item.id
-				if (type == 1) {
-					this.subscribeShow = true
-				} else {
-					this.enlistShow = true
-				}
 			},
-			//  学员报名
-			enlistStudent(item) {
-				NET.request(API.enlistStudent, {
-					classId: this.classId,
-					studentId: item.studentId,
-				}, 'POST').then(res => {
-					this.enlistShow = false
-					this.$refs.uTips.show({
-						title: res.message,
-						type: 'success',
-					})
-				}).catch(error => {
-					this.$refs.uTips.show({
-						title: error.message,
-						type: 'warning',
-					})
-				})
+			//  选择预约时间
+			handleChooseTimeClick(args) {
+				this.form.appointmentDate = args.year + '-' + args.month + '-' + args.day
+				this.timeShow = false
 			},
 			//  学员预约
-			subscribeStudent(item) {
-				NET.request(API.subscribeStudent, {
-					classId: this.classId,
-					studentId: item.studentId,
-				}, 'POST').then(res => {
-					this.subscribeShow = false
-					this.$refs.uTips.show({
-						title: res.message,
-						type: 'success',
-					})
-				}).catch(error => {
-					this.$refs.uTips.show({
-						title: error.message,
-						type: 'warning',
-					})
-				})
+			handleChooseStudentClick(item) {
+				this.form.studentId = item.studentId
+				this.form.studentName = item.studentName
+				this.subscribeShow = false
+			},
+			//  确定
+			handleSubmitClick() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						NET.request(API.appointment, {
+							venueId: this.venueId,
+							classId: this.classId,
+							studentId: this.form.studentId,
+							appointmentDate: this.form.appointmentDate
+						}, 'POST').then(res => {
+							this.$refs.uTips.show({
+								title: res.message,
+								type: 'success',
+							})
+							this.appointShow = false
+						}).catch(error => {
+							this.$refs.uTips.show({
+								title: error.message,
+								type: 'warning',
+							})
+							this.appointShow = false
+						})
+					} 
+				});
 			},
 			//  跳转开通支付
 			handlePayClick() {
@@ -271,6 +313,24 @@
 					url: '/pagesMember/subscribelForm'
 				});
 			},
+			//  学员报名
+			enlistStudent(item) {
+				NET.request(API.enlistStudent, {
+					classId: this.classId,
+					studentId: item.studentId,
+				}, 'POST').then(res => {
+					this.enlistShow = false
+					this.$refs.uTips.show({
+						title: res.message,
+						type: 'success',
+					})
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.message,
+						type: 'warning',
+					})
+				})
+			},
 		},
 	}
 </script>
@@ -404,4 +464,64 @@
 			}
 		}
 	}
+	.menber-box {
+		width: 100%;
+		// float: left;
+		padding: 10px 15px;
+		margin-bottom: 10px;
+		
+		.menber-col {
+			width: 100%;
+			padding: 15px;
+			margin-bottom: 10px;
+			display: inline-block;
+			background-color: #FFFFFF;
+			border-radius: 15px;
+			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+			position: relative;
+			overflow: hidden;
+			box-sizing: border-box;
+			
+			.menber-label {
+				width: 100%;
+				margin-bottom: 5px;
+				float: left;
+				font-size: 14px;
+				// line-height: 20px;
+			}
+	
+			.menber-num {
+				width: 100%;
+				float: left;
+				font-size: 26px;
+				line-height: 28px;
+				color: $mainColor;
+			}
+	
+			.menber-icon {
+				font-size: 100px;
+				color: $mainColor;
+				position: absolute;
+				right: -5px;
+				bottom: -30px;
+				opacity: 0.5;
+			}
+		}
+	}
+	.common-title {
+		width:100%;
+		text-align: center;
+		font-size: 20px;
+		margin: 10px 0;
+	}
+	.fix-add-icon {
+		position: fixed;
+		bottom: 15px;
+		right: 15px;
+	}
+	.button-box {
+		// width: 100%;
+		padding: 10px 15px;
+		box-sizing: border-box;
+	}
 </style>