kaoqin.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view >
  3. <view>
  4. <u-cell-group>
  5. <u-cell icon="setting-fill" :title="v.fullName" size="large" @click="kaoqin(v)" v-for="v in list" :key="v.userId">
  6. <image slot="icon" src="/static/wjw-user.png" mode="widthFix" style="width: 60rpx;margin-right: 20rpx;"></image>
  7. <view slot="value" style="font-weight: 500;" :style="{color:v.isSave=='1'?'#19be6b':'#fa3534'}">
  8. {{v.isSave=='1'?'已打卡':'未打卡'}}
  9. </view>
  10. </u-cell>
  11. </u-cell-group>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {getWeekInYear} from "@/utils/wjw.js"
  17. export default {
  18. data() {
  19. return {
  20. list:[],
  21. //当前周数
  22. weekNum:null
  23. }
  24. },
  25. onLoad(){
  26. this.getPeoList()
  27. this.weekNum = getWeekInYear(uni.$u.timeFormat(new Date().toLocaleDateString(), 'yyyy-mm-dd'))
  28. },
  29. onShow(){
  30. uni.$once('query', (query) => {
  31. if(query.a === 1){
  32. this.getPeoList()
  33. }
  34. });
  35. },
  36. onPullDownRefresh(){
  37. this.getPeoList()
  38. },
  39. methods: {
  40. //获取人员列表
  41. getPeoList(){
  42. uni.$u.http.get('/oa/attendance/dept/all').then(res=>{
  43. this.list = res.rows
  44. setTimeout(()=>{
  45. uni.stopPullDownRefresh()
  46. },2000)
  47. })
  48. },
  49. //跳转考勤详情页
  50. kaoqin(v){
  51. uni.navigateTo({
  52. url:`/pages/kqdetail/kqdetail?name=${v.fullName}&id=${v.userId}&weekNumber=${this.weekNum}&deptId=${v.deptId}`
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style>
  59. </style>