zhangyuewww 2 年 前
コミット
478dc169d4

+ 1 - 0
pages/clock/supp_clock.vue

@@ -173,6 +173,7 @@
 									} else {
 										// that.$api.msg('提交失败')
 									}
+									uni.hideLoading()
 								})
 						}
 					}

+ 21 - 6
pages/clock/the_clock.vue

@@ -61,13 +61,11 @@
 			}
 		},
 		onLoad() {
-			if(!uni.getStorageSync("clockwerehouse")){
-				this.getWarehouse()
-			}else{
+			if(uni.getStorageSync("clockwerehouse")){
 				this.detailData.targetLocation=uni.getStorageSync("clockwerehouse")
 			}
-			
-			// this.getLocation()
+			this.getWarehouse()
+			this.getLocation()
 		},
 		methods: {
 			calculate() {
@@ -77,6 +75,9 @@
 			},
 			getWarehouse() {
 				var that = this
+				uni.showLoading({
+					title: "正在加载"
+				})
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
 					compId: uni.getStorageSync("pcUserInfo").compId,
 					warehouseType: '1'
@@ -93,12 +94,25 @@
 								that.lat2 = res.latitude
 								that.lng2 = res.longitude
 								if (that.warehouseBaseInfoList.length > 0) {
-									that.clockDistance = that.utils.getDistance(that
+									if(that.detailData.targetLocation){
+										for(var i = 0 ; i < that.warehouseBaseInfoList.length ; i++){
+											if(that.warehouseBaseInfoList[i].warehouseName==that.detailData.targetLocation){
+												that.clockDistance = that.utils.getDistance(that
+												.warehouseBaseInfoList[i].warehousePositioning.split(',')[
+													0],
+												that.warehouseBaseInfoList[i].warehousePositioning.split(
+													',')[1], that.lat2, that.lng2)
+											}
+										}
+									}
+									else{
+										that.clockDistance = that.utils.getDistance(that
 										.warehouseBaseInfoList[0].warehousePositioning.split(',')[
 											0],
 										that.warehouseBaseInfoList[0].warehousePositioning.split(
 											',')[1], that.lat2, that.lng2)
 											that.detailData.targetLocation = that.warehouseBaseInfoList[0].warehouseName
+									}
 								}
 							},
 							fail: function(req) {
@@ -107,6 +121,7 @@
 						});
 
 					}
+					uni.hideLoading()
 				})
 			},
 			targetLPicker(e) {

+ 6 - 0
pages/task/audit/supp_clock_approve.vue

@@ -23,6 +23,12 @@
 		<view class="content1">
 			<!-- :model="OutList" -->
 			<u-form  ref="uForm">
+				<u-form-item label="申请人" prop="empName" label-width="140" class="uForm_item">
+					<u-input input-align="right" disabled v-model="dataList.empName" />
+				</u-form-item>
+				<u-form-item label="补卡日期" prop="suppDay" label-width="140" class="uForm_item">
+					<u-input input-align="right" disabled v-model="dataList.suppDay" />
+				</u-form-item>
 				<u-form-item label="补卡原因" prop="supplementClockType" label-width="140" class="uForm_item">
 					<u-input input-align="right" disabled v-if="dataList.supplementClockType=='1'" value="上班">上班</u-input>
 					<u-input  input-align="right" disabled v-if="dataList.supplementClockType=='3'" value="下班">下班</u-input>