This commit is contained in:
yanran200730
2022-05-24 16:31:10 +08:00
parent e7c61c8293
commit 2b8e4dc41d
19 changed files with 255 additions and 72 deletions

View File

@@ -20,9 +20,9 @@
<div class="info">
<div class="info-tab">
<div class="left">
<span @click="currIndex = 0" :class="[currIndex === 0 ? 'active' : '']">全部 {{ attendanceCount.all || 0 }}</span>
<span @click="currIndex = 1" :class="[currIndex === 1 ? 'active' : '']">已出勤 {{ attendanceCount.hasIn || 0 }}</span>
<span @click="currIndex = 2" :class="[currIndex === 2 ? 'active' : '']">未出勤 {{ attendanceCount.hasOut || 0 }}</span>
<span @click="changeTab(0)" :class="[currIndex === 0 ? 'active' : '']">全部 {{ attendanceCount.all || 0 }}</span>
<span @click="changeTab(1)" :class="[currIndex === 1 ? 'active' : '']">已出勤 {{ attendanceCount.hasIn || 0 }}</span>
<span @click="changeTab(2)" :class="[currIndex === 2 ? 'active' : '']">未出勤 {{ attendanceCount.hasOut || 0 }}</span>
</div>
<div class="right" @click="linkTo('./AttendanceSetting')">考勤设置</div>
</div>
@@ -58,7 +58,10 @@
date: '',
currIndex: 0,
list: [],
attendanceCount: {}
attendanceCount: {},
all: '1',
hasIn: '',
hasOut: ''
}
},
@@ -93,6 +96,26 @@
})
},
changeTab (index) {
if (index === 0) {
this.all = '1'
this.hasIn = ''
this.hasOut = ''
} else if (index === 1) {
this.all = ''
this.hasIn = '1'
this.hasOut = ''
} else {
this.all = ''
this.hasIn = ''
this.hasOut = '1'
}
this.currIndex = index
this.getList()
},
onDateChange (e) {
const values = e.detail.value.split('-')
this.date = `${values[0]}${values[1]}${values[2]}`
@@ -112,15 +135,18 @@
},
getList () {
this.$http.post(`/api/appattendancerecord/alldetail?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
this.$loading()
this.$http.post(`/api/appattendancerecord/alldetail?all=${this.all}&hasIn=${this.hasIn}&hasOut=${this.hasOut}&queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => {
if (res.code === 0) {
this.list = res.data.map(v => {
return {
...v,
workInTime: v.workInTime ? v.workInTime.split(' ')[1] : '',
workOutTime: v.workOutTime ? v.workOutTime.split(' ')[1] : ''
workInTime: v.workInTime ? this.$dayjs(v.workInTime).format('hh:mm') : '',
workOutTime: v.workOutTime ? this.$dayjs(v.workOutTime).format('hh:mm') : ''
}
})
this.$hideLoading()
}
})
}