Bläddra i källkod

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 2 år sedan
förälder
incheckning
2368c22552

+ 171 - 29
pages/clock/the_clock.vue

@@ -1,38 +1,105 @@
 <template>
 	<view>
-		<view class='wrap'>
-			<view class="c-row">
-				<view class="title">打卡原因</view>
-				<view style='padding:0;' class="con-list">
-					<u-radio-group activeColor="#22C572" v-model="typevalue">
-						<u-radio key="3" label="下班" name="3">下班</u-radio>
-						<u-radio key="1" label="上班" name="1">上班</u-radio>
-					</u-radio-group>
+		<view class="dk" v-if="value==0">
+			<view class='wrap'>
+				<view class="c-row">
+					<view class="title">打卡原因</view>
+					<view style='padding:0;' class="con-list">
+						<u-radio-group activeColor="#22C572" v-model="typevalue">
+							<u-radio key="3" label="下班" name="3">下班</u-radio>
+							<u-radio key="1" label="上班" name="1">上班</u-radio>
+						</u-radio-group>
+					</view>
 				</view>
-			</view>
-			<view class="c-row">
-				<view class="title">目标位置</view>
-				<view class="con-list">
-					<view @click='show=true'>{{detailData.targetLocation}}</view>
-					<u-picker :range="warehouseBaseInfoList" range-key="warehouseName" @confirm='targetLPicker($event)'
-						v-model="show" mode="selector">
-					</u-picker>
+				<view class="c-row">
+					<view class="title">目标位置</view>
+					<view class="con-list">
+						<view @click='show=true'>{{detailData.targetLocation}}</view>
+						<u-picker :range="warehouseBaseInfoList" range-key="warehouseName"
+							@confirm='targetLPicker($event)' v-model="show" mode="selector">
+						</u-picker>
+					</view>
 				</view>
-			</view>
-			<view class="c-row">
-				<view class="title">打卡距离</view>
-				<view class="con-list">
-					<view>{{clockDistance}}</view>
+				<view class="c-row">
+					<view class="title">打卡距离</view>
+					<view class="con-list">
+						<view>{{clockDistance}}</view>
+					</view>
 				</view>
 			</view>
+			<view>
+				<u-button type="primary" class="submit" hover-class="none" @click="submit">打卡</u-button>
+			</view>
 		</view>
-		<view>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+		<view class="jl" v-else>
+			<view class="uni-container">
+				<view class="top">
+					<view class="center">月份</view>
+					<view @click='show=true'>{{createDate}}</view>
+					<u-picker v-model="show" mode="time" @confirm='dateChange($event)' :params="params"></u-picker>
+				</view>
+				<uni-table border stripe emptyText="暂无更多数据">
+					<!-- 表头行 -->
+					<uni-tr>
+						<uni-th align="center" width="50">日期</uni-th>
+						<uni-th align="center" width="50">上班时间</uni-th>
+						<uni-th align="center" width="50">下班时间</uni-th>
+					</uni-tr>
+					<!-- 表格数据行 -->
+					<uni-tr v-for="(item, index) in tableData" :key="index">
+						<uni-td align="center" style="height: 30px;">{{ item.createDate.split(" ")[0]  }}</uni-td>
+						<uni-td align="center">
+							<view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}
+							</view>
+							<view class="toClockDate" v-else-if="!item.toClockDate">
+								<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
+									class="uni-button" size="mini" type="primary" align="center"
+									style="height: 30px;">补卡</button>
+								<button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular'
+									size="mini" type="primary" align="center" style="height: 30px;">审核中</button>
+								<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
+									type="primary" align="center" style="height: 30px;">补卡失败</button>
+								<button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
+									type="primary" align="center" style="height: 30px;">补卡成功</button>
+							</view>
+						</uni-td>
+						<uni-td align="center">
+							<view class="offClockDate" v-if="item.offClockDate">{{ item.offClockDate.split(" ")[1] }}
+							</view>
+							<view class="offClockDate" v-else-if="!item.offClockDate">
+								<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
+									class="uni-button" size="mini" type="primary" align="center"
+									style="height: 30px;">补卡</button>
+								<button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular'
+									size="mini" type="primary" align="center" style="height: 30px;">审核中</button>
+								<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
+									type="primary" align="center" style="height: 30px;">补卡失败</button>
+								<button v-if='item.status=="补卡成功"' class='listitemStatus pass Regular' size="mini"
+									type="primary" align="center" style="height: 30px;">补卡成功</button>
+							</view>
+						</uni-td>
+					</uni-tr>
+				</uni-table>
+			</view>
 		</view>
