gjy 2 年之前
父節點
當前提交
c236e14423
共有 5 個文件被更改,包括 165 次插入15 次删除
  1. 1 1
      pages/clock/supp_clock.vue
  2. 13 4
      pages/clock/the_clock.vue
  3. 7 4
      pages/clock/the_clock_record.vue
  4. 54 6
      pages/leave/the_leave.vue
  5. 90 0
      pages/leave/the_leave_record.vue

+ 1 - 1
pages/clock/supp_clock.vue

@@ -5,7 +5,7 @@
 				<view class="c-row">
 				<view class="c-row">
 					<view class="title">补卡原因</view>
 					<view class="title">补卡原因</view>
 					<view class="con-list">
 					<view class="con-list">
-						<u-radio-group v-model="typevalue">
+						<u-radio-group  activeColor="#22C572" v-model="typevalue">
 							<u-radio key="1" label="上班" name="1">上班</u-radio>
 							<u-radio key="1" label="上班" name="1">上班</u-radio>
 							<u-radio key="3" label="下班" name="3">下班</u-radio>
 							<u-radio key="3" label="下班" name="3">下班</u-radio>
 						</u-radio-group>
 						</u-radio-group>

+ 13 - 4
pages/clock/the_clock.vue

@@ -3,8 +3,8 @@
 		<view class='wrap'>
 		<view class='wrap'>
 			<view class="c-row">
 			<view class="c-row">
 				<view class="title">打卡原因</view>
 				<view class="title">打卡原因</view>
-				<view class="con-list">
-					<u-radio-group v-model="typevalue">
+				<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="3" label="下班" name="3">下班</u-radio>
 						<u-radio key="1" label="上班" name="1">上班</u-radio>
 						<u-radio key="1" label="上班" name="1">上班</u-radio>
 					</u-radio-group>
 					</u-radio-group>
@@ -26,6 +26,9 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<view>
+			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+		</view>
 		<!-- <view class="footer">
 		<!-- <view class="footer">
 			<view @click='clockRecord' class="button">记录</view>
 			<view @click='clockRecord' class="button">记录</view>
 			<view @click='submit' class="button">提交</view>
 			<view @click='submit' class="button">提交</view>
@@ -33,7 +36,7 @@
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
 		<view class="bottom-btn">
 			<u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button>
 			<u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+			
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -58,7 +61,12 @@
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
-			this.getWarehouse()
+			if(!uni.getStorageSync("clockwerehouse")){
+				this.getWarehouse()
+			}else{
+				this.detailData.targetLocation=uni.getStorageSync("clockwerehouse")
+			}
+			
 			// this.getLocation()
 			// this.getLocation()
 		},
 		},
 		methods: {
 		methods: {
@@ -102,6 +110,7 @@
 				})
 				})
 			},
 			},
 			targetLPicker(e) {
 			targetLPicker(e) {
+				uni.setStorageSync("clockwerehouse",this.warehouseBaseInfoList[e[0]].warehouseName)
 				this.detailData.targetLocation = this.warehouseBaseInfoList[e[0]].warehouseName
 				this.detailData.targetLocation = this.warehouseBaseInfoList[e[0]].warehouseName
 				this.clockDistance = this.utils.getDistance(this.warehouseBaseInfoList[e[0]].warehousePositioning.split(
 				this.clockDistance = this.utils.getDistance(this.warehouseBaseInfoList[e[0]].warehousePositioning.split(
 						',')[0],
 						',')[0],

+ 7 - 4
pages/clock/the_clock_record.vue

@@ -62,7 +62,8 @@
 					month: true
 					month: true
 				},
 				},
 				isLoadMore: false,
 				isLoadMore: false,
-
+				createDate:'',
+				createDate1:'',
 
 
 			}
 			}
 		},
 		},
