|
@@ -247,15 +247,23 @@ const checkSignInState = () => {
|
|
|
}
|
|
|
|
|
|
const act = ref(0)
|
|
|
+
|
|
|
+const getResult = ref(false)
|
|
|
// 拜访对象滚动
|
|
|
-const visitScroll = (event: any) => {
|
|
|
+const visitScroll = async (event: any) => {
|
|
|
+ getResult.value = true
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '获取签到信息中'
|
|
|
+ })
|
|
|
let curr = event.detail.value[0]
|
|
|
act.value = curr
|
|
|
// 设置当前选中的地方,重置markers
|
|
|
curentDistance.value = locationList.value[curr]
|
|
|
|
|
|
- getSignInfo()
|
|
|
+ await getSignInfo()
|
|
|
setMarkers(curentDistance.value)
|
|
|
+ uni.hideLoading()
|
|
|
}
|
|
|
|
|
|
const getSignInfo = debounce(() => {
|
|
@@ -281,6 +289,7 @@ const getsignTempResult = async () => {
|
|
|
notClockedIn.value = true
|
|
|
signResultTime.value = ''
|
|
|
}
|
|
|
+ getResult.value = false
|
|
|
uni.hideLoading()
|
|
|
}
|
|
|
|
|
@@ -327,49 +336,52 @@ onShow(async () => {
|
|
|
const Lock = ref(false)
|
|
|
// 签退去填写表单
|
|
|
|
|
|
-const toDetail = () => {
|
|
|
- if (Lock.value) return
|
|
|
+const toDetail = debounce(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ if (getResult.value) return
|
|
|
|
|
|
- uni.showLoading({
|
|
|
- mask: true,
|
|
|
- title: '加载中'
|
|
|
- })
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
|
|
|
- Lock.value = true
|
|
|
- let TIME: number = 10
|
|
|
- // 签退时间
|
|
|
- const signOutTime = dayjs(signResultTime.value)
|
|
|
- // 获取当前时间
|
|
|
- const currentTime = dayjs()
|
|
|
-
|
|
|
- // 计算时间差是否超过15分钟
|
|
|
-
|
|
|
- if (currentTime.diff(signOutTime, 'minute') > TIME) {
|
|
|
- const data = {
|
|
|
- address: curentDistance.value?.signEntName,
|
|
|
- locationId: curentDistance.value?.signEntId,
|
|
|
- signTime: signResultTime.value,
|
|
|
- signEntType: curentDistance.value?.signEntType,
|
|
|
- longitude: curentDistance.value?.longitude,
|
|
|
- latitude: curentDistance.value?.latitude,
|
|
|
- checkOutTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
|
- }
|
|
|
+ let TIME: number = 10
|
|
|
+ // 签退时间
|
|
|
|
|
|
- useTaskStore.setSignAddressInfo(data)
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages-sub-task/task/index?value=${taskTypeId.value}&title=${title.value}`
|
|
|
- })
|
|
|
- uni.hideLoading()
|
|
|
- setTimeout(() => {
|
|
|
- Lock.value = false
|
|
|
- }, 3000)
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: `签到和签退时间间隔不可少于${TIME}分钟。`,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
+ const signOutTime = dayjs(signResultTime.value)
|
|
|
+
|
|
|
+ // 获取当前时间
|
|
|
+ const currentTime = dayjs()
|
|
|
+
|
|
|
+ // 计算时间差是否超过15分钟
|
|
|
+
|
|
|
+ if (currentTime.diff(signOutTime, 'minute') > TIME) {
|
|
|
+ const data = {
|
|
|
+ address: curentDistance.value?.signEntName,
|
|
|
+ locationId: curentDistance.value?.signEntId,
|
|
|
+ signTime: signResultTime.value,
|
|
|
+ signEntType: curentDistance.value?.signEntType,
|
|
|
+ longitude: curentDistance.value?.longitude,
|
|
|
+ latitude: curentDistance.value?.latitude,
|
|
|
+ checkOutTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+
|
|
|
+ useTaskStore.setSignAddressInfo(data)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages-sub-task/task/index?value=${taskTypeId.value}&title=${title.value}`
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ setTimeout(() => {
|
|
|
+ Lock.value = false
|
|
|
+ }, 3000)
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: `签到和签退时间间隔不可少于${TIME}分钟。`,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+}, 500)
|
|
|
|
|
|
// 卸载
|
|
|
onUnmounted(() => {
|