-
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
-			<u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button>
+			<view @click='clocksubmit'>
+				<image v-if='value==0' class="img" src="../../static/img/oa_office/leave/dkc.png" mode="widthFix">
+				</image>
+				<image v-else class="img" src="../../static/img/oa_office/leave/dk.png" mode="widthFix">
+				</image>
+				<view :style='{"color":value==0?"#22C572":"#000"}'>打卡</view>
+			</view>
+			<view @click='clockRecord' style=''>
+				<image v-if='value==1' class="img" src="../../static/img/oa_office/leave/jilu-check.png"
+					mode="widthFix">
+				</image>
+				<image v-else class="img" src="../../static/img/oa_office/leave/jilu.png" mode="widthFix">
+				</image>
+				<view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
+			</view>
+			<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
 
 		</view>
 	</view>
@@ -42,6 +109,11 @@
 	export default {
 		data() {
 			return {
+				params: {
+					year: true,
+					month: true
+				},
+				value: 0,
 				typevalue: '1',
 				show: false,
 				detailData: {
@@ -57,6 +129,9 @@
 
 			}
 		},
+		onShow() {
+			this.getList()
+		},
 		onLoad() {
 			console.log(uni.getStorageSync("clockwerehouse"))
 			if (!uni.getStorageSync("clockwerehouse")) {
@@ -70,8 +145,27 @@
 			}
 
 			// this.getLocation()
+			let _day = new Date();
+			_day.setTime(_day.getTime());
+			this.createDate = _day.getFullYear() + "-" + (_day.getMonth() + 1);
 		},
 		methods: {
+			dateChange(e) {
+				console.log(e)
+				this.createDate = e.year + "-" + e.month
+				uni.showLoading({
+					title: "加载中",
+					mask: true
+				})
+				this.getList()
+			},
+			clocksubmit() {
+				this.value = 0
+				uni.setNavigationBarTitle({
+					title: '打卡功能'
+				});
+			},
+
 			calculate() {
 				const query = uni.createSelectorQuery().in(this);
 				query.selectAll('.left')
@@ -159,6 +253,7 @@
 									console.log(res.data)
 									if (res.data.code == 200) {
 										that.$api.msg('提交成功')
+										that.value = 1
 									} else {
 										that.$api.msg('提交失败')
 									}
@@ -168,8 +263,34 @@
 				})
 			},
 			clockRecord() {
-				uni.navigateTo({
-					url: '/pages/clock/the_clock_record'
+				this.value = 1
+				uni.setNavigationBarTitle({
+					title: '记录'
+				});
+				uni.showLoading({
+					title: '加载中',
+					mask: true
+				})
+				this.getList()
+				// uni.navigateTo({
+				// 	url: '/pages/clock/the_clock_record'
+				// })
+			},
+			getList() {
+				this.$api.doRequest('get', '/clockInfo/selectClockInfo', {
+					pageSize: 100,
+					currentPage: 1,
+					pcFlag: 0,
+					yearMonth: this.createDate,
+					compId: uni.getStorageSync('pcUserInfo').compId,
+					commonId: uni.getStorageSync('pcUserInfo').userId,
+				}).then(res => {
+					if (res.data.code == 200) {
+						uni.hideLoading()
+						this.tableData = res.data.data.records
+						this.$forceUpdate() //刷新data数据
+
+					}
 				})
 			},
 		}
@@ -252,9 +373,10 @@
 		}
 	} */
 	.submit {
-		width: 40%;
+		width: 80%;
 		background: #22C572;
-		border-radius: 10rpx;
+		border-radius: 50rpx;
+		margin-top: 50rpx;
 	}
 
 	.bottom-btn {
@@ -265,6 +387,7 @@
 		bottom: 0rpx;
 		display: flex;
 		z-index: 9999;
+		justify-content: space-evenly;
 	}
 
 	.buns_item {
@@ -285,4 +408,23 @@
 	/deep/.u-radio-group {
 		flex-direction: row-reverse;
 	}
+
+	.img {
+		width: 50rpx;
+	}
+
+	.uni-container {
+		padding: 20rpx;
+
+		.top {
+			display: flex;
+			align-items: center;
+			margin-bottom: 20rpx;
+
+			.center {
+				margin-right: 20rpx;
+			}
+		}
+
+	}
 </style>

+ 10 - 22
pages/clock/the_clock_record.vue

@@ -1,13 +1,11 @@
 <template>
 	<view>
-				<!-- <d-rili></d-rili> -->
-				<calendar showDot='true' :extraData='extraData' bgColor='#22C572' @monthTap='monthTap'></calendar>
 		<view class="uni-container">
-			<!-- <view class="top">
+			<view class="top">
 				<view class="center">月份</view>
 				<view @click='show=true'>{{createDate}}</view>
 				<u-picker v-model="show" mode="time" @confirm='dateChange($event)' :params="params"></u-picker>
-			</view> -->
+			</view>
 			<uni-table border stripe emptyText="暂无更多数据">
 				<!-- 表头行 -->
 				<uni-tr>
@@ -21,8 +19,9 @@
 					<uni-td align="center">
 						<view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}</view>
 						<view class="toClockDate" v-else-if="!item.toClockDate">
