detail-steps.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <!-- 考勤统计展示-详情 -->
  3. <view class="steps">
  4. <view class="rest" v-if="showEmpty"> 今日休息,无打卡信息 </view>
  5. <u-steps v-else dot :current="current" direction="column">
  6. <u-steps-item>
  7. <view class="go-work-content" slot="desc">
  8. <!--title-->
  9. <view class="step-item-title">
  10. 上班 {{ detailsInfo.clockInTime }}
  11. </view>
  12. <!--content-->
  13. <view class="step-item-content">
  14. <!--上班数据为空-->
  15. <view v-if="notClockUp" style="color: #8c8c8c">
  16. 未打卡
  17. </view>
  18. <!--已打上班卡(正常、迟到、旷工)-->
  19. <checkedInWork
  20. :detailsInfo="detailsInfo"
  21. v-if="
  22. [
  23. statusKeys.CHECK_IN,
  24. statusKeys.BE_LATE,
  25. statusKeys.ABSENTEEISM,
  26. ].includes(clockStatus)
  27. "
  28. />
  29. <!--未上班打卡,但是已过打卡时间(缺卡)-->
  30. <clockInTimeout
  31. v-if="[statusKeys.CHECK_NO].includes(clockStatus)"
  32. />
  33. </view>
  34. </view>
  35. </u-steps-item>
  36. <u-steps-item>
  37. <view class="off-work-content" slot="desc">
  38. <view class="step-item-title-ash">
  39. 下班 {{ detailsInfo.clockOutTime }}
  40. </view>
  41. <view class="step-item-content">
  42. <!--下班为空-->
  43. <view v-if="notClockingIn" style="color: #8c8c8c">
  44. 未打卡
  45. </view>
  46. <!--已打下班卡(正常、加班、早退、旷工)-->
  47. <checkedInWork
  48. :detailsInfo="detailsInfo"
  49. :notShowUpdate="true"
  50. @punchClock="$emit('punchClock')"
  51. type="1"
  52. v-if="
  53. [
  54. statusKeys.CHECK_OUT,
  55. statusKeys.OVERTIME,
  56. statusKeys.LEAVE_EARLY,
  57. statusKeys.ABSENTEEISM,
  58. ].includes(clockStatusDown)
  59. "
  60. />
  61. <!--未打下班卡,但是已过打卡时间(缺卡)-->
  62. <clockInTimeout
  63. type="1"
  64. v-if="[statusKeys.CHECK_NO].includes(clockStatusDown)"
  65. />
  66. </view>
  67. </view>
  68. </u-steps-item>
  69. </u-steps>
  70. </view>
  71. </template>
  72. <script>
  73. import checkedInWork from '@/pages/attendanceClock/workContent/checkedInWork.vue'; // 已打上班卡
  74. import clockInTimeout from '@/pages/attendanceClock/workContent/clockInTimeout.vue'; // 未打卡(缺卡)
  75. import { statusKeys } from '@/pages/attendanceClock/com/allCheckData.js';
  76. export default {
  77. name: 'detailSteps',
  78. components: {
  79. checkedInWork,
  80. clockInTimeout,
  81. },
  82. props: {
  83. selectDay: {
  84. // 选中的天
  85. default: () => ({}),
  86. type: Object,
  87. },
  88. detailsInfo: {
  89. // 打卡详情
  90. default: () => ({}),
  91. type: Object,
  92. },
  93. },
  94. computed: {
  95. showEmpty() {
  96. const { isHoliday } = this.selectDay;
  97. const { clockInDetailVO, clockOutDetailVO } = this.detailsInfo;
  98. return (
  99. isHoliday !== '0' && !clockInDetailVO && !clockOutDetailVO
  100. ); // isHoliday不是上班 并且上下班数据为空
  101. },
  102. current() {
  103. if (this.clockStatus) {
  104. return 1;
  105. }
  106. return 0;
  107. },
  108. // 上班---
  109. clockStatus() {
  110. // 上班status
  111. const detailVO = this.detailsInfo?.clockInDetailVO || {};
  112. return detailVO.status;
  113. },
  114. notClockUp() {
  115. // 上班的状态为空
  116. return !this.clockStatus;
  117. },
  118. // 下班---
  119. notClockingIn() {
  120. // 下班的状态为空
  121. return !this.clockStatusDown;
  122. },
  123. clockStatusDown() {
  124. // 下班status
  125. const detailVO = this.detailsInfo?.clockOutDetailVO || {};
  126. return detailVO.status;
  127. },
  128. // com
  129. },
  130. data() {
  131. return {
  132. statusKeys,
  133. };
  134. },
  135. };
  136. </script>
  137. <style scoped lang="scss">
  138. .steps {
  139. .rest {
  140. background-color: #fff;
  141. padding: 20rpx;
  142. color: $u-tips-color;
  143. font-size: 14px;
  144. border-radius: 4px;
  145. }
  146. /deep/.u-steps-item__wrapper__dot {
  147. width: 8px;
  148. height: 8px;
  149. }
  150. /deep/ .u-steps-item__wrapper {
  151. background-color: #f8f8f8;
  152. }
  153. .step-item-title {
  154. color: #152f62;
  155. font-size: 14px;
  156. }
  157. .step-item-title-ash {
  158. font-size: 14px;
  159. color: #656972;
  160. }
  161. .step-item-content {
  162. position: relative;
  163. padding: 40rpx;
  164. background-color: #fff;
  165. border-radius: 4px;
  166. margin-top: 8rpx;
  167. }
  168. }
  169. </style>