123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <template>
- <view>
- <view class="box">
- <view class="top">
- <text class="title">出入记录</text>
- </view>
- <u-search placeholder="输入车牌号查询" shape="square" v-model="carNo" @search="searchFn"
- :height="80" style="margin: 30rpx;">
- </u-search>
- </view>
- <!-- <u-sticky offset-top="0">
- <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
- </u-sticky> -->
- <view class="card-box">
- <view class="card" v-for="(recordItem,index) in recordItemList" :key="index">
- <!-- <view class="t">
- <image class="icon" src="../../static/home-icon-01.png"></image>
- <text class="title">{{recordItem.customerName}}</text>
- </view> -->
- <view class="c">
- <view class="item car-num-item">
- <text class="car-num">{{ recordItem.carNo }}</text>
- </view>
- <!-- <view class="item">
- <text class="p1">联系人:</text>
- <text class="p2">{{recordItem.driverName}}</text>
- </view> -->
- <!-- <view class="item">
- <text class="p1">联系电话:</text>
- <text class="p2">{{recordItem.driverPhone}}</text>
- </view> -->
- <view class="item">
- <text class="p1">入场时间:</text>
- <text class="p2">{{ recordItem.realInTime }}</text>
- </view>
- <view class="item">
- <text class="p1">出场时间:</text>
- <text class="p2">{{ recordItem.realOutTime }}</text>
- </view>
- <view class="item">
- <text class="p1">状态:</text>
- <text class="p2">
- <text v-if="recordItem.realInTime==null && recordItem.realOutTime==null">未进场</text>
- <text v-if="recordItem.realInTime!=null && recordItem.realOutTime==null">已进场</text>
- <text v-if="recordItem.realInTime!=null && recordItem.realOutTime!=null">已出场</text>
- </text>
- </view>
- </view>
- </view>
- </view>
- <!-- 没有数据时显示noData -->
- <noData v-if="recordItemList.length==0"></noData>
- <u-loadmore style="margin: 30rpx;" :status="status"/>
- <!-- <uni-popup ref="shpopup" type="dialog">
- <uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
- </uni-popup> -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- carNo: '',
- current: 0,
- pageNo: 1,
- pageSize: 4,
- dataCount: 0,
- status: 'loadmore',
- page: 0,
- tabs: [
- {
- name: '全部',
- },
- {
- name: '未入场',
- },
- {
- name: '已入场',
- },
- {
- name: '已出场',
- }
- ],
- recordItemList: [
- {
- carNo: '',
- driverName: '',
- driverPhone: '',
- realInTime: '',
- realOutTime: '',
- },
- ],
- //recordList: [],
- }
- },
- methods: {
- getRecordList() {
- this.$api.getInOutRecord({
- current: this.current,
- pageNo: this.pageNo,
- pageSize: this.pageSize,
- dataCount: this.dataCount,
- }).then(resp => {
- this.status = 'loadmore';
- let recordList = resp.data;
- this.dataCount = resp.dataCount;
- this.pageNo = resp.pageNo;
- this.recordItemList = recordList;
- if (this.dataCount < this.pageSize * this.pageNo) this.status = 'nomore';
- })
- },
- //点击上方切换栏,根据点击项重新加载数据
- change(obj) {
- let index = obj.index;
- this.current = index;
- if (index == 0) {
- //加载全部
- this.getRecordList();
- }
- if (index == 1) {
- //加载未入场
- this.getRecordList();
- }
- if (index == 2) {
- //只加载已入场
- this.getRecordList();
- }
- if (index == 3) {
- //只加载已出场
- this.getRecordList();
- }
- },
- //------------------------------------------
- //上拉加载更多,分页模拟数据
- onReachBottom() {
- this.status = 'loading';
- if (this.dataCount > this.pageSize * this.pageNo) {
- this.pageSize = parseInt(this.pageSize) + 3;
- this.getRecordList();
- } else {
- this.status = 'nomore';
- }
- },
- searchFn() {
- console.log(123);
- this.$api.getInOutRecord({
- carNo: this.carNo,
- current: this.current,
- pageNo: this.pageNo,
- pageSize: this.pageSize,
- dataCount: this.dataCount,
- }).then(resp => {
- this.status = 'loadmore';
- let recordList = resp.data;
- this.dataCount = resp.dataCount;
- this.pageNo = resp.pageNo;
- this.recordItemList = recordList;
- if (this.dataCount < this.pageSize * this.pageNo) this.status = 'nomore';
- })
- }
- },
- onShow() {
- this.getRecordList();
- },
- }
- </script>
- <style lang="scss">
- .card-box {
- display: flex;
- width: 100%;
- flex-direction: column;
- .card {
- background-color: #fff;
- border-radius: 20rpx;
- margin: 20rpx 20rpx 0 20rpx;
- padding: 30rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- .t {
- width: 100%;
- display: flex;
- align-items: center;
- padding-bottom: 30rpx;
- border-bottom: 1rpx solid #f5f5f5;
- .icon {
- width: 40rpx;
- height: 40rpx;
- }
- .title {
- font-size: 30rpx;
- font-weight: bold;
- margin-left: 20rpx;
- }
- }
- .c {
- padding: 15rpx 0 0 0;
- display: flex;
- flex-wrap: wrap;
- //border-bottom: 1rpx solid #f5f5f5;
- .item {
- width: 50%;
- padding: 20rpx 0;
- display: flex;
- .car-num {
- background-color: #edf6ff;
- color: #0080ff;
- font-size: 44rpx;
- padding: 15rpx 0;
- text-align: center;
- width: 100%;
- border-radius: 10rpx;
- font-weight: bold;
- letter-spacing: 20rpx;
- }
- .p1 {
- font-size: 28rpx;
- color: #999;
- flex: 5;
- }
- .p2 {
- font-size: 28rpx;
- color: #191919;
- font-weight: bold;
- margin-left: 20rpx;
- flex: 7;
- }
- }
- .car-num-item {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- .b {
- display: flex;
- width: 100%;
- align-items: center;
- justify-content: space-between;
- .btn {
- height: 70rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- //width: calc(50% - 15rpx);
- width: 100%;
- margin: 30rpx 0 0 0;
- border-radius: 10rpx;
- border-width: 1rpx;
- box-sizing: border-box;
- }
- .b1 {
- background-color: #0080ff;
- color: #fff;
- }
- .b2 {
- background-color: #f7f7f7;
- color: #191919;
- }
- .b3 {
- background-color: #fff;
- color: #0080ff;
- border: 1rpx solid #0080ff;
- }
- }
- }
- }
- .t-btn {
- width: 400rpx;
- margin: 0 auto 80rpx auto;
- height: 88rpx;
- font-weight: bold;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 10rpx;
- color: #191919;
- font-size: 28rpx;
- background-color: #fff;
- border: 1px solid #eee;
- }
- @import '@/common/common.scss'
- </style>
|