-							<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)' class="uni-button" size="mini"
-								type="primary" align="center" style="height: 30px;">补卡</button>
+							<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
+								class="uni-button" size="mini" type="primary" align="center"
+								style="height: 30px;">补卡</button>
 							<button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular' size="mini"
 								type="primary" align="center" style="height: 30px;">审核中</button>
 							<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
@@ -34,8 +33,9 @@
 					<uni-td align="center">
 						<view class="offClockDate" v-if="item.offClockDate">{{ item.offClockDate.split(" ")[1] }}</view>
 						<view class="offClockDate" v-else-if="!item.offClockDate">
-							<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)' class="uni-button" size="mini"
-								type="primary" align="center" style="height: 30px;">补卡</button>
+							<button v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
+								class="uni-button" size="mini" type="primary" align="center"
+								style="height: 30px;">补卡</button>
 							<button v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular' size="mini"
 								type="primary" align="center" style="height: 30px;">审核中</button>
 							<button v-if='item.status=="补卡失败"' class='listitemStatus notPass Regular' size="mini"
@@ -51,16 +51,9 @@
 </template>
 
 <script>
-	import dRili from '@/components/d-rili/d-rili.vue';
-	import calendar from '@/components/tale-calendar/calendar.vue';
 	export default {
-		components:{
-			dRili,
-			calendar
-		},
 		data() {
 			return {
-				extraData:[{date: '2022-10-10', value: '签到', dot: true, active: true}],
 				isSHowBtn: true,
 				show: false,
 				tableData: [],
@@ -71,8 +64,8 @@
 					month: true
 				},
 				isLoadMore: false,
-				createDate:'',
-				createDate1:'',
+				createDate: '',
+				createDate1: '',
 
 			}
 		},
@@ -91,7 +84,6 @@
 			this.createDate = _day.getFullYear() + "." + (_day.getMonth() + 1);
 			this.createDate1 = _day.getFullYear() + "-" + (_day.getMonth() + 1);
 		},
