clockin.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="打卡记录" :background-color="backgroundColor"
  5. :border="false" statusBar='true' fixed="true" @clickLeft='getBack'>
  6. </uni-nav-bar>
  7. <view class="plr16" :style="'background:'+backgroundColor">
  8. <view class="search flexc mb4">
  9. <image :src="serimg"></image>
  10. <input placeholder="请输入人员姓名进行搜索" confirm-type="search" placeholder-style="color:#B9DCF7" v-model="title" @confirm="getConfirm"/>
  11. </view>
  12. <!-- 搜索 -->
  13. <view class="lbtab flexc">
  14. <image :src="licoimg" class="limg" @click='getResetFn'></image>
  15. <view class="lbtabs flexc">
  16. <!-- <picker class="pickbox" range-key='dictLabel' :range="adrlist" @change="bindTimeChangea">
  17. <view class="pickboxa">
  18. <view class="tit overtwo" >{{deptName||'考勤类型'}}</view>
  19. <image :src="wupimg" class="hupimg"></image>
  20. </view>
  21. </picker> -->
  22. <picker mode="date" class="pickbox"
  23. @change="bindTimeChangea">
  24. <view class="pickboxa">
  25. <view class="tit" >{{time||'选择时间'}}</view>
  26. <image :src="wupimg" class="hupimg"></image>
  27. </view>
  28. </picker>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <image :src="navbg" class="navbg"></image>
  34. <view class="zxmain">
  35. <!-- 列表 -->
  36. <y-list type='clock' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  42. import yList from "@/work/components/yuyue/list.vue"
  43. import {getRecordPeoList} from "@/api/work/check.js"
  44. import {getDictionaryFn} from "@/api/mine/register.js"
  45. export default {
  46. components: {yList},
  47. data() {
  48. return {
  49. wupimg:require("@/work/static/record/wup.png"),
  50. serimg:require("@/work/static/record/search.png"),
  51. licoimg:require("@/work/static/record/lico.png"),
  52. navbg:require("@/static/images/navbg.png"),
  53. backgroundColor: "transparent",
  54. datainfo:{},
  55. nvaHeight: 44,
  56. marTop: 0, //距离顶部的距离
  57. stubarHeight: 0, //
  58. title:'',
  59. list:[],
  60. pageSize: 10,
  61. pageNum: 1,
  62. reachflag: false,
  63. wtdt:'',
  64. userId:this.$store.state.user.userId,
  65. deptName:'',
  66. time:'',
  67. adrlist:[],
  68. }
  69. },
  70. onPageScroll(e) {
  71. var scrollTop = Number(e.scrollTop);
  72. if (scrollTop > 0) {
  73. this.backgroundColor = '#0491FD'
  74. } else {
  75. this.backgroundColor = 'transparent'
  76. }
  77. },
  78. onLoad: function() {
  79. this.init()
  80. this.getDataFn()
  81. uni.getSystemInfo({
  82. success: (e) => {
  83. this.stubarHeight = Number(e.statusBarHeight);
  84. this.nvaHeight = Number(e.statusBarHeight) + 44;
  85. }
  86. })
  87. },
  88. onShow() {},
  89. // 上拉触底加载更多触发事件
  90. onReachBottom() {
  91. if (this.reachflag) {
  92. this.pageNum++
  93. this.getDataFn()
  94. }
  95. },
  96. methods: {
  97. checkPermi,
  98. checkRole,
  99. getConfirm(){
  100. this.pageNum=1;
  101. this.list=[];
  102. this.reachflag=true;
  103. this.getDataFn()
  104. },
  105. getResetFn(){
  106. this.time='';
  107. this.title='';
  108. this.getConfirm()
  109. },
  110. getBack() {
  111. uni.navigateBack({
  112. delta: 1
  113. })
  114. },
  115. gettypeFn(){
  116. },
  117. getDelFn(){
  118. },
  119. getDetail(ite){
  120. var obj={
  121. userId:ite.userId,
  122. recordDate:ite.clockMap.date
  123. }
  124. this.$tab.navigateTo('/work/pages/record/detail?data='+encodeURIComponent(JSON.stringify(obj)))
  125. },
  126. bindTimeChangea(e){
  127. var val=e.detail.value;
  128. this.time=val
  129. this.getConfirm()
  130. },
  131. init() {
  132. // 门卫
  133. // getDictionaryFn('is_read').then(res=>{
  134. // if(res.code==200){
  135. // this.ydztlist = res.data.map(v => {
  136. // return {
  137. // label: v.dictLabel,
  138. // value: v.dictValue
  139. // }
  140. // })
  141. // }
  142. // })
  143. },
  144. getDataFn() {
  145. var params = {
  146. pageSize: this.pageSize,
  147. pageNum: this.pageNum,
  148. }
  149. if(!checkRole(['administrators'])){
  150. params.userId=this.userId
  151. }
  152. if(this.time){
  153. params.recordDate=this.time
  154. }
  155. if(this.title){
  156. params.userName=this.title
  157. }
  158. getRecordPeoList(params).then(res => {
  159. if (res.code == 200) {
  160. if (res.rows.length < this.pageSize) {
  161. this.reachflag = false
  162. this.wtdt = '到底了~';
  163. } else {
  164. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  165. 1)
  166. if (num < res.total) {
  167. this.reachflag = true
  168. this.wtdt = '上拉加载更多'
  169. } else {
  170. this.reachflag = false
  171. this.wtdt = '到底了~';
  172. }
  173. }
  174. if (this.pageNum == 1) {
  175. this.list = res.rows;
  176. } else {
  177. this.list = this.list.concat(res.rows)
  178. }
  179. } else {
  180. this.$toast(res.msg)
  181. }
  182. })
  183. },
  184. },
  185. }
  186. </script>
  187. <style>
  188. /* page {
  189. background: #ffffff;
  190. } */
  191. </style>
  192. <style lang="scss" scoped>
  193. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  194. .navbg{width: 100%;height: 692rpx;}
  195. .zxmain{position: relative;padding: 180rpx 32rpx 40rpx;box-sizing: border-box;}
  196. .search{padding: 0 52rpx;box-sizing: border-box;
  197. width: 100%;height: 76rpx;background: rgba(40, 139, 214, 0.5);border-radius: 38rpx;
  198. image{width: 24rpx;height: 24rpx;margin-right: 22rpx;flex: 0 0 auto;}
  199. input{flex: 1;font-weight: 500;font-size: 22rpx;color: #FFFFFF;}
  200. }
  201. .lbtab{padding: 0 56rpx;
  202. .limg{width: 24rpx;height: 24rpx;margin-right: 16rpx;flex:0 0 auto;}
  203. .lbtabs{overflow: auto;flex-wrap: nowrap;flex:1;
  204. .pickbox{text-align: right;font-weight: 500;font-size: 28rpx;color: #161616;min-height:88rpx;margin: 0 20rpx;
  205. .pickboxa{justify-content: center;
  206. min-height: 88rpx;display: flex;align-items: center;
  207. }
  208. .tit{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  209. .hupimg{width: 16rpx;height: 10rpx;margin-left: 26rpx;flex: 0 0 auto;}
  210. }
  211. }
  212. }
  213. </style>