clockin.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  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' :value="adridx" :range="adrlist" @change="bindTimeChangea">
  17. <view class="pickboxa">
  18. <view class="tit overtwo" >{{day||'全部部门'}}</view>
  19. <image :src="wupimg" class="hupimg"></image>
  20. </view>
  21. </picker>
  22. <picker mode="date" class="pickbox" :value="adridx"
  23. @change="bindTimeChangea">
  24. <view class="pickboxa">
  25. <view class="tit" >{{day||'2024年07月'}}</view>
  26. <image :src="wupimg" class="hupimg"></image>
  27. </view>
  28. </picker>
  29. </view>
  30. <!-- <view class="czbtns">重置</view> -->
  31. </view>
  32. </view>
  33. </view>
  34. <image :src="navbg" class="navbg"></image>
  35. <view class="zxmain" :style="'margin-top:-'+marTop+'rpx;'">
  36. <!-- 列表 -->
  37. <y-list type='clock' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  43. import yList from "@/components/order/list.vue"
  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:[{visitType:1,visitName:'王一',createTime:"2024-01-20 17:12:38",visitDate:"2024-01-21",
  60. visitTime:'10:00 - 11:00',visitPhone:'18956988888',visitNum:'1',appointmentSite:"总经理办公室",visitReason:'会议'
  61. }],
  62. pageSize: 10,
  63. pageNum: 1,
  64. reachflag: false,
  65. wtdt:'',
  66. }
  67. },
  68. onPageScroll(e) {
  69. var scrollTop = Number(e.scrollTop);
  70. if (scrollTop > 0) {
  71. this.backgroundColor = '#0491FD'
  72. } else {
  73. this.backgroundColor = 'transparent'
  74. }
  75. },
  76. onLoad: function() {
  77. this.init()
  78. // this.getDataFn()
  79. uni.getSystemInfo({
  80. success: (e) => {
  81. this.stubarHeight = Number(e.statusBarHeight);
  82. this.nvaHeight = Number(e.statusBarHeight) + 44;
  83. this.tabscheight = Number(this.nvaHeight) * 2 + 100;
  84. }
  85. })
  86. },
  87. onUnload() {
  88. uni.$off('refreshdatalist')
  89. },
  90. onShow() {},
  91. mounted() {
  92. this.getHeightFn()
  93. },
  94. // 上拉触底加载更多触发事件
  95. onReachBottom() {
  96. if (this.reachflag) {
  97. this.pageNum++
  98. this.getDataFn()
  99. }
  100. },
  101. methods: {
  102. checkPermi,
  103. checkRole,
  104. getConfirm(){
  105. this.pageNum=1;
  106. this.list=[];
  107. this.reachflag=true;
  108. this.getDataFn()
  109. },
  110. getBack() {
  111. uni.navigateBack({
  112. delta: 1
  113. })
  114. },
  115. getDetail(data){
  116. // this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
  117. this.$tab.navigateTo('/work/pages/record/detail')
  118. },
  119. bindTimeChangea(e){
  120. var val=e.detail.value;
  121. this.day=val
  122. },
  123. getHeightFn() {
  124. let query = uni.createSelectorQuery().in(this);
  125. //需要给黄色区域设置一个id标识,在这里是demo
  126. query.select('.navbox').boundingClientRect(data => {
  127. var top = data.top < 0 ? -data.top : data.top;
  128. var stubarHeight = Number(this.stubarHeight);
  129. this.marTop = stubarHeight > 0 ? 692 - Number(data.height) * 2 : 692 - Number(data.height) *
  130. 2 + 40 //赋值,待会要用
  131. if (top <= this.nvaHeight) {
  132. const opacity = top / 100 // 计算透明度值
  133. const color = `rgba(4, 145, 253, ${opacity})`
  134. this.backgroundColor = color // 更新盒子背景颜色
  135. } else {
  136. this.backgroundColor = '#00A9F0'
  137. }
  138. }).exec();
  139. },
  140. init() {
  141. // 门卫
  142. // getDictionaryFn('is_read').then(res=>{
  143. // if(res.code==200){
  144. // this.ydztlist = res.data.map(v => {
  145. // return {
  146. // label: v.dictLabel,
  147. // value: v.dictValue
  148. // }
  149. // })
  150. // }
  151. // })
  152. },
  153. getDataFn() {
  154. var params = {
  155. pageSize: this.pageSize,
  156. pageNo: this.pageNum,
  157. // visitType:3
  158. }
  159. getCameraList(params).then(res => {
  160. if (res.code == 200) {
  161. if (res.rows.length < this.pageSize) {
  162. this.reachflag = false
  163. this.wtdt = '到底了~';
  164. } else {
  165. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  166. 1)
  167. if (num < res.total) {
  168. this.reachflag = true
  169. this.wtdt = '上拉加载更多'
  170. } else {
  171. this.reachflag = false
  172. this.wtdt = '到底了~';
  173. }
  174. }
  175. if (this.pageNum == 1) {
  176. this.list = res.rows;
  177. } else {
  178. this.list = this.list.concat(res.rows)
  179. }
  180. } else {
  181. this.$toast(res.msg)
  182. }
  183. })
  184. },
  185. },
  186. }
  187. </script>
  188. <style>
  189. /* page {
  190. background: #ffffff;
  191. } */
  192. </style>
  193. <style lang="scss" scoped>
  194. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  195. .navbg{width: 100%;height: 692rpx;}
  196. .zxmain{position: relative;padding: 8rpx 32rpx 40rpx;box-sizing: border-box;}
  197. .search{padding: 0 52rpx;box-sizing: border-box;
  198. width: 100%;height: 76rpx;background: rgba(40, 139, 214, 0.5);border-radius: 38rpx;
  199. image{width: 24rpx;height: 24rpx;margin-right: 22rpx;flex: 0 0 auto;}
  200. input{flex: 1;font-weight: 500;font-size: 22rpx;color: #131313;}
  201. }
  202. .lbtab{padding: 0 56rpx;
  203. .limg{width: 24rpx;height: 24rpx;margin-right: 16rpx;flex:0 0 auto;}
  204. .lbtabs{overflow: auto;flex-wrap: nowrap;flex:1;
  205. .pickbox{flex: 1;text-align: right;font-weight: 500;font-size: 28rpx;color: #161616;min-height:88rpx;margin: 0 10rpx;
  206. .pickboxa{justify-content: center;
  207. min-height: 88rpx;display: flex;align-items: center;
  208. }
  209. .tit{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  210. .hupimg{width: 16rpx;height: 10rpx;margin-left: 26rpx;flex: 0 0 auto;}
  211. }
  212. }
  213. }
  214. </style>