inout-record.vue 5.9 KB

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