abnormal.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="abbox">
  3. <block v-for="(ite,idx) in recordList" :key='idx'>
  4. <view class="ablist" v-if="ite.kaTypeAmIn&&ite.kaTypeAmIn!=1">
  5. <view class="ablistop">
  6. <view>{{ite.kaTime}} {{weeks[ite.kaWeek]}}</view>
  7. <view>上午上班
  8. <text v-if="ite.kaTypeAmIn==2">迟到</text>
  9. <text v-if="ite.kaTypeAmIn==3">外勤</text>
  10. <text v-if="ite.kaTypeAmIn==4">早退</text>
  11. <text v-if="ite.kaTypeAmIn==5">旷工</text>
  12. </view>
  13. </view>
  14. <!-- <view class="ablistr bg1" v-if="ite.kaTypeAmIn==2||ite.kaTypeAmIn==4||ite.kaTypeAmIn==5">补卡</view>
  15. <view class="ablistr bg6" v-if="ite.kaTypeAmIn==3">外勤</view> -->
  16. <view class="ablistr cicr2" v-if="ite.kaTypeAmIn==2">迟到</view>
  17. <view class="ablistr cicr3" v-if="ite.kaTypeAmIn==3">外勤</view>
  18. <view class="ablistr cicr4" v-if="ite.kaTypeAmIn==4">早退</view>
  19. <view class="ablistr cicr5" v-if="ite.kaTypeAmIn==5">旷工</view>
  20. </view>
  21. <view class="ablist" v-if="ite.kaTypeAmOut&&ite.kaTypeAmOut!=1">
  22. <view class="ablistop">
  23. <view>{{ite.kaTime}} {{weeks[ite.kaWeek]}}</view>
  24. <view>上午下班
  25. <text v-if="ite.kaTypeAmOut==2">迟到</text>
  26. <text v-if="ite.kaTypeAmOut==3">外勤</text>
  27. <text v-if="ite.kaTypeAmOut==4">早退</text>
  28. <text v-if="ite.kaTypeAmOut==5">旷工</text>
  29. </view>
  30. </view>
  31. <!-- <view class="ablistr bg1" v-if="ite.kaTypeAmOut==2||ite.kaTypeAmOut==4||ite.kaTypeAmOut==5">补卡</view>
  32. <view class="ablistr bg6" v-if="ite.kaTypeAmOut==3">外勤</view> -->
  33. <view class="ablistr cicr2" v-if="ite.kaTypeAmOut==2">迟到</view>
  34. <view class="ablistr cicr3" v-if="ite.kaTypeAmOut==3">外勤</view>
  35. <view class="ablistr cicr4" v-if="ite.kaTypeAmOut==4">早退</view>
  36. <view class="ablistr cicr5" v-if="ite.kaTypeAmOut==5">旷工</view>
  37. </view>
  38. <view class="ablist" v-if="ite.kaTypePmIn&&ite.kaTypePmIn!=1">
  39. <view class="ablistop">
  40. <view>{{ite.kaTime}} {{weeks[ite.kaWeek]}}</view>
  41. <view>下午上班
  42. <text v-if="ite.kaTypePmIn==2">迟到</text>
  43. <text v-if="ite.kaTypePmIn==3">外勤</text>
  44. <text v-if="ite.kaTypePmIn==4">早退</text>
  45. <text v-if="ite.kaTypePmIn==5">旷工</text>
  46. </view>
  47. </view>
  48. <!-- <view class="ablistr bg1" v-if="ite.kaTypePmIn==2||ite.kaTypePmIn==4||ite.kaTypePmIn==5">补卡</view>
  49. <view class="ablistr bg6" v-if="ite.kaTypePmIn==3">外勤</view> -->
  50. <view class="ablistr cicr2" v-if="ite.kaTypePmIn==2">迟到</view>
  51. <view class="ablistr cicr3" v-if="ite.kaTypePmIn==3">外勤</view>
  52. <view class="ablistr cicr4" v-if="ite.kaTypePmIn==4">早退</view>
  53. <view class="ablistr cicr5" v-if="ite.kaTypePmIn==5">旷工</view>
  54. </view>
  55. <view class="ablist" v-if="ite.kaTypePmOut&&ite.kaTypePmOut!=1">
  56. <view class="ablistop">
  57. <view>{{ite.kaTime}} {{weeks[ite.kaWeek]}}</view>
  58. <view>下午下班
  59. <text v-if="ite.kaTypePmOut==2">迟到</text>
  60. <text v-if="ite.kaTypePmOut==3">外勤</text>
  61. <text v-if="ite.kaTypePmOut==4">早退</text>
  62. <text v-if="ite.kaTypePmOut==5">旷工</text>
  63. </view>
  64. </view>
  65. <!-- <view class="ablistr bg1" v-if="ite.kaTypePmOut==2||ite.kaTypePmOut==4||ite.kaTypePmOut==5">补卡</view> -->
  66. <view class="ablistr cicr2" v-if="ite.kaTypePmOut==2">迟到</view>
  67. <view class="ablistr cicr3" v-if="ite.kaTypePmOut==3">外勤</view>
  68. <view class="ablistr cicr4" v-if="ite.kaTypePmOut==4">早退</view>
  69. <view class="ablistr cicr5" v-if="ite.kaTypePmOut==5">旷工</view>
  70. </view>
  71. </block>
  72. <view class="shax" v-if="recordList.length>0">{{wtdt}}</view>
  73. <view class="nodata" v-else>
  74. <image :src="noiconpimg"></image>
  75. <view>
  76. 暂无数据
  77. </view>
  78. </view>
  79. <!-- <block v-else>
  80. <view class="shax">
  81. 暂无数据
  82. </view>
  83. </block> -->
  84. <!-- <view class="ablist">
  85. <view class="ablistop">
  86. <view>2021-05-12 星期一</view>
  87. <view>临时请假 1小时32分钟</view>
  88. <view class="ablistopt">请假时间:09:06-10:38</view>
  89. </view>
  90. <view class="ablistr bg0" @click="getNoFan">销假</view>
  91. </view>
  92. <view class="ablist">
  93. <view class="ablistop">
  94. <view>2021-05-12 星期一</view>
  95. <view>下午上班打卡 未打卡</view>
  96. <view class="ablistopt">打卡时间:09:01</view>
  97. </view>
  98. <view class="ablistr bg6">请假</view>
  99. </view> -->
  100. </view>
  101. </template>
  102. <script>
  103. import {
  104. getRecordList} from "@/api/work/check.js"
  105. export default{
  106. data(){
  107. return{
  108. noiconpimg:require("@/work/static/clock/noiconp.png"),
  109. pageNum:1,
  110. pageSize:10,
  111. reachflag:true,
  112. wtdt:'上拉加载更多',
  113. recordList:[],
  114. userId: this.$store.state.user.userId,
  115. deptId: this.$store.state.user.deptId,
  116. weeks: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  117. }
  118. },
  119. onLoad() {
  120. // this.formatDateTime()
  121. // this.getDataFn()
  122. },
  123. methods:{
  124. getNoFan(){
  125. this.$tab.navigateTo("/pages/noleave")
  126. },
  127. formatDateTime() {
  128. var date=new Date()
  129. let y = date.getFullYear();
  130. let m = date.getMonth() + 1;
  131. m = m < 10 ? "0" + m : m;
  132. let d = date.getDate();
  133. d = d < 10 ? "0" + d : d;
  134. const time = y + "-" + m ;
  135. this.kaYear=y;
  136. this.kaMonth=m;
  137. return `${y}-${m}`;
  138. },
  139. getDataFn() {
  140. var params = {
  141. deptId: this.deptId,
  142. userId: this.userId,
  143. pageSize: this.pageSize,
  144. pageNum: this.pageNum,
  145. kaYear: this.kaYear,
  146. kaMonth: this.kaMonth,
  147. kaStatus:2
  148. }
  149. getRecordList(params).then(res => {
  150. if (res.code == 200) {
  151. if (res.rows.length < this.pageSize) {
  152. this.reachflag = false
  153. this.wtdt = '到底了~';
  154. } else {
  155. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  156. 1)
  157. if (num < res.total) {
  158. this.reachflag = true
  159. this.wtdt = '上拉加载更多'
  160. } else {
  161. this.reachflag = false
  162. this.wtdt = '到底了~';
  163. }
  164. }
  165. if (this.pageNum == 1) {
  166. this.recordList = res.rows;
  167. } else {
  168. this.recordList = this.recordList.concat(res.rows)
  169. }
  170. } else {
  171. this.$toast(res.msg)
  172. }
  173. })
  174. },
  175. }
  176. }
  177. </script>
  178. <style scoped lang="scss">
  179. .nodata{
  180. padding-top: 200rpx;display: flex;flex-direction: column;align-items: center;
  181. image{width: 472rpx;height: 308rpx;margin-bottom: 48rpx;}
  182. view{font-size: 26rpx;color: #343434;font-weight: bold;}
  183. }
  184. .abbox{padding: 32rpx 32rpx 4rpx;background-color: #f2f2f2;box-sizing: border-box;min-height: 100vh;}
  185. .ablist{background: #FFFFFF;
  186. box-shadow: 0px 4rpx 6rpx 0px rgba(189,189,189,0.35);margin-bottom: 20rpx;
  187. border-radius: 10rpx;padding: 36rpx 24rpx 20rpx 36rpx;display: flex;align-items: center;
  188. .ablistop{font-size: 28rpx;color: #343434;flex: 1;line-height: 40rpx;
  189. .ablistopt{font-size: 28rpx;color: #666666;margin-top: 6rpx;}
  190. }
  191. .ablistr{min-width: 138rpx;height: 48rpx;background: #6CBC0A;border-radius: 24rpx;font-size: 26rpx;color: #FFFFFF;line-height: 48rpx;text-align: center;padding: 0 12rpx;box-sizing: border-box;flex: 0 0 auto;margin-left: 20rpx;
  192. &.cicr2{background-color: $uni-katype2 !important;}//迟到
  193. &.cicr3{background-color: $uni-katype3 !important;}//外勤
  194. &.cicr4{background-color: $uni-katype4 !important;}//早退
  195. &.cicr5{background-color: $uni-katype5 !important;}//旷工
  196. }
  197. }
  198. </style>