|
@@ -1,106 +1,42 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <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 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 class="c-row">
|
|
|
|
- <view class="title">打卡距离</view>
|
|
|
|
- <view class="con-list">
|
|
|
|
- <view>{{clockDistance}}</view>
|
|
|
|
- </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>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view>
|
|
|
|
- <u-button type="primary" class="submit" hover-class="none" @click="submit">打卡</u-button>
|
|
|
|
|
|
+ <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>
|
|
|
|
- <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 class="c-row">
|
|
|
|
+ <view class="title">打卡距离</view>
|
|
|
|
+ <view class="con-list">
|
|
|
|
+ <view>{{clockDistance}}</view>
|
|
</view>
|
|
</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">
|
|
|
|
- <view v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
|
|
|
|
- class="bk-button">补卡</view>
|
|
|
|
- <view v-if='item.approveStatus=="待人事审核"' class='listitemStatus audit Regular'>待人事审核
|
|
|
|
- </view>
|
|
|
|
- <view v-if='item.approveStatus=="待主管审核"' class='listitemStatus audit Regular'>待主管审核
|
|
|
|
- </view>
|
|
|
|
- <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">
|
|
|
|
- <view v-if='item.approveStatus ==null && item.status == null' @click='supp(item)'
|
|
|
|
- class="bk-button">补卡</view>
|
|
|
|
- <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>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ <!-- <view class="footer">
|
|
|
|
+ <view @click='clockRecord' class="button">记录</view>
|
|
|
|
+ <view @click='submit' class="button">提交</view>
|
|
|
|
+ </view> -->
|
|
<u-toast ref="uToast" />
|
|
<u-toast ref="uToast" />
|
|
<view class="bottom-btn">
|
|
<view class="bottom-btn">
|
|
- <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> -->
|
|
|
|
-
|
|
|
|
|
|
+ <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>
|
|
@@ -109,11 +45,6 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- params: {
|
|
|
|
- year: true,
|
|
|
|
- month: true
|
|
|
|
- },
|
|
|
|
- value: 0,
|
|
|
|
typevalue: '1',
|
|
typevalue: '1',
|
|
show: false,
|
|
show: false,
|
|
detailData: {
|
|
detailData: {
|
|
@@ -126,56 +57,19 @@
|
|
clockDistance: "",
|
|
clockDistance: "",
|
|
warehouseType: '1',
|
|
warehouseType: '1',
|
|
warehouseBaseInfoList: [],
|
|
warehouseBaseInfoList: [],
|
|
- clockDay:'',
|
|
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onShow() {
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- onLoad(options) {
|
|
|
|
- if (options.value) {
|
|
|
|
- this.value = 1
|
|
|
|
- }
|
|
|
|
- console.log(uni.getStorageSync("clockwerehouse"))
|
|
|
|
- if (!uni.getStorageSync("clockwerehouse")) {
|
|
|
|
- uni.showLoading({
|
|
|
|
- mask: true,
|
|
|
|
- title: '加载中'
|
|
|
|
- })
|
|
|
|
|
|
+ onLoad() {
|
|
|
|
+ if(!uni.getStorageSync("clockwerehouse")){
|
|
this.getWarehouse()
|
|
this.getWarehouse()
|
|
- } else {
|
|
|
|
- this.detailData.targetLocation = uni.getStorageSync("clockwerehouse")
|
|
|
|
|
|
+ }else{
|
|
|
|
+ this.detailData.targetLocation=uni.getStorageSync("clockwerehouse")
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// this.getLocation()
|
|
// this.getLocation()
|
|
- let _day = new Date();
|
|
|
|
- _day.setTime(_day.getTime());
|
|
|
|
- this.createDate = _day.getFullYear() + "-" + (_day.getMonth() + 1);
|
|
|
|
- this.clockDay = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- supp(item) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/clock/supp_clock' + `?id=${item.id}`,
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- 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() {
|
|
calculate() {
|
|
const query = uni.createSelectorQuery().in(this);
|
|
const query = uni.createSelectorQuery().in(this);
|
|
query.selectAll('.left')
|
|
query.selectAll('.left')
|
|
@@ -187,14 +81,8 @@
|
|
compId: uni.getStorageSync("pcUserInfo").compId,
|
|
compId: uni.getStorageSync("pcUserInfo").compId,
|
|
warehouseType: '1'
|
|
warehouseType: '1'
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- uni.hideLoading()
|
|
|
|
if (res.data.data.length != 0) {
|
|
if (res.data.data.length != 0) {
|
|
that.warehouseBaseInfoList = res.data.data
|
|
that.warehouseBaseInfoList = res.data.data
|
|
- that.warehouseBaseInfoList.unshift({
|
|
|
|
- warehouseName: '黑龙江中天昊元贸易有限公司',
|
|
|
|
- warehousePositioning: '40.63070,122.22580'
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
uni.getLocation({
|
|
uni.getLocation({
|
|
type: 'gcj02',
|
|
type: 'gcj02',
|
|
geocode: true,
|
|
geocode: true,
|
|
@@ -210,8 +98,7 @@
|
|
0],
|
|
0],
|
|
that.warehouseBaseInfoList[0].warehousePositioning.split(
|
|
that.warehouseBaseInfoList[0].warehousePositioning.split(
|
|
',')[1], that.lat2, that.lng2)
|
|
',')[1], that.lat2, that.lng2)
|
|
- that.detailData.targetLocation = that.warehouseBaseInfoList[0]
|
|
|
|
- .warehouseName
|
|
|
|
|
|
+ that.detailData.targetLocation = that.warehouseBaseInfoList[0].warehouseName
|
|
}
|
|
}
|
|
},
|
|
},
|
|
fail: function(req) {
|
|
fail: function(req) {
|
|
@@ -223,12 +110,12 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
targetLPicker(e) {
|
|
targetLPicker(e) {
|
|
- uni.setStorageSync("clockwerehouse", this.warehouseBaseInfoList[e[0]].warehouseName)
|
|
|
|
|
|
+ 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],
|
|
this.warehouseBaseInfoList[e[0]].warehousePositioning.split(',')[1], this.lat2, this.lng2)
|
|
this.warehouseBaseInfoList[e[0]].warehousePositioning.split(',')[1], this.lat2, this.lng2)
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
if (!this.typevalue) {
|
|
if (!this.typevalue) {
|
|
@@ -249,15 +136,13 @@
|
|
that.detailData.compId = uni.getStorageSync('pcUserInfo').compId
|
|
that.detailData.compId = uni.getStorageSync('pcUserInfo').compId
|
|
that.detailData.commonId = uni.getStorageSync('pcUserInfo').userId
|
|
that.detailData.commonId = uni.getStorageSync('pcUserInfo').userId
|
|
that.detailData.dept = uni.getStorageSync('pcUserInfo').deptName
|
|
that.detailData.dept = uni.getStorageSync('pcUserInfo').deptName
|
|
- that.detailData.deptId = uni.getStorageSync('pcUserInfo').deptId
|
|
|
|
that.detailData.phone = uni.getStorageSync('pcUserInfo').userMobilePhone
|
|
that.detailData.phone = uni.getStorageSync('pcUserInfo').userMobilePhone
|
|
that.detailData.empName = uni.getStorageSync('userInfo').userName
|
|
that.detailData.empName = uni.getStorageSync('userInfo').userName
|
|
that.detailData.clockType = that.typevalue
|
|
that.detailData.clockType = that.typevalue
|
|
- that.detailData.clockDay = that.clockDay
|
|
|
|
- if (that.clockDistance.indexOf("km") > -1) {
|
|
|
|
- that.detailData.clockDistance = that.clockDistance.replace("km", "") * 1000
|
|
|
|
- } else {
|
|
|
|
- that.detailData.clockDistance = that.clockDistance.replace("m", "")
|
|
|
|
|
|
+ if(that.clockDistance.indexOf("km") > -1){
|
|
|
|
+ that.detailData.clockDistance = that.clockDistance.replace("km","")*1000
|
|
|
|
+ }else{
|
|
|
|
+ that.detailData.clockDistance = that.clockDistance.replace("m","")
|
|
}
|
|
}
|
|
console.log(that.detailData)
|
|
console.log(that.detailData)
|
|
that.$api.doRequest('post', '/clockInfo/api/addClock', that.detailData)
|
|
that.$api.doRequest('post', '/clockInfo/api/addClock', that.detailData)
|
|
@@ -265,9 +150,6 @@
|
|
console.log(res.data)
|
|
console.log(res.data)
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
that.$api.msg('提交成功')
|
|
that.$api.msg('提交成功')
|
|
- that.value = 1
|
|
|
|
-
|
|
|
|
- that.getList()
|
|
|
|
} else {
|
|
} else {
|
|
that.$api.msg('提交失败')
|
|
that.$api.msg('提交失败')
|
|
}
|
|
}
|
|
@@ -277,37 +159,11 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
clockRecord() {
|
|
clockRecord() {
|
|
- 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数据
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/clock/the_clock_record'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -368,7 +224,7 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /* .footer {
|
|
|
|
|
|
+/* .footer {
|
|
background: #fff;
|
|
background: #fff;
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 0;
|
|
bottom: 0;
|
|
@@ -387,12 +243,10 @@
|
|
}
|
|
}
|
|
} */
|
|
} */
|
|
.submit {
|
|
.submit {
|
|
- width: 80%;
|
|
|
|
|
|
+ width: 40%;
|
|
background: #22C572;
|
|
background: #22C572;
|
|
- border-radius: 50rpx;
|
|
|
|
- margin-top: 50rpx;
|
|
|
|
|
|
+ border-radius: 10rpx;
|
|
}
|
|
}
|
|
-
|
|
|
|
.bottom-btn {
|
|
.bottom-btn {
|
|
padding: 30rpx;
|
|
padding: 30rpx;
|
|
background: #FFFFFF;
|
|
background: #FFFFFF;
|
|
@@ -401,9 +255,7 @@
|
|
bottom: 0rpx;
|
|
bottom: 0rpx;
|
|
display: flex;
|
|
display: flex;
|
|
z-index: 9999;
|
|
z-index: 9999;
|
|
- justify-content: space-evenly;
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
.buns_item {
|
|
.buns_item {
|
|
display: flex;
|
|
display: flex;
|
|
padding: 80rpx 0 50rpx 0;
|
|
padding: 80rpx 0 50rpx 0;
|
|
@@ -422,42 +274,4 @@
|
|
/deep/.u-radio-group {
|
|
/deep/.u-radio-group {
|
|
flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
}
|
|
-
|
|
|
|
- .img {
|
|
|
|
- width: 50rpx;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .uni-container {
|
|
|
|
- padding: 20rpx;
|
|
|
|
-
|
|
|
|
- .top {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
-
|
|
|
|
- .center {
|
|
|
|
- margin-right: 20rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .listitemStatus {
|
|
|
|
- color: red;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .bk-button {
|
|
|
|
- background: #22C572;
|
|
|
|
- color: white;
|
|
|
|
- width: 100rpx;
|
|
|
|
- padding: 10rpx;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- border-radius: 50rpx;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .offClockDate,
|
|
|
|
- .toClockDate {
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: center;
|
|
|
|
- }
|
|
|
|
</style>
|
|
</style>
|