inout-record.vue 5.9 KB

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