zxz 2 years ago
parent
commit
15bf725829

+ 14 - 9
pages/clock/the_clock.vue

@@ -160,15 +160,20 @@
 								that.detailData.clockDistance = that.clockDistance.replace("m","")
 							}
 							console.log(that.detailData)
-							that.$api.doRequest('post', '/clockInfo/api/addClock', that.detailData)
-								.then(res => {
-									console.log(res.data)
-									if (res.data.code == 200) {
-										that.$api.msg('提交成功')
-									} else {
-										that.$api.msg('提交失败')
-									}
-								})
+							// if(that.detailData.clockDistance > 1500){
+							// 	that.$api.msg('请在目标位置1.5km范围内进行打卡')
+							// 	return
+							// }else{
+								that.$api.doRequest('post', '/clockInfo/api/addClock', that.detailData)
+									.then(res => {
+										console.log(res.data)
+										if (res.data.code == 200) {
+											that.$api.msg('提交成功')
+										} else {
+											that.$api.msg('提交失败')
+										}
+									})
+							// }
 						}
 					}
 				})

+ 20 - 7
pages/clock/the_clock_record.vue

@@ -15,34 +15,47 @@
 				</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" style="height: 30px;">{{ item.clockDay }}</uni-td>
+					<!-- {{ item.createDate.split(" ")[0]  }} -->
 					<uni-td align="center">
-						<view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}</view>
-						<view class="toClockDate" v-else-if="!item.toClockDate">
+						<view class="toClockDate" v-if="item.toClockDate">{{ item.toClockDate.split(" ")[1] }}
+							<view style="color: red;" v-if="item.lateFlag == 1">迟
+							</view>
+						</view>
+						<view class="toClockDate" v-else-if="!item.toClockDate && !item.leaveType">
 							<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"
+							<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>
+						<view class="toClockDate" v-if="!item.toClockDate && item.leaveType">
+							{{item.leaveType}}
+						</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">
+						<view class="offClockDate" v-if="item.offClockDate">{{ item.offClockDate.split(" ")[1] }}
+							<view style="color: red;" v-if="item.leaveEarlyFlag == 1">迟
+							</view>
+						</view>
+						<view class="offClockDate" v-else-if="!item.offClockDate && !item.leaveType">
 							<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"
+							<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>
+						<view class="offClockDate" v-if="!item.offClockDate && item.leaveType">
+							{{item.leaveType}}
+						</view>
 					</uni-td>
 				</uni-tr>
 			</uni-table>

+ 4 - 8
pages/leave/the_leave.vue

@@ -51,11 +51,7 @@
 		<view class="" v-else>
 
 			<view class='wrap' v-for="(item, index) in tableData" :key="index">
-				<view class="wenzi audit1" v-if="item.approveStatus == '待人事审核'">待人事审核
-				</view>
-				<view class="wenzi audit1" v-if="item.approveStatus == '待主管审核'">待主管审核
-				</view>
-				<view class="wenzi audit1" v-if="item.approveStatus == '待决策人审核'">待决策人审核
+				<view class="wenzi audit1" v-if="item.approveStatus">审核中
 				</view>
 				<view class="wenzi audit2" v-if="item.status == '已通过'">已通过</view>
 				<view class="wenzi audit3" v-if="item.status == '未通过'">未通过</view>
@@ -422,9 +418,9 @@
 										uni.hideLoading()
 										that.value = 1
 										that.getList()
-										// uni.navigateTo({
-										// 	url: '/pages/leave/the_leave_record'
-										// })
+										uni.navigateTo({
+											url: '/pages/leave/the_leave_record' 
+										})
 									} else {
 										that.$api.msg('提交失败')
 									}

+ 4 - 1
pages/leave/the_leave_record.vue

@@ -2,7 +2,7 @@
 	<view>
 
 		<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 audit1" v-if="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">
@@ -67,6 +67,9 @@
 		onShow() {
 			this.getList()
 		},
+		onLoad(options) {
+			this.getList()
+		},
 		//下拉刷新
 		onPullDownRefresh() {
 			this.currentPage = 1

+ 87 - 77
pages/task/audit/leave_approve.vue

@@ -4,11 +4,10 @@
 			<view class="topInfo-item">
 				<view class="flex info">
 					<view class="logo">
-						<image src="../../../static/img/reject.png" mode=""
-							v-if="dataList.status == '已驳回'" style="height: 40rpx;">
+						<image src="../../../static/img/reject.png" mode="" v-if="dataList.status == '已驳回'"
+							style="height: 40rpx;">
 						</image><!-- 驳回 -->
-						<image src="../../../static/img/tongguo.png" mode=""
-							v-else-if="dataList.status == '已通过'"
+						<image src="../../../static/img/tongguo.png" mode="" v-else-if="dataList.status == '已通过'"
 							style="height: 40rpx;"></image><!-- 通过 -->
 						<image src="../../../static/img/daishenhe.png" mode=""
 							v-else-if="dataList.approveStatus == '待人事审核' || dataList.approveStatus == '待主管审核'"
@@ -22,55 +21,55 @@
 		</view>
 		<view class="content1">
 			<!-- :model="OutList" -->
-			<u-form  ref="uForm">
+			<u-form ref="uForm">
 				<u-form-item label="请假类型" prop="leaveType" label-width="140" class="uForm_item">
-					<u-input v-model="dataList.leaveType" input-align="right" disabled v-if="dataList.leaveType"/>
+					<u-input v-model="dataList.leaveType" input-align="right" disabled v-if="dataList.leaveType" />
 				</u-form-item>
-					<view class="uForm_item">
-						<view class='row'>
-							<view class="left">开始时间</view>
-							<view class="right">{{dataList.startDate}}</view>
-						</view>
-						<view class='row'>
-							<view class="left">结束时间</view>
-							<view class="right">{{dataList.endDate}}</view>
-						</view>
-						<view class='row'>
-							<view class="left">请假时长</view>
-							<view class="right">{{dataList.leaveDuration}}</view>
-						</view>
-						<u-form-item label="请假事由" prop="reasonForLeave" label-width="160" label-position="top">
-							<u-input v-model="dataList.reasonForLeave" input-align="left" placeholder="请输入请假事由"
-								type="textarea" class="textarea" maxlength="150" />
-						</u-form-item>
+				<view class="uForm_item">
+					<view class='row'>
+						<view class="left">开始时间</view>
+						<view class="right">{{dataList.startDate}}</view>
 					</view>
+					<view class='row'>
+						<view class="left">结束时间</view>
+						<view class="right">{{dataList.endDate}}</view>
+					</view>
+					<view class='row'>
+						<view class="left">请假时长</view>
+						<view class="right">{{dataList.leaveDuration}}</view>
+					</view>
+					<u-form-item label="请假事由" prop="reasonForLeave" label-width="160" label-position="top">
+						<u-input v-model="dataList.reasonForLeave" input-align="left" placeholder="请输入请假事由"
+							type="textarea" class="textarea" maxlength="150" />
+					</u-form-item>
+				</view>
 			</u-form>
 		</view>
-	<view v-if='show' class="shade1">
-		<view class="wrap1">
-			<view class="alert-top1">
-				<view class="title1">
-					{{title}}
+		<view v-if='show' class="shade1">
+			<view class="wrap1">
+				<view class="alert-top1">
+					<view class="title1">
+						{{title}}
+					</view>
+					<u-icon name="close" class="close1" color="#8890B1" @click="close()"></u-icon>
 				</view>
-				<u-icon name="close" class="close1" color="#8890B1" @click="close()"></u-icon>
-			</view>
-			<view class="u-textarea-style1">
-				
-				<u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
-					maxlength="1000" />
+				<view class="u-textarea-style1">
+
+					<u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
+						maxlength="1000" />
 					<view class="right-bottom1">
 						{{auditMind.length}}/1000个字
 					</view>
+				</view>
+				<view @click='close()' class="cancel1">取消</view>
+				<view @click='passSubmit()' class="confirm1">确定</view>
 			</view>
-			<view @click='close()' class="cancel1">取消</view>
-			<view @click='passSubmit()' class="confirm1">确定</view>
 		</view>
-	</view>
-	<u-toast ref="uToast" />
-	<view style='padding:10px;' class='flex bottom-btn'>
-		<u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
-		<u-button @click='pass' type="success" class="btn2">通过</u-button>
-	</view>
+		<u-toast ref="uToast" />
+		<view style='padding:10px;' class='flex bottom-btn'>
+			<u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
+			<u-button @click='pass' type="success" class="btn2">通过</u-button>
+		</view>
 	</view>
 
 </template>
@@ -90,16 +89,19 @@
 				id: "",
 				show: false,
 				auditMind: '',
-				leaveType:'',
-				reasonForLeave:'',
-				startDate:'',
-				endDate:'',
-				leaveDuration:'',
-				leaveType:'',
-				approveStatus:'',
-				status:'',
-				updateDate:'',
-				dataList:{},
+				leaveType: '',
+				reasonForLeave: '',
+				startDate: '',
+				endDate: '',
+				leaveDuration: '',
+				leaveType: '',
+				approveStatus: '',
+				status: '',
+				leaveInfo: {
+					id:'',
+				},
+				updateDate: '',
+				dataList: {},
 			}
 		},
 		onBackPress(e) {
@@ -125,7 +127,7 @@
 				}).then(res => {
 					if (res.data.code == 200) {
 						this.dataList = res.data.data
-					
+
 					}
 				})
 				// this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
