inout-record.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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="0">
  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.carNo}}</text>
  20. </view>
  21. <view class="item">
  22. <text class="p1">联系人:</text>
  23. <text class="p2">{{recordItem.driverName}}</text>
  24. </view>
  25. <view class="item">
  26. <text class="p1">联系电话:</text>
  27. <text class="p2">{{recordItem.driverPhone}}</text>
  28. </view>
  29. <view class="item" >
  30. <text class="p1">入场时间:</text>
  31. <text class="p2">{{recordItem.realInTime}}</text>
  32. </view>
  33. <view class="item" >
  34. <text class="p1">出场时间:</text>
  35. <text class="p2">{{recordItem.realOutTime}}</text>
  36. </view>
  37. <view class="item">
  38. <text class="p1">状态:</text>
  39. <text class="p2">
  40. <text v-if="recordItem.realInTime==null && recordItem.realOutTime==null">未进场</text>
  41. <text v-if="recordItem.realInTime!=null && recordItem.realOutTime==null">已进场</text>
  42. <text v-if="recordItem.realInTime!=null && recordItem.realOutTime!=null">已出场</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. pageNo: 1,
  62. pageSize: 4,
  63. dataCount: 0,
  64. status: 'loadmore',
  65. page: 0,
  66. tabs: [
  67. {
  68. name: '全部',
  69. },
  70. {
  71. name: '未入场',
  72. },
  73. {
  74. name: '已入场',
  75. },
  76. {
  77. name: '已出场',
  78. }
  79. ],
  80. recordItemList:[
  81. {
  82. carNo:'',
  83. driverName: '',
  84. driverPhone:'',
  85. realInTime:'',
  86. realOutTime:'',
  87. },
  88. ],
  89. //recordList: [],
  90. }
  91. },
  92. methods: {
  93. getRecordList() {
  94. this.$api.getInOutRecord({
  95. current: this.current,
  96. pageNo: this.pageNo,
  97. pageSize: this.pageSize,
  98. dataCount: this.dataCount,
  99. }).then(resp => {
  100. this.status = 'loadmore';
  101. let recordList = resp.data;
  102. this.dataCount = resp.dataCount;
  103. this.pageNo = resp.pageNo;
  104. this.recordItemList = recordList;
  105. if(this.dataCount < this.pageSize * this.pageNo) this.status = 'nomore';
  106. })
  107. },
  108. //点击上方切换栏,根据点击项重新加载数据
  109. change(obj) {
  110. let index=obj.index;
  111. this.current = index;
  112. if(index==0){
  113. //加载全部
  114. this.getRecordList();
  115. }
  116. if(index==1){
  117. //加载未入场
  118. this.getRecordList();
  119. }
  120. if(index==2){
  121. //只加载已入场
  122. this.getRecordList();
  123. }
  124. if(index==3){
  125. //只加载已出场
  126. this.getRecordList();
  127. }
  128. },
  129. //------------------------------------------
  130. //上拉加载更多,分页模拟数据
  131. onReachBottom() {
  132. this.status = 'loading';
  133. if(this.dataCount > this.pageSize * this.pageNo){
  134. this.pageSize = parseInt(this.pageSize) + 3;
  135. this.getRecordList();
  136. }else{
  137. this.status = 'nomore';
  138. }
  139. }
  140. },
  141. onShow() {
  142. this.getRecordList();
  143. },
  144. }
  145. </script>
  146. <style lang="scss">
  147. .card-box{
  148. display: flex;
  149. width: 100%;
  150. flex-direction: column;
  151. .card{
  152. background-color: #fff;
  153. border-radius: 20rpx;
  154. margin: 20rpx 20rpx 0 20rpx;
  155. padding: 30rpx;
  156. box-sizing: border-box;
  157. display: flex;
  158. flex-direction: column;
  159. .t{
  160. width: 100%;
  161. display: flex;
  162. align-items: center;
  163. padding-bottom: 30rpx;
  164. border-bottom: 1rpx solid #f5f5f5;
  165. .icon{
  166. width: 40rpx;
  167. height: 40rpx;
  168. }
  169. .title{
  170. font-size: 30rpx;
  171. font-weight: bold;
  172. margin-left: 20rpx;
  173. }
  174. }
  175. .c{
  176. padding:15rpx 0 0 0;
  177. display: flex;
  178. flex-wrap: wrap;
  179. //border-bottom: 1rpx solid #f5f5f5;
  180. .item{
  181. width: 50%;
  182. padding: 20rpx 0;
  183. display: flex;
  184. .car-num{
  185. background-color: #edf6ff;
  186. color: #0080ff;
  187. font-size: 44rpx;
  188. padding: 15rpx 0;
  189. text-align: center;
  190. width: 100%;
  191. border-radius: 10rpx;
  192. font-weight: bold;
  193. letter-spacing: 20rpx;
  194. }
  195. .p1{
  196. font-size: 28rpx;
  197. color: #999;
  198. flex: 5;
  199. }
  200. .p2{
  201. font-size: 28rpx;
  202. color: #191919;
  203. font-weight: bold;
  204. margin-left: 20rpx;
  205. flex: 7;
  206. }
  207. }
  208. .car-num-item{
  209. width: 100%;
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. }
  214. }
  215. .b{
  216. display: flex;
  217. width: 100%;
  218. align-items: center;
  219. justify-content: space-between;
  220. .btn{
  221. height: 70rpx;
  222. display: flex;
  223. align-items: center;
  224. justify-content: center;
  225. //width: calc(50% - 15rpx);
  226. width: 100%;
  227. margin: 30rpx 0 0 0;
  228. border-radius: 10rpx;
  229. border-width: 1rpx;
  230. box-sizing: border-box;
  231. }
  232. .b1{
  233. background-color: #0080ff;
  234. color: #fff;
  235. }
  236. .b2{
  237. background-color: #f7f7f7;
  238. color: #191919;
  239. }
  240. .b3{
  241. background-color: #fff;
  242. color: #0080ff;
  243. border: 1rpx solid #0080ff;
  244. }
  245. }
  246. }
  247. }
  248. .t-btn{
  249. width: 400rpx;
  250. margin: 0 auto 80rpx auto;
  251. height: 88rpx;
  252. font-weight: bold;
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. border-radius: 10rpx;
  257. color: #191919;
  258. font-size: 28rpx;
  259. background-color: #fff;
  260. border: 1px solid #eee;
  261. }
  262. @import '@/common/common.scss'
  263. </style>