|
@@ -1,22 +1,15 @@
|
|
<template>
|
|
<template>
|
|
- <view >
|
|
|
|
|
|
+ <view>
|
|
<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">
|
|
<view class="con-list">
|
|
- <u-radio-group @change="groupChange" v-model="typevalue">
|
|
|
|
- <u-radio key="3" label="其他" name="3">其他</u-radio>
|
|
|
|
- <u-radio key="1" label="上班/下班" name="1">上班/下班</u-radio>
|
|
|
|
|
|
+ <u-radio-group v-model="typevalue">
|
|
|
|
+ <u-radio key="3" label="下班" name="3">下班</u-radio>
|
|
|
|
+ <u-radio key="1" label="上班" name="1">上班</u-radio>
|
|
</u-radio-group>
|
|
</u-radio-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="c-row" v-if='show1'>
|
|
|
|
- <view class="title">其他原因</view>
|
|
|
|
- <view class="con-list">
|
|
|
|
- <input type="digit" @input='calculate' name="otherReasons" v-model='detailData.otherReasons'
|
|
|
|
- placeholder="请输入其他原因"></input>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
<view class="c-row">
|
|
<view class="c-row">
|
|
<view class="title">目标位置</view>
|
|
<view class="title">目标位置</view>
|
|
<view class="con-list">
|
|
<view class="con-list">
|
|
@@ -34,6 +27,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="footer">
|
|
<view class="footer">
|
|
|
|
+ <view @click='clockRecord' class="button">记录</view>
|
|
<view @click='submit' class="button">提交</view>
|
|
<view @click='submit' class="button">提交</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -45,17 +39,17 @@
|
|
return {
|
|
return {
|
|
typevalue: '1',
|
|
typevalue: '1',
|
|
show: false,
|
|
show: false,
|
|
- show1: false,
|
|
|
|
detailData: {
|
|
detailData: {
|
|
|
|
+ compId: '',
|
|
clockType: '',
|
|
clockType: '',
|
|
otherReasons: '',
|
|
otherReasons: '',
|
|
targetLocation: '请选择目标位置',
|
|
targetLocation: '请选择目标位置',
|
|
clockDistance: '重新获取',
|
|
clockDistance: '重新获取',
|
|
},
|
|
},
|
|
- clockDistance:"",
|
|
|
|
- warehouseType:'1',
|
|
|
|
- warehouseBaseInfoList:[],
|
|
|
|
-
|
|
|
|
|
|
+ clockDistance: "",
|
|
|
|
+ warehouseType: '1',
|
|
|
|
+ warehouseBaseInfoList: [],
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -68,16 +62,6 @@
|
|
query.selectAll('.left')
|
|
query.selectAll('.left')
|
|
console.log(query)
|
|
console.log(query)
|
|
},
|
|
},
|
|
- groupChange(e) {
|
|
|
|
- console.log(e)
|
|
|
|
- this.detailData.clockType = e
|
|
|
|
- if (e == 1 || e == null) {
|
|
|
|
- this.show1 = false
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- this.show1 = true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
getWarehouse() {
|
|
getWarehouse() {
|
|
this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
|
|
this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouse', {
|
|
compId: uni.getStorageSync("pcUserInfo").compId,
|
|
compId: uni.getStorageSync("pcUserInfo").compId,
|
|
@@ -94,51 +78,69 @@
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
console.log('当前位置的纬度:' + res.latitude);
|
|
this.lat2 = res.latitude
|
|
this.lat2 = res.latitude
|
|
this.lng2 = res.longitude
|
|
this.lng2 = res.longitude
|
|
- if(this.warehouseBaseInfoList.length > 0){
|
|
|
|
- this.clockDistance = this.utils.getDistance(this.warehouseBaseInfoList[0].warehousePositioning.split(',')[1],
|
|
|
|
- this.warehouseBaseInfoList[0].warehousePositioning.split(',')[0], this.lat2, this.lng2)
|
|
|
|
|
|
+ if (this.warehouseBaseInfoList.length > 0) {
|
|
|
|
+ this.clockDistance = this.utils.getDistance(this
|
|
|
|
+ .warehouseBaseInfoList[0].warehousePositioning.split(',')[
|
|
|
|
+ 1],
|
|
|
|
+ this.warehouseBaseInfoList[0].warehousePositioning.split(
|
|
|
|
+ ',')[0], this.lat2, this.lng2)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- fail:function(req){
|
|
|
|
|
|
+ fail: function(req) {
|
|
console.log(req)
|
|
console.log(req)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
targetLPicker(e) {
|
|
targetLPicker(e) {
|
|
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(',')[1],
|
|
|
|
|
|
+ this.clockDistance = this.utils.getDistance(this.warehouseBaseInfoList[e[0]].warehousePositioning.split(
|
|
|
|
+ ',')[1],
|
|
this.warehouseBaseInfoList[e[0]].warehousePositioning.split(',')[0], this.lat2, this.lng2)
|
|
this.warehouseBaseInfoList[e[0]].warehousePositioning.split(',')[0], this.lat2, this.lng2)
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
- // if (!this.detailData.clockType) {
|
|
|
|
- // this.$api.msg('打卡原因不能为空')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // if (this.typevalue == 3) {
|
|
|
|
- // if (!this.detailData.otherReasons) {
|
|
|
|
- // this.$api.msg('其他原因不能为空')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // if (!this.detailData.targetLocation) {
|
|
|
|
- // this.$api.msg('目标位置不能为空')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!this.typevalue) {
|
|
|
|
+ this.$api.msg('打卡原因不能为空')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!this.detailData.targetLocation) {
|
|
|
|
+ this.$api.msg('请选择目标位置')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var that = this
|
|
uni.showModal({
|
|
uni.showModal({
|
|
content: "确定提交打卡信息?",
|
|
content: "确定提交打卡信息?",
|
|
showCancel: true,
|
|
showCancel: true,
|
|
confirmText: '提交',
|
|
confirmText: '提交',
|
|
success: function(res) {
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
-
|
|
|
|
|
|
+ that.detailData.compId = uni.getStorageSync('pcUserInfo').compId
|
|
|
|
+ that.detailData.commonId = uni.getStorageSync('pcUserInfo').userId
|
|
|
|
+ that.detailData.dept = uni.getStorageSync('pcUserInfo').deptName
|
|
|
|
+ that.detailData.phone = uni.getStorageSync('pcUserInfo').userMobilePhone
|
|
|
|
+ that.detailData.empName = uni.getStorageSync('userInfo').userName
|
|
|
|
+ that.detailData.clockType = that.typevalue
|
|
|
|
+ that.detailData.clockDistance = "100"
|
|
|
|
+ that.$api.doRequest('post','/clockInfo/api/addClock',that.detailData)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ that.$api.msg('提交成功')
|
|
|
|
+ } else {
|
|
|
|
+ that.$api.msg('提交失败')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- }
|
|
|
|
|
|
+ clockRecord(){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pages/clock/the_clock_record'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|