xy 2 years ago
parent 7436b7c576
commit f15c01a59a

@ -152,7 +152,7 @@
</view>
</view>
<u-modal v-model="isShowModal" :content="tips" @confirm="isShowModal = false">
<u-modal v-model="isShowModal" :show-cancel-button="isSignOutConfirm" :content="tips" @confirm="modalConfirm">
</u-modal>
<imgUpload ref="imgUpload" :isShow.sync="isShowImg" :type="type" @confirm="clock"></imgUpload>
@ -177,6 +177,7 @@
data() {
return {
tips: "",
isSignOutConfirm: false,
isShowModal: false, //
type: 0, //,1 2 3退
isShowImg: false,
@ -219,6 +220,15 @@
}
},
methods: {
modalConfirm () {
this.isShowModal = false
if (this.isSignOutConfirm) {
this.signOut()
}
},
showimg(img) {
if (img.upload)
this.$showimg({
@ -507,23 +517,6 @@
//退
checkSignOut() {
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true
}).then(res => {
if (res[1]) {
//
const distance = this.getMapDistance([res[1].latitude,res[1].longitude],this.detail.sign_in_loc.split(","))
console.log('distance',distance)
if (!distance && distance > 2) {
uni.showToast({
icon:'none',
title:'当前签退位置距离签到位置过远!',
duration:2000
})
return
}
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
@ -546,7 +539,6 @@
})
return
}
//
let useTotalTime = 0
for (let i of this.skuList) {
@ -556,20 +548,36 @@
}
let totalTime = this.$moment(new Date()).diff(this.$moment(this.detail.sign_in), 'minutes')
if (useTotalTime <= (totalTime + 10) && useTotalTime > totalTime && this.detail.demand === 2) {
this.signOut()
uni.showToast({
icon:'none',
title:'请下次补足时间',
duration:2000
})
} else if (useTotalTime <= totalTime){
this.signOut()
} else {
this.tips="当前勾选的时间为"+useTotalTime+"分钟,实际服务时间为"+totalTime+"分钟。系统要求实际服务时间要大于您勾选的时间。";
this.isShowModal = true
return
}
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true
}).then(res => {
if (res[1]) {
//
const distance = this.getMapDistance([res[1].latitude,res[1].longitude],this.detail.sign_in_loc.split(","))
console.log('distance',distance)
if (distance && this.detail.product?.product_type?.max_distance && distance > this.detail.product.product_type.max_distance) {
this.isSignOutConfirm = true
this.tips = `当前签退位置距离签到位置超过${this.detail.product.product_type.max_distance}公里,确认要继续签退吗?`
this.isShowModal = true
return
}
this.signOut()
}
this.isSignOutConfirm = false
})
},
//退

Loading…
Cancel
Save