inout-record.vue 5.7 KB

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