index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="attendance-rules">
  3. <c-navbar title="考勤规则"> </c-navbar>
  4. <view class="content">
  5. <view class="u-info">
  6. <userAvatar></userAvatar>
  7. <view class="col">
  8. <text class="u-name">{{ detailsInfo.nickName }}</text>
  9. <view class="u-office">
  10. <text class="department"> 考勤组 </text>
  11. <view
  12. :class="
  13. detailsInfo.isGroup === '0' ? 'grey-txt' : 'position'
  14. "
  15. >
  16. {{ detailsInfo.groupName }}
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="cell">
  22. <view class="c-header">
  23. <image
  24. class="left-icon"
  25. src="@/static/images/attendanceClock/kq-date.png"
  26. ></image>
  27. <text class="cell-title">考勤时间</text>
  28. </view>
  29. <view class="tips">
  30. <text class="label">上下班时间:</text>
  31. <text class="value">周一、周二、周三、周四、周五</text>
  32. </view>
  33. <view class="tips">
  34. <text class="label">班次:</text>
  35. <text class="value">{{ detailsRules.checkNum }}</text>
  36. </view>
  37. </view>
  38. <view class="cell">
  39. <view class="c-header">
  40. <image
  41. class="left-icon"
  42. src="@/static/images/attendanceClock/pt.png"
  43. ></image>
  44. <text class="cell-title">打卡点位</text>
  45. </view>
  46. <statusView v-if="pointVOS.length === 0"></statusView>
  47. <view
  48. class="point-vos"
  49. :key="idx"
  50. v-for="(item, idx) in pointVOS"
  51. >
  52. <view class="idx">{{ idx + 1 }}</view>
  53. <view class="right-content">
  54. <view v-if="item.checkPoint">
  55. <text class="label">考勤点位:</text>
  56. <text class="value">{{ item.checkPoint }}</text>
  57. </view>
  58. <view v-if="item.checkAddr">
  59. <text class="label">打卡地址:</text>
  60. <text class="value">{{ item.checkAddr }}</text>
  61. </view>
  62. <view v-if="item.checkRange">
  63. <text class="label">打卡范围:</text>
  64. <text class="value">{{ item.checkRange }}米以内</text>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="cell">
  70. <view class="c-header">
  71. <image
  72. class="left-icon"
  73. src="@/static/images/attendanceClock/rules.png"
  74. ></image>
  75. <text class="cell-title">补卡规则</text>
  76. </view>
  77. <view class="tips">
  78. <text class="label">补卡次数:</text>
  79. <text class="value">
  80. 每个月最多可提交{{ detailsRules.replaceNum || '-' }}次
  81. </text>
  82. </view>
  83. <view class="tips">
  84. <text class="label">补卡时间:</text>
  85. <text class="value">
  86. 最多可申请个{{
  87. detailsRules.replaceTime || '-'
  88. }}工作日内的补卡
  89. </text>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import userAvatar from '@/pages/my/userAvatar.vue';
  97. import { getCheckRule } from '@/api/attendanceClock/index.js';
  98. import statusView from '@/components/statusView';
  99. export default {
  100. name: 'attendanceRules',
  101. components: {
  102. userAvatar,
  103. statusView,
  104. },
  105. data() {
  106. return {
  107. detailsRules: {},
  108. detailsInfo: {},
  109. };
  110. },
  111. computed: {
  112. pointVOS() {
  113. return this.detailsRules?.pointVOS || [];
  114. },
  115. },
  116. onLoad(params) {
  117. this.detailsInfo = params;
  118. this.getRules();
  119. },
  120. methods: {
  121. async getRules() {
  122. const { data } = await getCheckRule();
  123. this.detailsRules = data || {};
  124. },
  125. },
  126. };
  127. </script>
  128. <style scoped lang="scss">
  129. .attendance-rules {
  130. .content {
  131. padding: 28rpx;
  132. .u-info {
  133. display: flex;
  134. align-items: center;
  135. background-color: #fff;
  136. padding: 20rpx;
  137. border-radius: 6px;
  138. .col {
  139. display: flex;
  140. flex-direction: column;
  141. margin-left: 20rpx;
  142. background-color: #fff;
  143. .u-name {
  144. font-size: 13px;
  145. color: #000000;
  146. }
  147. .u-office {
  148. display: flex;
  149. align-items: center;
  150. margin-top: 20rpx;
  151. .department {
  152. font-size: 13px;
  153. color: #8c93a3;
  154. }
  155. .grey-txt {
  156. font-size: 12px;
  157. color: #8c93a3;
  158. margin-left: 10rpx;
  159. }
  160. .position {
  161. color: #ff9935;
  162. padding: 0px 6rpx;
  163. font-size: 12px;
  164. border: 1px solid #ff9935;
  165. border-radius: 10rpx;
  166. margin-left: 10rpx;
  167. background-color: rgba(239, 140, 39, 0.1);
  168. }
  169. }
  170. }
  171. }
  172. .label {
  173. font-size: 13px;
  174. color: #152f62;
  175. }
  176. .value {
  177. font-size: 13px;
  178. color: #697c9d;
  179. }
  180. .point-vos {
  181. display: flex;
  182. align-items: center;
  183. background-color: #f5f6f8;
  184. padding: 20rpx;
  185. margin-top: 20rpx;
  186. border-radius: 6px;
  187. .idx {
  188. color: #436ff6;
  189. background: rgba(67, 111, 246, 0.15);
  190. width: 26px;
  191. height: 26px;
  192. border-radius: 50%;
  193. margin-right: 20rpx;
  194. display: flex;
  195. justify-content: center;
  196. align-items: center;
  197. font-size: 13px;
  198. }
  199. .right-content {
  200. flex: 1;
  201. }
  202. }
  203. .cell {
  204. background-color: #fff;
  205. padding: 20rpx;
  206. border-radius: 6px;
  207. margin-top: 20rpx;
  208. .c-header {
  209. display: flex;
  210. align-items: center;
  211. .left-icon {
  212. width: 22px;
  213. height: 22px;
  214. }
  215. .cell-title {
  216. font-size: 16px;
  217. margin-left: 20rpx;
  218. color: #333333;
  219. }
  220. }
  221. .tips {
  222. margin-top: 16rpx;
  223. font-size: 14px;
  224. }
  225. }
  226. }
  227. }
  228. </style>