|
|
@@ -69,12 +69,20 @@ |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 打卡成功提示 --> |
|
|
|
<success-dialog |
|
|
|
<!-- <success-dialog |
|
|
|
:visible="showSuccessDialog" |
|
|
|
:punch-time="currentCompleteDate" |
|
|
|
:location="attendanceGroup.areaName" |
|
|
|
@close="closeSuccessDialog" |
|
|
|
/> |
|
|
|
/> --> |
|
|
|
|
|
|
|
<!-- 打卡成功提示 --> |
|
|
|
<success-dialog |
|
|
|
:visible="showSuccessDialog" |
|
|
|
:punch-time="currentCompleteDate" |
|
|
|
:location="formattedAddress" |
|
|
|
@close="closeSuccessDialog" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 位置信息显示 --> |
|
|
|
<location-info |
|
|
@@ -102,6 +110,8 @@ import RemarkDialog from './components/RemarkDialog.vue' |
|
|
|
import SuccessDialog from './components/SuccessDialog.vue' |
|
|
|
import LocationInfo from './components/LocationInfo.vue' |
|
|
|
|
|
|
|
import { getGeocode } from '@/api/checkin/punch-card' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'MCheckin', |
|
|
|
components: { |
|
|
@@ -116,6 +126,9 @@ export default { |
|
|
|
currentCompleteDate: '', |
|
|
|
timeIntervalId: null, |
|
|
|
|
|
|
|
// 打卡成功地址 |
|
|
|
formattedAddress: '', |
|
|
|
|
|
|
|
// 位置相关 |
|
|
|
userLocation: { |
|
|
|
latitude: null, |
|
|
@@ -425,7 +438,23 @@ export default { |
|
|
|
|
|
|
|
this.currentCompleteDate = AttendanceService.formatDateTime(new Date()) |
|
|
|
this.showSuccessDialog = true |
|
|
|
this.formattedAddress = 'Loading...' |
|
|
|
|
|
|
|
try { |
|
|
|
const res = await getGeocode(this.userLocation.longitude, this.userLocation.latitude) |
|
|
|
console.log(res) |
|
|
|
const {status, results} = res |
|
|
|
if (status.code === 200 && results.length > 0) { |
|
|
|
const {formatted} = results[0] |
|
|
|
this.formattedAddress = formatted |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.formattedAddress = this.attendanceGroup.areaName |
|
|
|
console.error(error) |
|
|
|
} |
|
|
|
|
|
|
|
await this.loadTodayAttendance(this.userinfo.userId) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |