|
|
@ -149,7 +149,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
|
import { clockQuery, clockPunch, clockAudit } from '@/config/api'; |
|
|
|
|
|
|
|
const columns = [ |
|
|
@ -171,7 +171,6 @@ export default { |
|
|
|
return { |
|
|
|
columns, |
|
|
|
clockInfos: [], |
|
|
|
memberIdList: [], |
|
|
|
options: null, |
|
|
|
checkerId: undefined, |
|
|
|
morningVisible: false, |
|
|
@ -184,12 +183,10 @@ export default { |
|
|
|
auditOptions: null, |
|
|
|
morningLoading: false, |
|
|
|
nightLoading: false, |
|
|
|
startTime: '', |
|
|
|
endTime: '', |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: mapState('home', ['projectId', 'members']), |
|
|
|
computed: mapState('home', ['projectId', 'members', 'startTime', 'endTime', 'memberIdList']), |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.timer = setInterval(async () => { |
|
|
@ -204,16 +201,24 @@ export default { |
|
|
|
}); |
|
|
|
} |
|
|
|
}, 300); |
|
|
|
|
|
|
|
const time = this.$moment(Date.now()).format('YYYY-MM-DD'); |
|
|
|
if (!this.startTime) { |
|
|
|
this.setStartTime(this.$moment(`${time} 00:00`).format('x') - 0); |
|
|
|
} |
|
|
|
if (!this.endTime) { |
|
|
|
this.setEndTime(this.$moment(`${time} 23:59`).format('x') - 0); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
async setParams(options) { |
|
|
|
const { projectId } = this; |
|
|
|
const time = this.$moment(Date.now()).format('YYYY-MM-DD'); |
|
|
|
this.startTime = (options && options.startTime) || this.$moment(`${time} 00:00`).format('x') - 0; |
|
|
|
this.endTime = (options && options.endTime) || this.$moment(`${time} 23:59`).format('x') - 0; |
|
|
|
this.memberIdList = (options && options.memberIdList) || []; |
|
|
|
const params = { param: { projectId, memberIdList: this.memberIdList, startTime: this.startTime, endTime: this.endTime } }; |
|
|
|
...mapMutations('home', ['setStartTime', 'setEndTime', 'setMemberIdList']), |
|
|
|
|
|
|
|
async setParams() { |
|
|
|
const { projectId, startTime, endTime, memberIdList } = this; |
|
|
|
console.log('this.startTime: ', startTime, this.$moment(startTime - 0).format('YYYY-MM-DD HH:mm:ss')); |
|
|
|
console.log('this.endTime: ', endTime, this.$moment(endTime - 0).format('YYYY-MM-DD HH:mm:ss')); |
|
|
|
const params = { param: { projectId, memberIdList, startTime, endTime } }; |
|
|
|
await this.getClockQuery(params); |
|
|
|
}, |
|
|
|
|
|
|
|