-		
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.currentPage += 1
@@ -99,10 +91,6 @@
 			this.getData()
 		},
 		methods: {
-			monthTap(e){
-				this.createDate1 = e.year + "-" + e.month
-				console.log(e)
-			},
 			dateChange(e) {
 				console.log(e)
 				this.createDate = e.year + "." + e.month

+ 240 - 108
pages/leave/the_leave.vue

@@ -1,110 +1,150 @@
 <template>
-	<view>
-		<view class='wrap'>
-			<view class="c-row">
-				<view class="title">请假类型</view>
-				<view class="con-list">
-					<view @click='show=true'>{{detailData.leaveType}} ></view>
-					<u-picker :range="leaveTypeList" range-key="leaveType"@confirm='ltCheck($event)' v-model="show" mode="selector">
-					</u-picker>
+	<view class="content">
+		<view class="" v-if="value==0">
+			<view class='wrap'>
+				<view class="c-row">
+					<view class="title">请假类型</view>
+					<view class="con-list">
+						<view @click='show=true'>{{detailData.leaveType}} ></view>
+						<u-picker :range="leaveTypeList" range-key="leaveType" @confirm='ltCheck($event)' v-model="show"
+							mode="selector">
+						</u-picker>
+					</view>
 				</view>
-			</view>
-			<view class="c-row">
-				<view class="title">开始时间</view>
-				<view class="con-list">
-					<view @click='show1=true'>{{detailData.startDate}} ></view>
-					<u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
-					</u-picker>
+				<view class="c-row">
+					<view class="title">开始时间</view>
+					<view class="con-list">
+						<view @click='show1=true'>{{detailData.startDate}} ></view>
+						<u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
+						</u-picker>
+					</view>
 				</view>
-			</view>
-			<view class="c-row">
-				<view class="title">结束时间</view>
-				<view class="con-list">
-					<view @click='show2=true'>{{detailData.endDate}} ></view>
-					<u-picker v-model="show2" mode="time" @confirm='dateChange1($event)' :params="params">
-					</u-picker>
+				<view class="c-row">
+					<view class="title">结束时间</view>
+					<view class="con-list">
+						<view @click='show2=true'>{{detailData.endDate}} ></view>
+						<u-picker v-model="show2" mode="time" @confirm='dateChange1($event)' :params="params">
+						</u-picker>
+					</view>
+				</view>
+				<view class="c-row">
+					<view class="title">时长</view>
+					<view class="con-list">
+						<input v-model='detailData.leaveDuration' placeholder="请输入时长"></input>
+					</view>
+				</view>
+				<view class="c-row">
+					<view class="left">请假事由</view>
+				</view>
+				<view style='position:relative;' class="wrap no-boder">
+					<u-input class='textarea' v-model="detailData.reasonForLeave" :type="type" :border="border"
+						:height="height" :auto-height="autoHeight" />
+					<view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
+						{{detailData.reasonForLeave.length}}/100个字
+					</view>
+				</view>
+				<view style='margin:5px 0;'>
+					<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
 				</view>
 			</view>
-			<view class="c-row">
-				<view class="title">时长</view>
-				<view class="con-list">
-					<input  v-model='detailData.leaveDuration' placeholder="请输入时长"></input>
+		</view>
+		<view class="" v-else>
+
+			<view class='wrap' v-for="(item, index) in tableData" :key="index">
+				<view class="wenzi audit1" v-if="item.approveStatus == '待人事审核' || item.approveStatus == '待主管审核' ">审核中
+				</view>
+				<view class="wenzi audit2" v-if="item.status == '已通过'">已通过</view>
+				<view class="wenzi audit3" v-if="item.status == '未通过'">未通过</view>
+				<view class="c-row">
+					<view class="title">请假类型 : {{item.leaveType}}</view>
+				</view>
+				<view class="c-row">
+					<view class="title">请假事由 : {{item.reasonForLeave}}</view>
+				</view>
+				<view class="c-row">
+					<view class="title">开始时间 : {{item.startDate}}</view>
+				</view>
+				<view class="c-row">
+					<view class="title">结束时间 : {{item.endDate}}</view>
 				</view>
 			</view>
-			<view class="c-row">
-				<view class="left">请假事由</view>
+			<view v-show="isLoadMore">
+				<uni-load-more :status="loadStatus"></uni-load-more>
 			</view>
-			<view style='position:relative;' class="wrap no-boder">
-				<u-input class='textarea' v-model="detailData.reasonForLeave" :type="type" :border="border"
-					:height="height" :auto-height="autoHeight" />
-				<view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
-					{{detailData.reasonForLeave.length}}/100个字
+			<view class="bottom-btn">
+				<view>
+					<view style='width:100%;' class='flex flex-space-between'>
+						<view @click='clocksubmit' style='width:50%;text-align:center;'>
+							<image v-if='value==0' class="u-page__item__slot-icon"
+								src="../../static/img/oa_office/leave/qingjia-check.png"></image>
+							<image v-else class="u-page__item__slot-icon"
+								src="../../static/img/oa_office/leave/qingjia.png"></image>
+							<view :style='{"color":value==0?"#22C572":"#000"}'>请假</view>
+						</view>
+						<view @click='clockRecord' style='width:50%;text-align:center;'>
+							<image v-if='value==1' class="u-page__item__slot-icon"
+								src="../../static/img/oa_office/leave/jilu-check.png"></image>
+							<image v-else class="u-page__item__slot-icon"
+								src="../../static/img/oa_office/leave/jilu.png"></image>
+							<view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
+						</view>
+					</view>
 				</view>
+
+				<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
+
 			</view>
 		</view>
-		
-		<!-- <view class="footer">
-			<view @click='clockRecord' class="button">记录</view>
-			<view @click='submit' class="button">提交</view>
-		</view> -->
+
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
-			<view style='margin:5px 0;'>
-				<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
-			</view>
+
 			<view>
 				<view style='width:100%;' class='flex flex-space-between'>
 					<view @click='clocksubmit' style='width:50%;text-align:center;'>
-						<image
-						v-if='value==0'
-							class="u-page__item__slot-icon"
-							src="../../static/img/oa_office/leave/qingjia-check.png"
-						></image>
-						<image
-						v-else
-							class="u-page__item__slot-icon"
-							src="../../static/img/oa_office/leave/qingjia.png"
-						></image>
+						<image v-if='value==0' class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/qingjia-check.png"></image>
+						<image v-else class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/qingjia.png"></image>
 						<view :style='{"color":value==0?"#22C572":"#000"}'>请假</view>
 					</view>
 					<view @click='clockRecord' style='width:50%;text-align:center;'>
-						<image
-						v-if='value==1'
-							class="u-page__item__slot-icon"
-							src="../../static/img/oa_office/leave/jilu-check.png"
-						></image>
-						<image
-						v-else
-							class="u-page__item__slot-icon"
-							src="../../static/img/oa_office/leave/jilu.png"
-						></image>
+						<image v-if='value==1' class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/jilu-check.png"></image>
+						<image v-else class="u-page__item__slot-icon" src="../../static/img/oa_office/leave/jilu.png">
+						</image>
 						<view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
 					</view>
 				</view>
 			</view>
-			
+
 			<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
-			
+
 		</view>
 	</view>
 </template>
 
 <script>
-	
+	import dRili from '@/components/d-rili/d-rili.vue';
 	export default {
-		
+		components: {
+			dRili
+		},
 		data() {
 			return {
-				
+				isLoadMore: false, //是否加载中
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				pageSize: 10,
+				currentPage: 1,
 				show: false,
 				show1: false,
 				show2: false,
 				detailData: {
-					leaveType:'选择请假类型',
-					reasonForLeave:"",
-					startDate:'',
-					endDate:'选择结束时间',
-					leaveDuration:'',
+					leaveType: '选择请假类型',
+					reasonForLeave: "",
+					startDate: '',
+					endDate: '选择结束时间',
+					leaveDuration: '',
 				},
 				params: {
 					year: true,
@@ -112,9 +152,9 @@
 					day: true,
 					hour: true,
 					minute: true,
-					
+
 				},
-				value:0,
+				value: 0,
 				type: 'textarea',
 				border: true,
 				height: 150,
@@ -131,28 +171,65 @@
 
 			}
 		},
+		onReachBottom() { //上拉触底函数
+			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
+				this.isLoadMore = true
+				this.currentPage += 1
+				this.getList()
+			}
+		},
 		onLoad(options) {
-			let h 
-			let m 
+			let h
+			let m
 			let s
 			let _day = new Date();
 			_day.setTime(_day.getTime());
-			if(_day.getHours() < 10 ){
-				 h = "0" + _day.getHours()
-			}
-			else{
-				h =  _day.getHours()
+			if (_day.getHours() < 10) {
+				h = "0" + _day.getHours()
+			} else {
+				h = _day.getHours()
 			}
-			if(_day.getMinutes() < 10 ){
-				 m = "0" + _day.getMinutes()
-			}
-			else{
+			if (_day.getMinutes() < 10) {
+				m = "0" + _day.getMinutes()
+			} else {
 				m = _day.getMinutes()
 			}
-			this.detailData.startDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate()
-			+ " " + h + ":" + m;
+			this.detailData.startDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate() +
+				" " + h + ":" + m;
+		},
+		onShow() {
+			this.getList()
 		},
 		methods: {
+			getList() {
+				this.$api.doRequest('get', '/leaveInfo/selectLeaveInfo', {
+					pageSize: this.pageSize,
+					currentPage: this.currentPage,
+					pcFlag: 0,
+					compId: uni.getStorageSync('pcUserInfo').compId,
+					commonId: uni.getStorageSync('pcUserInfo').userId,
+				}).then(res => {
+					// if (res.data.code == 200) {
+					// 	this.tableData = res.data.data.records
+
+					// }
+					if (res.data.code == 200) {
+						if (res.data.data.records.length > 0) {
+							this.isLoadMore = false
+							this.loadStatus = 'loading'
+						} else {
+							this.isLoadMore = true
+							this.loadStatus = 'nomore'
+						}
+						if (this.currentPage == 1) {
+							this.tableData = res.data.data.records
+						} else {
+							this.tableData = this.tableData.concat(res.data.data.records)
+						}
+
+					}
+				})
+			},
 			calculate() {
 				const query = uni.createSelectorQuery().in(this);
 				query.selectAll('.left')
@@ -160,24 +237,23 @@
 			},
 			ltCheck(e) {
 				this.detailData.leaveType = this.leaveTypeList[e].leaveType
-				if(this.detailData.leaveType = "事假"){
+				if (this.detailData.leaveType = "事假") {
 					this.detailData.leaveTypeKey = "1"
-				}
-				else{
+				} else {
 					this.detailData.leaveTypeKey = "3"
 				}
 			},
 			dateChange(e) {
 				this.detailData.startDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 				// this.startDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
-				 // + ":" + "00"
+				// + ":" + "00"
 			},
 			dateChange1(e) {
 				this.detailData.endDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
-				var endtime=new Date(this.detailData.endDate)
-				var starttime=new Date(this.detailData.startDate)
-				console.log(endtime-starttime)
-				this.detailData.leaveDuration=Math.floor((endtime-starttime)/(3600*1000))
+				var endtime = new Date(this.detailData.endDate)
+				var starttime = new Date(this.detailData.startDate)
+				console.log(endtime - starttime)
+				this.detailData.leaveDuration = Math.floor((endtime - starttime) / (3600 * 1000))
 				// this.endDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
 			},
 			submit() {
@@ -213,13 +289,19 @@
 							that.detailData.dept = uni.getStorageSync('pcUserInfo').deptName
 							that.detailData.phone = uni.getStorageSync('pcUserInfo').userMobilePhone
 							that.detailData.empName = uni.getStorageSync('userInfo').userName
+							uni.showLoading({
+								title: '加载中',
+								mask: true
+							})
 							that.$api.doRequest('post', '/leaveInfo/api/addLeave', that.detailData)
 								.then(res => {
 									if (res.data.code == 200) {
 										that.$api.msg('提交成功')
-										uni.navigateTo({
-											url: '/pages/leave/the_leave_record'
-										})
+										uni.hideLoading()
+										that.value = 1
+										// uni.navigateTo({
+										// 	url: '/pages/leave/the_leave_record'
+										// })
 									} else {
 										that.$api.msg('提交失败')
 									}
@@ -229,14 +311,23 @@
 				})
 			},
 			clockRecord() {
-				uni.navigateTo({
-					url: '/pages/leave/the_leave_record'
-				})
+				this.value = 1
+				uni.setNavigationBarTitle({
+					title: '请假记录'
+				});
+				this.getList()
+				// uni.navigateTo({
+				// 	url: '/pages/leave/the_leave_record'
+				// })
 			},
 			clocksubmit() {
-				uni.navigateTo({
-					url: '/pages/leave/the_leave'
-				})
+				this.value = 0
+				uni.setNavigationBarTitle({
+					title: '请假'
+				});
+				// uni.navigateTo({
+				// 	url: '/pages/leave/the_leave'
+				// })
 			},
 		},
 	}
@@ -282,8 +373,10 @@
 		padding-right: 20rpx;
 	}
 
+
 	.wrap {
-		padding-bottom: 10px;
+		padding-top: 15px;
+		padding-bottom: 20px;
 		font-size: 14px;
 		background: #fff;
 		margin: 10px;
@@ -297,9 +390,39 @@
 			padding: 10px 16px;
 		}
 
+		.wenzi {
+			text-align: right;
+			border-radius: 10rpx;
+			margin-right: 30rpx;
+			height: 10rpx;
+		}
+
+		.audit1 {
+			color: red;
+		}
+
+		.audit2 {
+			color: #afafe6;
+		}
+
+		.audit3 {
+			color: red;
+		}
+
+		.c-row {
+			display: -webkit-box;
+			display: -webkit-flex;
+			display: flex;
+			-webkit-box-align: center;
+			-webkit-align-items: center;
+			align-items: center;
+			padding: 5rpx 30rpx;
+			position: relative;
+		}
 	}
 
-/* 	.footer {
+
+	/* 	.footer {
 		background: #fff;
 		position: fixed;
 		bottom: 0;
@@ -322,6 +445,7 @@
 		background: #22C572;
 		border-radius: 10rpx;
 	}
+
 	.bottom-btn {
 		padding: 30rpx;
 		background: #FFFFFF;
@@ -349,15 +473,23 @@
 	/deep/.u-radio-group {
 		flex-direction: row-reverse;
 	}
+
 	.no-boder {
 		border: 0;
 	}
+
 	.textarea {
 		background: #F9F9FA;
 		border: 1px solid #EEEEEE;
 	}
-	.u-page__item__slot-icon{
-		width:20px;
-		height:20px;
+
+	.u-page__item__slot-icon {
+		width: 20px;
+		height: 20px;
+	}
+
+	.content {
+		padding-bottom: 150rpx;
+		overflow: hidden;
 	}
 </style>

+ 74 - 72
pages/leave/the_leave_record.vue

@@ -4,7 +4,7 @@
 		<view class='wrap' v-for="(item, index) in tableData" :key="index">
 			<view class="wenzi audit1" v-if="item.approveStatus == '待人事审核' || item.approveStatus == '待主管审核' ">审核中</view>
 			<view class="wenzi audit2" v-if="item.status == '已通过'">已通过</view>
-			<view class="wenzi audit3" v-if="item.status == '未通过'" >未通过</view>
+			<view class="wenzi audit3" v-if="item.status == '未通过'">未通过</view>
 			<view class="c-row">
 				<view class="title">请假类型 : {{item.leaveType}}</view>
 			</view>
@@ -22,48 +22,36 @@
 			<uni-load-more :status="loadStatus"></uni-load-more>
 		</view>
 		<view class="bottom-btn">
-				<view>
-					<view style='width:100%;' class='flex flex-space-between'>
-						<view @click='clocksubmit' style='width:50%;text-align:center;'>
-							<image
-							v-if='value==0'
-								class="u-page__item__slot-icon"
-								src="../../static/img/oa_office/leave/qingjia-check.png"
-							></image>
-							<image
-							v-else
-								class="u-page__item__slot-icon"
-								src="../../static/img/oa_office/leave/qingjia.png"
-							></image>
-							<view :style='{"color":value==0?"#22C572":"#000"}'>请假</view>
-						</view>
-						<view @click='clockRecord' style='width:50%;text-align:center;'>
-							<image
-							v-if='value==1'
-								class="u-page__item__slot-icon"
-								src="../../static/img/oa_office/leave/jilu-check.png"
-							></image>
-							<image
-							v-else
-								class="u-page__item__slot-icon"
-								src="../../static/img/oa_office/leave/jilu.png"
-							></image>
-							<view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
-						</view>
+			<view>
+				<view style='width:100%;' class='flex flex-space-between'>
+					<view @click='clocksubmit' style='width:50%;text-align:center;'>
+						<image v-if='value==0' class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/qingjia-check.png"></image>
+						<image v-else class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/qingjia.png"></image>
+						<view :style='{"color":value==0?"#22C572":"#000"}'>请假</view>
+					</view>
+					<view @click='clockRecord' style='width:50%;text-align:center;'>
+						<image v-if='value==1' class="u-page__item__slot-icon"
+							src="../../static/img/oa_office/leave/jilu-check.png"></image>
+						<image v-else class="u-page__item__slot-icon" src="../../static/img/oa_office/leave/jilu.png">
+						</image>
+						<view :style='{"color":value==1?"#22C572":"#000"}'>记录</view>
 					</view>
 				</view>
-				
-				<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
-				
 			</view>
+
+			<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
+
 		</view>
 	</view>
+	</view>
 </template>
 
 <script>
 	import dRili from '@/components/d-rili/d-rili.vue';
 	export default {
-		components:{
+		components: {
 			dRili
 		},
 		data() {
@@ -71,7 +59,7 @@
 				pageSize: 10,
 				currentPage: 1,
 				tableData: [],
-				value:1,
+				value: 1,
 				isLoadMore: false, //是否加载中
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 			}
@@ -110,19 +98,19 @@
 
 					// }
 					if (res.data.code == 200) {
-						if(res.data.data.records.length > 0){
+						if (res.data.data.records.length > 0) {
 							this.isLoadMore = false
-								this.loadStatus = 'loading'
-						}else{
+							this.loadStatus = 'loading'
+						} else {
 							this.isLoadMore = true
 							this.loadStatus = 'nomore'
 						}
-						if(this.currentPage == 1){
+						if (this.currentPage == 1) {
 							this.tableData = res.data.data.records
-						}else{
-							this.tableData =this.tableData.concat(res.data.data.records)
+						} else {
+							this.tableData = this.tableData.concat(res.data.data.records)
 						}
-						
+
 					}
 				})
 			},
@@ -144,6 +132,7 @@
 	page {
 		background: #F5F6FA;
 	}
+
 	.wrap {
 		padding-top: 15px;
 		padding-bottom: 20px;
@@ -151,44 +140,54 @@
 		background: #fff;
 		margin: 10px;
 		border-radius: 10px;
+
 		input {
 			font-size: 14px;
 		}
+
 		>.title {
 			padding: 10px 16px;
 		}
-	}
-	.wenzi {
-		text-align: right;
-		border-radius: 10rpx;
-		margin-right: 30rpx;
-		height: 10rpx;
-	}
-	.audit1{
-		color: red;
-	}
-	.audit2{
-		color: #afafe6;
-	}
-	.audit3{
-		color: red;
-	}
 
-	.c-row {
-		display: -webkit-box;
-		display: -webkit-flex;
-		display: flex;
-		-webkit-box-align: center;
-		-webkit-align-items: center;
-		align-items: center;
-		padding: 5rpx 30rpx;
-		position: relative;
+		.wenzi {
+			text-align: right;
+			border-radius: 10rpx;
+			margin-right: 30rpx;
+			height: 10rpx;
+		}
+
+		.audit1 {
+			color: red;
+		}
+
+		.audit2 {
+			color: #afafe6;
+		}
+
+		.audit3 {
+			color: red;
+		}
+
+		.c-row {
+			display: -webkit-box;
+			display: -webkit-flex;
+			display: flex;
+			-webkit-box-align: center;
+			-webkit-align-items: center;
+			align-items: center;
+			padding: 5rpx 30rpx;
+			position: relative;
+		}
 	}
+
+
+
 	.submit {
 		width: 40%;
 		background: #22C572;
 		border-radius: 10rpx;
 	}
+
 	.bottom-btn {
 		padding: 30rpx;
 		background: #FFFFFF;
@@ -197,13 +196,13 @@
 		bottom: 0rpx;
 		z-index: 9999;
 	}
-	
+
 	.buns_item {
 		display: flex;
 		padding: 80rpx 0 50rpx 0;
 		justify-content: space-around;
 	}
-	
+
 	.but_css {
 		background: #22C572;
 		width: 40%;
@@ -212,19 +211,22 @@
 		text-align: center;
 		border-radius: 20rpx;
 	}
-	
+
 	/deep/.u-radio-group {
 		flex-direction: row-reverse;
 	}
+
 	.no-boder {
 		border: 0;
 	}
+
 	.textarea {
 		background: #F9F9FA;
 		border: 1px solid #EEEEEE;
 	}
-	.u-page__item__slot-icon{
-		width:20px;
-		height:20px;
+
+	.u-page__item__slot-icon {
+		width: 20px;
+		height: 20px;
 	}
 </style>

BIN
static/img/oa_office/leave/dk.png


BIN
static/img/oa_office/leave/dkc.png