|
|
@@ -26,7 +26,7 @@
|
|
26
|
26
|
@attendanceHandler="handleCheckIn" />
|
|
27
|
27
|
<!-- 工作区域/班组成员 -->
|
|
28
|
28
|
<MaintainAreaOrMemberModal ref="maintainAreaOrMemberModal" v-if="showMaintain" :userInfo="userInfoAndRoles"
|
|
29
|
|
- @update-member="updateMember" :attendanceInfo="attendanceInfo"/>
|
|
|
29
|
+ @update-member="updateMember" :attendanceInfo="attendanceInfo" />
|
|
30
|
30
|
<!-- 新界面工作组状态 -->
|
|
31
|
31
|
<WorkingGroup ref="workingGroup" style="margin: 16px 0 24px 0" :attendanceInfo="attendanceInfo"
|
|
32
|
32
|
:loadUserInfoOver="loadUserInfoOver" :userInfo="userInfoAndRoles" :selectedMember="selectedMember" />
|
|
|
@@ -42,7 +42,7 @@ import WorkingGroup from './components/WorkingGroup'
|
|
42
|
42
|
import { addAttendance, areaList } from "@/api/attendance/attendance"
|
|
43
|
43
|
import { getInfo } from "@/api/login"
|
|
44
|
44
|
import { formatTime as formatTimehandler } from '@/utils/formatUtils'
|
|
45
|
|
-import { getAttendanceList } from "@/api/attendance/attendance"
|
|
|
45
|
+import { getAttendanceList, queryClickAble } from "@/api/attendance/attendance"
|
|
46
|
46
|
import { isInRangeOptimized, wgs84ToGcj02 } from '@/utils/handler'
|
|
47
|
47
|
|
|
48
|
48
|
export default {
|
|
|
@@ -108,7 +108,7 @@ export default {
|
|
108
|
108
|
|
|
109
|
109
|
// app 在前台时获取位置信息
|
|
110
|
110
|
uni.onLocationChange((res) => {
|
|
111
|
|
- this.result = {latitude:res.latitude, longitude:res.longitude}
|
|
|
111
|
+ this.result = { latitude: res.latitude, longitude: res.longitude }
|
|
112
|
112
|
});
|
|
113
|
113
|
},
|
|
114
|
114
|
async onLoad() {
|
|
|
@@ -196,7 +196,9 @@ export default {
|
|
196
|
196
|
checkInDate: today,
|
|
197
|
197
|
userId: this.$store.state.user.id
|
|
198
|
198
|
});
|
|
199
|
|
-
|
|
|
199
|
+ let res = await queryClickAble()
|
|
|
200
|
+ let checkAbleType = res.data;
|
|
|
201
|
+
|
|
200
|
202
|
// new
|
|
201
|
203
|
if (Array.isArray(data) && data.length) {
|
|
202
|
204
|
const items = data[0]
|
|
|
@@ -206,12 +208,17 @@ export default {
|
|
206
|
208
|
const latestCheckOutTime = items.items.filter(item => item.checkInType === 'CLOCK_OUT').sort((a, b) => {
|
|
207
|
209
|
return new Date(b.checkInTime) - new Date(a.checkInTime).getTime()
|
|
208
|
210
|
})[0] || {}
|
|
209
|
|
-
|
|
|
211
|
+ console.log(firstCheckOnTime,"firstCheckOnTime")
|
|
|
212
|
+
|
|
210
|
213
|
this.attendanceInfo = {
|
|
211
|
214
|
...items,
|
|
212
|
|
- checkInTime: formatTimehandler(firstCheckOnTime.checkInTime, 'hh:mm:ss', { defaultResult: '' }),
|
|
213
|
|
- checkOutTime: formatTimehandler(latestCheckOutTime.checkInTime, 'hh:mm:ss', { defaultResult: '' })
|
|
|
215
|
+ ...(checkAbleType == '1'? {checkInTime: '', checkOutTime: ''}: {}),
|
|
|
216
|
+ ...(checkAbleType == '2'? {checkInTime: formatTimehandler(firstCheckOnTime.checkInTime, 'hh:mm:ss', { defaultResult: '' }), checkOutTime: ''}:{}),
|
|
|
217
|
+ // checkInTime: checkAbleType == 1 ? '' : formatTimehandler(firstCheckOnTime.checkInTime, 'hh:mm:ss', { defaultResult: '' }),
|
|
|
218
|
+ // checkOutTime: checkAbleType == 1 ? '' : formatTimehandler(latestCheckOutTime.checkInTime, 'hh:mm:ss', { defaultResult: '' })
|
|
214
|
219
|
}
|
|
|
220
|
+ console.log(this.attendanceInfo,"this.attendanceInfo")
|
|
|
221
|
+
|
|
215
|
222
|
}
|
|
216
|
223
|
|
|
217
|
224
|
// 接口 data 可能是多条(按天),我们取第一条里的 items
|