@@ -78,7 +79,8 @@
 		onLoad(options) {
 		onLoad(options) {
 			let _day = new Date();
 			let _day = new Date();
 			_day.setTime(_day.getTime());
 			_day.setTime(_day.getTime());
-			this.createDate = _day.getFullYear() + "-" + (_day.getMonth() + 1);
+			this.createDate = _day.getFullYear() + "." + (_day.getMonth() + 1);
+			this.createDate1 = _day.getFullYear() + "-" + (_day.getMonth() + 1);
 		},
 		},
 		onReachBottom() { //上拉触底函数
 		onReachBottom() { //上拉触底函数
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
@@ -89,7 +91,8 @@
 		methods: {
 		methods: {
 			dateChange(e) {
 			dateChange(e) {
 				console.log(e)
 				console.log(e)
-				this.createDate = e.year + "-" + e.month
+				this.createDate = e.year + "." + e.month
+				this.createDate1 = e.year + "-" + e.month
 				this.getList()
 				this.getList()
 			},
 			},
 			getData() {
 			getData() {
@@ -113,7 +116,7 @@
 					pageSize: this.pageSize,
 					pageSize: this.pageSize,
 					currentPage: this.currentPage,
 					currentPage: this.currentPage,
 					pcFlag: 0,
 					pcFlag: 0,
-					yearMonth: this.createDate,
+					yearMonth: this.createDate1,
 					compId: uni.getStorageSync('pcUserInfo').compId,
 					compId: uni.getStorageSync('pcUserInfo').compId,
 					commonId: uni.getStorageSync('pcUserInfo').userId,
 					commonId: uni.getStorageSync('pcUserInfo').userId,
 				}).then(res => {
 				}).then(res => {

+ 54 - 6
pages/leave/the_leave.vue

@@ -4,7 +4,7 @@
 			<view class="c-row">
 			<view class="c-row">
 				<view class="title">请假类型</view>
 				<view class="title">请假类型</view>
 				<view class="con-list">
 				<view class="con-list">
-					<view @click='show=true'>{{detailData.leaveType}}</view>
+					<view @click='show=true'>{{detailData.leaveType}} ></view>
 					<u-picker :range="leaveTypeList" range-key="leaveType"@confirm='ltCheck($event)' v-model="show" mode="selector">
 					<u-picker :range="leaveTypeList" range-key="leaveType"@confirm='ltCheck($event)' v-model="show" mode="selector">
 					</u-picker>
 					</u-picker>
 				</view>
 				</view>
@@ -12,7 +12,7 @@
 			<view class="c-row">
 			<view class="c-row">
 				<view class="title">开始时间</view>
 				<view class="title">开始时间</view>
 				<view class="con-list">
 				<view class="con-list">
-					<view @click='show1=true'>{{detailData.startDate}}</view>
+					<view @click='show1=true'>{{detailData.startDate}} ></view>
 					<u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
 					<u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
 					</u-picker>
 					</u-picker>
 				</view>
 				</view>
@@ -20,7 +20,7 @@
 			<view class="c-row">
 			<view class="c-row">
 				<view class="title">结束时间</view>
 				<view class="title">结束时间</view>
 				<view class="con-list">
 				<view class="con-list">
-					<view @click='show2=true'>{{detailData.endDate}}</view>
+					<view @click='show2=true'>{{detailData.endDate}} ></view>
 					<u-picker v-model="show2" mode="time" @confirm='dateChange1($event)' :params="params">
 					<u-picker v-model="show2" mode="time" @confirm='dateChange1($event)' :params="params">
 					</u-picker>
 					</u-picker>
 				</view>
 				</view>
@@ -42,14 +42,49 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		
 		<!-- <view class="footer">
 		<!-- <view class="footer">
 			<view @click='clockRecord' class="button">记录</view>
 			<view @click='clockRecord' class="button">记录</view>
 			<view @click='submit' class="button">提交</view>
 			<view @click='submit' class="button">提交</view>
 		</view> -->
 		</view> -->
 		<u-toast ref="uToast" />
 		<u-toast ref="uToast" />
 		<view class="bottom-btn">
 		<view class="bottom-btn">
-			<u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button>
-			<u-button type="primary" class="submit" hover-class="none" @click="submit">提交</u-button>
+			<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>
+						<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>
 	</view>
 </template>
 </template>
@@ -77,6 +112,7 @@
 					minute: true,
 					minute: true,
 					
 					
 				},
 				},
+				value:0,
 				type: 'textarea',
 				type: 'textarea',
 				border: true,
 				border: true,
 				height: 150,
 				height: 150,
@@ -136,6 +172,10 @@
 			},
 			},
 			dateChange1(e) {
 			dateChange1(e) {
 				this.detailData.endDate = e.year + "-" + e.month + "-" + e.day + " " + e.hour + ":" + e.minute
 				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))
 				// this.endDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
 				// this.endDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
 			},
 			},
 			submit() {
 			submit() {
@@ -191,6 +231,11 @@
 					url: '/pages/leave/the_leave_record'
 					url: '/pages/leave/the_leave_record'
 				})
 				})
 			},
 			},
