inout-record.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. pageNo: 1,
  60. pageSize: 3,
  61. dataCount: 0,
  62. status: 'loadmore',
  63. page: 0,
  64. tabs: [
  65. {
  66. name: '全部',
  67. },
  68. {
  69. name: '未入场',
  70. },
  71. {
  72. name: '已入场',
  73. },
  74. {
  75. name: '已出场',
  76. }
  77. ],
  78. recordItemList:[
  79. {
  80. customerName:'',
  81. cardNo:'',
  82. dutyPeople:'',
  83. customerContact:'',
  84. realInTime:'',
  85. outDayTime:'',
  86. status:''
  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(index) {
  110. this.current = index;
  111. if(index==0){
  112. //加载全部
  113. this.getRecordList();
  114. }
  115. if(index==1){
  116. //加载未入场
  117. this.getRecordList();
  118. }
  119. if(index==2){
  120. //只加载已入场
  121. this.getRecordList();
  122. }
  123. if(index==3){
  124. //只加载已出场
  125. this.getRecordList();
  126. }
  127. },
  128. //------------------------------------------
  129. //上拉加载更多,分页模拟数据
  130. onReachBottom() {
  131. this.status = 'loading';
  132. if(this.dataCount > this.pageSize * this.pageNo){
  133. this.pageSize = parseInt(this.pageSize) + 3;
  134. this.getRecordList();
  135. }else{
  136. this.status = 'nomore';
  137. }
  138. }
  139. },
  140. onShow() {
  141. this.getRecordList();
  142. },
  143. }
  144. </script>
  145. <style lang="scss">
  146. .card-box{
  147. display: flex;
  148. width: 100%;
  149. flex-direction: column;
  150. .card{
  151. background-color: #fff;
  152. border-radius: 20rpx;
  153. margin: 20rpx 20rpx 0 20rpx;
  154. padding: 30rpx;
  155. box-sizing: border-box;
  156. display: flex;
  157. flex-direction: column;
  158. .t{
  159. width: 100%;
  160. display: flex;
  161. align-items: center;
  162. padding-bottom: 30rpx;
  163. border-bottom: 1rpx solid #f5f5f5;
  164. .icon{
  165. width: 40rpx;
  166. height: 40rpx;
  167. }
  168. .title{
  169. font-size: 30rpx;
  170. font-weight: bold;
  171. margin-left: 20rpx;
  172. }
  173. }
  174. .c{
  175. padding:15rpx 0 0 0;
  176. display: flex;
  177. flex-wrap: wrap;
  178. //border-bottom: 1rpx solid #f5f5f5;
  179. .item{
  180. width: 50%;
  181. padding: 20rpx 0;
  182. display: flex;
  183. .car-num{
  184. background-color: #edf6ff;
  185. color: #0080ff;
  186. font-size: 44rpx;
  187. padding: 15rpx 0;
  188. text-align: center;
  189. width: 100%;
  190. border-radius: 10rpx;
  191. font-weight: bold;
  192. letter-spacing: 20rpx;
  193. }
  194. .p1{
  195. font-size: 28rpx;
  196. color: #999;
  197. flex: 5;
  198. }
  199. .p2{
  200. font-size: 28rpx;
  201. color: #191919;
  202. font-weight: bold;
  203. margin-left: 20rpx;
  204. flex: 7;
  205. }
  206. }
  207. .car-num-item{
  208. width: 100%;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. }
  214. .b{
  215. display: flex;
  216. width: 100%;
  217. align-items: center;
  218. justify-content: space-between;
  219. .btn{
  220. height: 70rpx;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. //width: calc(50% - 15rpx);
  225. width: 100%;
  226. margin: 30rpx 0 0 0;
  227. border-radius: 10rpx;
  228. border-width: 1rpx;
  229. box-sizing: border-box;
  230. }
  231. .b1{
  232. background-color: #0080ff;
  233. color: #fff;
  234. }
  235. .b2{
  236. background-color: #f7f7f7;
  237. color: #191919;
  238. }
  239. .b3{
  240. background-color: #fff;
  241. color: #0080ff;
  242. border: 1rpx solid #0080ff;
  243. }
  244. }
  245. }
  246. }
  247. .t-btn{
  248. width: 400rpx;
  249. margin: 0 auto 80rpx auto;
  250. height: 88rpx;
  251. font-weight: bold;
  252. display: flex;
  253. align-items: center;
  254. justify-content: center;
  255. border-radius: 10rpx;
  256. color: #191919;
  257. font-size: 28rpx;
  258. background-color: #fff;
  259. border: 1px solid #eee;
  260. }
  261. @import '@/common/common.scss'
  262. </style>