inout-record.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">出入记录</text>
  6. </view>
  7. </view>
  8. <u-sticky offset-top="-90">
  9. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  10. </u-sticky>
  11. <view class="card-box">
  12. <view class="card" v-for="(recordItem,index) in recordItemList" :key="index">
  13. <view class="t">
  14. <image class="icon" src="../../static/home-icon-01.png"></image>
  15. <text class="title">{{recordItem.customerName}}</text>
  16. </view>
  17. <view class="c">
  18. <view class="item car-num-item">
  19. <text class="car-num">{{recordItem.cardNo}}</text>
  20. </view>
  21. <view class="item">
  22. <text class="p1">联系人:</text>
  23. <text class="p2">{{recordItem.dutyPeople}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="p1">联系电话:</text>
  27. <text class="p2">{{recordItem.customerContact}}</text>
  28. </view>
  29. <view class="item" v-if="recordItem.realInTime != null">
  30. <text class="p1">入场时间:</text>
  31. <text class="p2">{{recordItem.realInTime}}</text>
  32. </view>
  33. <view class="item" v-if="recordItem.outDayTime != null">
  34. <text class="p1">出场时间:</text>
  35. <text class="p2">{{recordItem.outDayTime}}</text>
  36. </view>
  37. <view class="item">
  38. <text class="p1">状态:</text>
  39. <text class="p2">
  40. <text v-if="recordItem.status==1">未进场</text>
  41. <text v-if="recordItem.status==2">已进场</text>
  42. <text v-if="recordItem.status==3">已出场</text>
  43. </text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <u-loadmore style="margin: 30rpx;" :status="status"/>
  49. <!-- <uni-popup ref="shpopup" type="dialog">
  50. <uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
  51. </uni-popup> -->
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. current:0,
  59. status: 'loadmore',
  60. page: 0,
  61. tabs: [
  62. {
  63. name: '全部',
  64. },
  65. {
  66. name: '未入场',
  67. },
  68. {
  69. name: '已入场',
  70. },
  71. {
  72. name: '已出场',
  73. }
  74. ],
  75. recordItemList:[
  76. {
  77. customerName:'',
  78. cardNo:'',
  79. dutyPeople:'',
  80. customerContact:'',
  81. realInTime:'',
  82. outDayTime:'',
  83. status:''
  84. },
  85. ],
  86. //recordList: [],
  87. }
  88. },
  89. methods: {
  90. getRecordList() {
  91. this.$api.getInOutRecord({
  92. current: this.current,
  93. }).then(resp => {
  94. let recordList = resp.data;
  95. this.recordItemList = recordList;
  96. })
  97. },
  98. //点击上方切换栏,根据点击项重新加载数据
  99. change(index) {
  100. this.current = index;
  101. if(index==0){
  102. //加载全部
  103. this.getRecordList();
  104. }
  105. if(index==1){
  106. //加载未入场
  107. this.getRecordList();
  108. }
  109. if(index==2){
  110. //只加载已入场
  111. this.getRecordList();
  112. }
  113. if(index==3){
  114. //只加载已出场
  115. this.getRecordList();
  116. }
  117. },
  118. //------------------------------------------
  119. //上拉加载更多,分页模拟数据
  120. // onReachBottom() {
  121. // if(this.page >= 3) return ;
  122. // this.status = 'loading';
  123. // this.page = ++ this.page;
  124. // setTimeout(() => {
  125. // this.recordItemList += 5;//接接口后把数据加上,懒得写假数据了
  126. // if(this.page >= 3) this.status = 'nomore';
  127. // else this.status = 'loading';
  128. // }, 2000)
  129. // }
  130. },
  131. onShow() {
  132. this.getRecordList();
  133. },
  134. }
  135. </script>
  136. <style lang="scss">
  137. .card-box{
  138. display: flex;
  139. width: 100%;
  140. flex-direction: column;
  141. .card{
  142. background-color: #fff;
  143. border-radius: 20rpx;
  144. margin: 20rpx 20rpx 0 20rpx;
  145. padding: 30rpx;
  146. box-sizing: border-box;
  147. display: flex;
  148. flex-direction: column;
  149. .t{
  150. width: 100%;
  151. display: flex;
  152. align-items: center;
  153. padding-bottom: 30rpx;
  154. border-bottom: 1rpx solid #f5f5f5;
  155. .icon{
  156. width: 40rpx;
  157. height: 40rpx;
  158. }
  159. .title{
  160. font-size: 30rpx;
  161. font-weight: bold;
  162. margin-left: 20rpx;
  163. }
  164. }
  165. .c{
  166. padding:15rpx 0 0 0;
  167. display: flex;
  168. flex-wrap: wrap;
  169. //border-bottom: 1rpx solid #f5f5f5;
  170. .item{
  171. width: 50%;
  172. padding: 20rpx 0;
  173. display: flex;
  174. .car-num{
  175. background-color: #edf6ff;
  176. color: #0080ff;
  177. font-size: 44rpx;
  178. padding: 15rpx 0;
  179. text-align: center;
  180. width: 100%;
  181. border-radius: 10rpx;
  182. font-weight: bold;
  183. letter-spacing: 20rpx;
  184. }
  185. .p1{
  186. font-size: 28rpx;
  187. color: #999;
  188. flex: 5;
  189. }
  190. .p2{
  191. font-size: 28rpx;
  192. color: #191919;
  193. font-weight: bold;
  194. margin-left: 20rpx;
  195. flex: 7;
  196. }
  197. }
  198. .car-num-item{
  199. width: 100%;
  200. display: flex;
  201. align-items: center;
  202. justify-content: center;
  203. }
  204. }
  205. .b{
  206. display: flex;
  207. width: 100%;
  208. align-items: center;
  209. justify-content: space-between;
  210. .btn{
  211. height: 70rpx;
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. //width: calc(50% - 15rpx);
  216. width: 100%;
  217. margin: 30rpx 0 0 0;
  218. border-radius: 10rpx;
  219. border-width: 1rpx;
  220. box-sizing: border-box;
  221. }
  222. .b1{
  223. background-color: #0080ff;
  224. color: #fff;
  225. }
  226. .b2{
  227. background-color: #f7f7f7;
  228. color: #191919;
  229. }
  230. .b3{
  231. background-color: #fff;
  232. color: #0080ff;
  233. border: 1rpx solid #0080ff;
  234. }
  235. }
  236. }
  237. }
  238. .t-btn{
  239. width: 400rpx;
  240. margin: 0 auto 80rpx auto;
  241. height: 88rpx;
  242. font-weight: bold;
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. border-radius: 10rpx;
  247. color: #191919;
  248. font-size: 28rpx;
  249. background-color: #fff;
  250. border: 1px solid #eee;
  251. }
  252. @import '@/common/common.scss'
  253. </style>