+			clocksubmit() {
+				uni.navigateTo({
+					url: '/pages/leave/the_leave'
+				})
+			},
 		},
 		},
 	}
 	}
 </script>
 </script>
@@ -281,7 +326,6 @@
 		width: 100%;
 		width: 100%;
 		position: fixed;
 		position: fixed;
 		bottom: 0rpx;
 		bottom: 0rpx;
-		display: flex;
 		z-index: 9999;
 		z-index: 9999;
 	}
 	}
 
 
@@ -310,4 +354,8 @@
 		background: #F9F9FA;
 		background: #F9F9FA;
 		border: 1px solid #EEEEEE;
 		border: 1px solid #EEEEEE;
 	}
 	}
+	.u-page__item__slot-icon{
+		width:20px;
+		height:20px;
+	}
 </style>
 </style>

+ 90 - 0
pages/leave/the_leave_record.vue

@@ -20,6 +20,42 @@
 		<view v-show="isLoadMore">
 		<view v-show="isLoadMore">
 			<uni-load-more :status="loadStatus"></uni-load-more>
 			<uni-load-more :status="loadStatus"></uni-load-more>
 		</view>
 		</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>
+				
+				<!-- <u-button type="primary" class="submit" hover-class="none" @click="clockRecord">记录</u-button> -->
+				
+			</view>
+		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -30,6 +66,7 @@
 				pageSize: 10,
 				pageSize: 10,
 				currentPage: 1,
 				currentPage: 1,
 				tableData: [],
 				tableData: [],
+				value:1,
 				isLoadMore: false, //是否加载中
 				isLoadMore: false, //是否加载中
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 			}
 			}
@@ -84,6 +121,16 @@
 					}
 					}
 				})
 				})
 			},
 			},
+			clockRecord() {
+				uni.navigateTo({
+					url: '/pages/leave/the_leave_record'
+				})
+			},
+			clocksubmit() {
+				uni.navigateTo({
+					url: '/pages/leave/the_leave'
+				})
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -132,4 +179,47 @@
 		padding: 5rpx 30rpx;
 		padding: 5rpx 30rpx;
 		position: relative;
 		position: relative;
 	}
 	}
+	.submit {
+		width: 40%;
+		background: #22C572;
+		border-radius: 10rpx;
+	}
+	.bottom-btn {
+		padding: 30rpx;
+		background: #FFFFFF;
+		width: 100%;
+		position: fixed;
+		bottom: 0rpx;
+		z-index: 9999;
+	}
+	
+	.buns_item {
+		display: flex;
+		padding: 80rpx 0 50rpx 0;
+		justify-content: space-around;
+	}
+	
+	.but_css {
+		background: #22C572;
+		width: 40%;
+		padding: 20rpx;
+		color: #fff;
+		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;
+	}
 </style>
 </style>