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>
@ -176,7 +176,8 @@
},
data() {
return {
tips:"",
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,6 +517,48 @@
//退
checkSignOut() {
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
icon: 'none',
title: `请先完成${this.detail.product.process_total}次打卡,再签退。当前完成打卡次数${this.detail.logs_count}`
})
return
}
//
let flag = false
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
flag = true
}
}
if (!flag) {
uni.showToast({
icon: 'none',
title: `请选择并填写服务项目与时间`
})
return
}
//
let useTotalTime = 0
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
useTotalTime += Number(i.form.time)
}
}
let totalTime = this.$moment(new Date()).diff(this.$moment(this.detail.sign_in), 'minutes')
if (useTotalTime <= (totalTime + 10) && useTotalTime > totalTime && this.detail.demand === 2) {
uni.showToast({
icon:'none',
title:'请下次补足时间',
duration:2000
})
} else if (useTotalTime <= totalTime){
} else {
this.tips="当前勾选的时间为"+useTotalTime+"分钟,实际服务时间为"+totalTime+"分钟。系统要求实际服务时间要大于您勾选的时间。";
this.isShowModal = true
return
}
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true
@ -515,61 +567,17 @@
//
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
})
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
}
//
if (this.detail.logs_count < this.detail.product.process_total) {
uni.showToast({
icon: 'none',
title: `请先完成${this.detail.product.process_total}次打卡,再签退。当前完成打卡次数${this.detail.logs_count}`
})
return
}
//
let flag = false
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
flag = true
}
}
if (!flag) {
uni.showToast({
icon: 'none',
title: `请选择并填写服务项目与时间`
})
return
}
//
let useTotalTime = 0
for (let i of this.skuList) {
if (i.isSelect && i.form.time) {
useTotalTime += Number(i.form.time)
}
}
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
}
this.signOut()
}
this.isSignOutConfirm = false
})
},
//退

Loading…
Cancel
Save