@@ -173,10 +175,18 @@
 								if (res.data.code == 200) {
 									uni.hideLoading()
 									that.$api.msg('审核成功!')
-									uni.navigateTo({
-										url: "/pages/task/my_task"
-									})
-									
+									that.leaveInfo.id = that.id 
+									that.$api.doRequest('post', '/leaveInfo/api/generateClock', that.leaveInfo
+									).then(res => {
+											if (res.data.code == 200) {
+												that.$api.msg('审核成功!')
+												uni.navigateTo({
+													url: "/pages/task/my_task"
+												})
+											} else {
+												that.$api.msg('提交失败')
+											}
+										})
 								} else {
 									that.$api.msg('审核失败!')
 								}
@@ -391,7 +401,7 @@
 			margin: auto;
 			background: #fff;
 			width: calc(100% - 198rpx);
-		    height: 355px;
+			height: 355px;
 			border-radius: 20rpx;
 
 			.alert-top1 {
@@ -463,28 +473,28 @@
 			color: #22C572;
 		}
 
-			.bottom-btn1 {
+		.bottom-btn1 {
+			width: 100%;
+			// position: fixed;
+			bottom: 0;
+			display: flex;
+			z-index: 2;
+			left: 0;
+			background-color: #f8f8f8;
+			flex-direction: column;
+
+			.btn1,
+			.btn2 {
 				width: 100%;
-				// position: fixed;
-				bottom: 0;
-				display: flex;
-				z-index: 2;
-				left: 0;
-				background-color: #f8f8f8;
-				flex-direction: column;
-
-				.btn1,
-				.btn2 {
-					width: 100%;
-					margin-bottom: 26rpx;
-					border-radius: 90rpx;
-				}
+				margin-bottom: 26rpx;
+				border-radius: 90rpx;
+			}
 
-				.btn1 {
-					background: white;
-					color: #00C265;
-				}
+			.btn1 {
+				background: white;
+				color: #00C265;
 			}
+		}
 	}
 
 	/deep/.u-input__textarea {