|
@@ -6,7 +6,7 @@
|
|
<u-dropdown-item title="筛选">
|
|
<u-dropdown-item title="筛选">
|
|
<view class="slot-content dropdown-filter-con">
|
|
<view class="slot-content dropdown-filter-con">
|
|
<view class="filter-item">
|
|
<view class="filter-item">
|
|
- <text class="filter-label">查询日期</text>
|
|
|
|
|
|
+ <text class="filter-label">出场日期</text>
|
|
<view class="filter-date" @tap="showCalendar=true">
|
|
<view class="filter-date" @tap="showCalendar=true">
|
|
<text>{{filter.endDate.length>0?(filter.startDate+' 至 '+filter.endDate):'请选择'}}</text>
|
|
<text>{{filter.endDate.length>0?(filter.startDate+' 至 '+filter.endDate):'请选择'}}</text>
|
|
<u-icon name="search" style="margin:0rpx 20rpx;"></u-icon>
|
|
<u-icon name="search" style="margin:0rpx 20rpx;"></u-icon>
|
|
@@ -40,14 +40,21 @@
|
|
|
|
|
|
</u-navbar>
|
|
</u-navbar>
|
|
<u-calendar v-model="showCalendar" mode="range" @change="changeCalendar"></u-calendar>
|
|
<u-calendar v-model="showCalendar" mode="range" @change="changeCalendar"></u-calendar>
|
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
|
+ <u-search placeholder="输入车牌号模糊查找" v-model="filter.carNum" @search="sureFilter" @custom="sureFilter"></u-search>
|
|
|
|
+ <u-button type="primary" size="mini" style="margin-left:50rpx;" @tap="batchOff" v-show="false">批量出场</u-button>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+
|
|
<u-tabs :list="tablist" :is-scroll="false" :current="currentTab" @change="changeTab"></u-tabs>
|
|
<u-tabs :list="tablist" :is-scroll="false" :current="currentTab" @change="changeTab"></u-tabs>
|
|
- <scroll-view style="padding:20rpx;height:calc(100vh - 135px)" scroll-y="true" @scrolltolower="scrollbtm">
|
|
|
|
|
|
+ <!--已离场列表 start-->
|
|
|
|
+ <scroll-view style="padding:20rpx;height:calc(100vh - 170px)" scroll-y="true" @scrolltolower="scrollbtm('off')" v-show="currentTab==0">
|
|
|
|
|
|
- <view class="tab-con-item" v-for="(item,index) in pagedData.records" :key="index">
|
|
|
|
|
|
+ <view class="tab-con-item" v-for="(item,index) in offPageData.records" :key="index">
|
|
<view class="item-top">
|
|
<view class="item-top">
|
|
<u-image width="200rpx" height="160rpx" :src="item.car_img" border-radius="5rpx" @click="previewCarPhoto(item.car_img)"></u-image>
|
|
<u-image width="200rpx" height="160rpx" :src="item.car_img" border-radius="5rpx" @click="previewCarPhoto(item.car_img)"></u-image>
|
|
<view class="item-top-right">
|
|
<view class="item-top-right">
|
|
- <text style="">{{item.parking_name}}</text>
|
|
|
|
|
|
+ <view><text style="">{{item.parking_name}}</text></view>
|
|
<view class="top-right-con">
|
|
<view class="top-right-con">
|
|
<view>进场时间:{{item.in_parking_time}}</view>
|
|
<view>进场时间:{{item.in_parking_time}}</view>
|
|
<view v-if="item.release_status=='1'">离场时间:{{item.out_parking_time}}</view>
|
|
<view v-if="item.release_status=='1'">离场时间:{{item.out_parking_time}}</view>
|
|
@@ -57,17 +64,60 @@
|
|
</view>
|
|
</view>
|
|
<view class="item-footer">
|
|
<view class="item-footer">
|
|
<text class="car-num">{{item.car_num}}</text>
|
|
<text class="car-num">{{item.car_num}}</text>
|
|
- <view class="item-footer-btn" v-if="item.release_status=='0'" @tap="manualOut(item)">手动出场</view>
|
|
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!-- <u-loadmore :status="loadMoreStat"/> -->
|
|
|
|
+ <view v-show="offPageData.showMoreTip">
|
|
|
|
+ <u-loadmore :status="offPageData.loadMoreStat" :load-text="loadMoreText"/>
|
|
|
|
+ </view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ <!--已离场列表 end-->
|
|
|
|
+
|
|
|
|
+ <!--未离场列表 start-->
|
|
|
|
+ <scroll-view style="padding:20rpx;height:calc(100vh - 170px)" scroll-y="true" @scrolltolower="scrollbtm('in')" v-show="currentTab==1">
|
|
|
|
+
|
|
|
|
+ <view class="tab-con-item" v-for="(item,index) in inPageData.records" :key="index">
|
|
|
|
+ <view class="item-top">
|
|
|
|
+ <u-image width="200rpx" height="160rpx" :src="item.car_img" border-radius="5rpx" @click="previewCarPhoto(item.car_img)"></u-image>
|
|
|
|
+ <view class="item-top-right">
|
|
|
|
+ <view><text style="">{{item.parking_name}}</text></view>
|
|
|
|
+ <view class="top-right-con">
|
|
|
|
+ <view>进场时间:{{item.in_parking_time}}</view>
|
|
|
|
+ <view v-if="item.release_status=='1'">离场时间:{{item.out_parking_time}}</view>
|
|
|
|
+ <view>停车时长:{{item.parking_time_txt}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-footer">
|
|
|
|
+ <text class="car-num">{{item.car_num}}</text>
|
|
|
|
+ <!-- <u-tag text="已标记在场" type="success" />
|
|
|
|
+ <u-button type="warning" size="mini" style="margin:0rpx;">取消标记</u-button> -->
|
|
|
|
+ <!-- <view class="item-footer-btn" v-if="item.release_status=='0'" @tap="manualOut(item)">手动出场</view>-->
|
|
|
|
+ <template v-if="item.mark_in">
|
|
|
|
+ <u-tag text="已标记在场" type="success" />
|
|
|
|
+ <u-button type="warning" size="mini" style="margin:0rpx;" @tap="cancelMarkCarIn(item.id)">取消标记</u-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <u-button type="primary" size="mini" style="margin:0rpx;" @tap="manualOut(item)">手动出场</u-button>
|
|
|
|
+ <u-button type="warning" size="mini" style="margin:0rpx;" @tap="markCarIn(item.id)">标记在场</u-button>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <u-loadmore :status="loadMoreStat"/> -->
|
|
<!-- <u-loadmore :status="loadMoreStat"/> -->
|
|
- <view v-show="showMoreTip">
|
|
|
|
- <u-loadmore :status="loadMoreStat" :load-text="loadMoreText"/>
|
|
|
|
|
|
+ <view v-show="inPageData.showMoreTip">
|
|
|
|
+ <u-loadmore :status="inPageData.loadMoreStat" :load-text="loadMoreText"/>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
|
+ <!--未离场列表 end-->
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -110,7 +160,9 @@
|
|
'padding-left':'10rpx',
|
|
'padding-left':'10rpx',
|
|
'phstyle':'font-size:24rpx;'
|
|
'phstyle':'font-size:24rpx;'
|
|
},
|
|
},
|
|
- pagedData:{}
|
|
|
|
|
|
+ pagedData:{},
|
|
|
|
+ offPageData:{loadMoreStat:'loadmore',showMoreTip:false}, //已离场
|
|
|
|
+ inPageData:{loadMoreStat:'loadmore',showMoreTip:false} //未离场
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(){
|
|
onLoad(){
|
|
@@ -122,34 +174,44 @@
|
|
});
|
|
});
|
|
this.allParkIds=ids.join(",");
|
|
this.allParkIds=ids.join(",");
|
|
|
|
|
|
- this.loadPageData(this.getLoadParams(1));
|
|
|
|
|
|
+ //this.loadPageData(this.getLoadParams(1));
|
|
},
|
|
},
|
|
onShow(){
|
|
onShow(){
|
|
- this.loadPageData(this.getLoadParams(1));
|
|
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,"in");
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,"off");
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getLoadParams(pnum){
|
|
getLoadParams(pnum){
|
|
let parkarg=this.selectedParkVal=="all"?this.allParkIds:this.selectedParkVal;
|
|
let parkarg=this.selectedParkVal=="all"?this.allParkIds:this.selectedParkVal;
|
|
|
|
+ /*
|
|
if(!pnum){
|
|
if(!pnum){
|
|
pnum=this.pagedData.pageNum!=null?(this.pagedData.pageNum+1):1;
|
|
pnum=this.pagedData.pageNum!=null?(this.pagedData.pageNum+1):1;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
return {parkingIds:parkarg,status:(this.currentTab==0?"off":"in"),carNum:this.filter.carNum,queryStart:this.filter.startDate,queryEnd:this.filter.endDate,pageNum:pnum,pageSize:10};
|
|
return {parkingIds:parkarg,status:(this.currentTab==0?"off":"in"),carNum:this.filter.carNum,queryStart:this.filter.startDate,queryEnd:this.filter.endDate,pageNum:pnum,pageSize:10};
|
|
},
|
|
},
|
|
- checkHadMore(){
|
|
|
|
- let rst=this.pagedData.pageNum<this.pagedData.pageCount;
|
|
|
|
- this.showMoreTip=true;
|
|
|
|
- this.loadMoreStat=rst?'loadmore':'nomore';
|
|
|
|
|
|
+ checkHadMore(offType){
|
|
|
|
+ let rst=null
|
|
|
|
+ if(offType=="off"){
|
|
|
|
+ rst=this.offPageData.pageNum<this.offPageData.pageCount;
|
|
|
|
+ this.offPageData.showMoreTip=true;
|
|
|
|
+ this.offPageData.loadMoreStat=rst?'loadmore':'nomore';
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ rst=this.inPageData.pageNum<this.inPageData.pageCount;
|
|
|
|
+ this.inPageData.showMoreTip=true;
|
|
|
|
+ this.inPageData.loadMoreStat=rst?'loadmore':'nomore';
|
|
|
|
+ }
|
|
return rst;
|
|
return rst;
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
changeCalendar(e){
|
|
changeCalendar(e){
|
|
- //console.log(e);
|
|
|
|
this.filter.startDate=e.startDate;
|
|
this.filter.startDate=e.startDate;
|
|
this.filter.endDate=e.endDate;
|
|
this.filter.endDate=e.endDate;
|
|
},
|
|
},
|
|
changeTab(idx){
|
|
changeTab(idx){
|
|
this.currentTab=idx;
|
|
this.currentTab=idx;
|
|
- this.loadPageData(this.getLoadParams(1));
|
|
|
|
|
|
+ //this.loadPageData(this.getLoadParams(1),false,(idx==0?"off":"in"));
|
|
},
|
|
},
|
|
resetFilter(){
|
|
resetFilter(){
|
|
let resetObj={
|
|
let resetObj={
|
|
@@ -163,62 +225,83 @@
|
|
},
|
|
},
|
|
sureFilter(){
|
|
sureFilter(){
|
|
this.$refs.filterDropdown.close();
|
|
this.$refs.filterDropdown.close();
|
|
- this.loadPageData(this.getLoadParams(1));
|
|
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,"in");
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,"off");
|
|
},
|
|
},
|
|
- scrollbtm(){
|
|
|
|
|
|
+ scrollbtm(offType){
|
|
console.log('scroll btm')
|
|
console.log('scroll btm')
|
|
- if(!this.checkHadMore()){ //没有更多数据
|
|
|
|
|
|
+ if(!this.checkHadMore(offType)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.loadMoreStat = 'loading';
|
|
|
|
- this.loadPageData(this.getLoadParams(),true);
|
|
|
|
|
|
+ let pnum=1;
|
|
|
|
+ if(offType=="off"){
|
|
|
|
+ this.offPageData.loadMoreStat='loading';
|
|
|
|
+ pnum=this.offPageData.pageNum+1;
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ this.inPageData.loadMoreStat='loading';
|
|
|
|
+ pnum=this.inPageData.pageNum+1;
|
|
|
|
+ }
|
|
|
|
+ this.loadPageData(this.getLoadParams(pnum),true,offType)
|
|
|
|
+
|
|
},
|
|
},
|
|
- loadPageData(param,moreLoad){
|
|
|
|
|
|
+ loadPageData(param,moreLoad,offType){
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title:'加载中...'
|
|
title:'加载中...'
|
|
});
|
|
});
|
|
|
|
+ param.status=offType
|
|
api.loadPageData(param).then(resp => {
|
|
api.loadPageData(param).then(resp => {
|
|
console.log(resp)
|
|
console.log(resp)
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
if(!resp.success){
|
|
if(!resp.success){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:resp.msg||'加载数据失败',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if(!moreLoad){
|
|
|
|
- this.renderRptData(resp.data.rptData);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
let pagedData=resp.data.pagedData;
|
|
let pagedData=resp.data.pagedData;
|
|
this.parseDatas(pagedData);
|
|
this.parseDatas(pagedData);
|
|
- if(moreLoad){ //附加以前的数据
|
|
|
|
- pagedData.records=pagedData.records?this.pagedData.records.concat(pagedData.records):this.pagedData.records;
|
|
|
|
|
|
+ if(offType=="off"){ //查询已离场数据结果
|
|
|
|
+ if(moreLoad){
|
|
|
|
+ pagedData.records=pagedData.records?this.offPageData.records.concat(pagedData.records):this.offPageData.records;
|
|
|
|
+ }
|
|
|
|
+ pagedData.showMoreTip=this.offPageData.showMoreTip
|
|
|
|
+ pagedData.loadMoreStat=this.offPageData.loadMoreStat
|
|
|
|
+ this.offPageData=pagedData
|
|
}
|
|
}
|
|
- this.pagedData=pagedData;
|
|
|
|
- this.checkHadMore();
|
|
|
|
|
|
+ else{ //未离场
|
|
|
|
+ if(moreLoad){
|
|
|
|
+ pagedData.records=pagedData.records?this.inPageData.records.concat(pagedData.records):this.inPageData.records;
|
|
|
|
+ }
|
|
|
|
+ pagedData.showMoreTip=this.inPageData.showMoreTip
|
|
|
|
+ pagedData.loadMoreStat=this.inPageData.loadMoreStat
|
|
|
|
+ this.inPageData=pagedData
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.renderRptData(pagedData,offType);
|
|
|
|
+
|
|
|
|
+ this.checkHadMore(offType);
|
|
|
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- renderRptData(rptData){
|
|
|
|
-
|
|
|
|
- let crttab=this.currentTab==0?"off":"in";
|
|
|
|
- let tmpname=this.filter.startDate && this.filter.startDate!=''?'已离场':'今日已离场';
|
|
|
|
- let [tab1,tab2]=this.tablist
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- tab1={name:`${tmpname}(${rptData&&rptData['1']?rptData['1']:0})`}
|
|
|
|
- tab2={name:`未离场(${rptData&&rptData['0']?rptData['0']:0})`}
|
|
|
|
-
|
|
|
|
- //console.log(this.tablist[0])
|
|
|
|
-
|
|
|
|
- this.tablist=[tab1,tab2]
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ renderRptData(pageMode,offType){ //rptData
|
|
|
|
|
|
- //this.$forceUpdate()
|
|
|
|
|
|
+ let [tab1,tab2]=this.tablist
|
|
|
|
+ if(offType=="off"){
|
|
|
|
+ let tmpname=this.filter.startDate && this.filter.startDate!=''?'已离场':'今日已离场';
|
|
|
|
+ tab1={name:`${tmpname}(${pageMode.total!=null?pageMode.total:0})`}
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ tab2={name:`未离场(${pageMode.total!=null?pageMode.total:0})`}
|
|
|
|
+ }
|
|
|
|
+ this.tablist=[tab1,tab2]
|
|
|
|
|
|
- //let tabtxts=[{name:`${tmpname}(${rptData&&rptData['1']?rptData['1']:0})`},{name:`未离场(${rptData&&rptData['0']?rptData['0']:0})`}];
|
|
|
|
- //this.tablist=tabtxts;
|
|
|
|
},
|
|
},
|
|
parseDatas(respData){
|
|
parseDatas(respData){
|
|
|
|
|
|
@@ -284,8 +367,9 @@
|
|
|
|
|
|
//避免成功提示跳过(加载第1页才更新统计数据)
|
|
//避免成功提示跳过(加载第1页才更新统计数据)
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
- this.loadPageData(this.getLoadParams(1));
|
|
|
|
- },1500)
|
|
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,'in');
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,'off');
|
|
|
|
+ },1000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -295,7 +379,94 @@
|
|
icon:'none'
|
|
icon:'none'
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ markCarIn(recordId){
|
|
|
|
+ api.markCarIn(recordId,app.takeSetting('user_id')).then(resp=>{
|
|
|
|
+ if(!resp.success){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:resp.msg||'标记车辆失败',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'标记成功',
|
|
|
|
+ icon:'success'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,'in');
|
|
|
|
+ },1000)
|
|
|
|
+
|
|
|
|
+ }).catch(err=>{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'标记车辆出错',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ cancelMarkCarIn(recordId){
|
|
|
|
+ api.cancelMarkCarIn(recordId,app.takeSetting('user_id')).then(resp=>{
|
|
|
|
+ if(!resp.success){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:resp.msg||'取消标记失败',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'取消标记成功',
|
|
|
|
+ icon:'success'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.loadPageData(this.getLoadParams(1),false,'in');
|
|
|
|
+ },1000)
|
|
|
|
+
|
|
|
|
+ }).catch(err=>{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:'取消标记出错',
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ batchOff(){
|
|
|
|
+ if(!this.selectedParkVal || this.selectedParkVal=='all' || this.selectedParkVal==''){
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title:'操作提示',
|
|
|
|
+ content:'请先选择1个停车场(不可多选),再继续',
|
|
|
|
+ showCancel:false
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ let parkObj=this.myParkSites.find(itm=>itm.park_id==this.selectedParkVal)
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title:'操作提示',
|
|
|
|
+ content:`提交前请确认选择的停车场【${parkObj.parking_name}】,且已完成该停车场的标记`,
|
|
|
|
+ showCancel:true,
|
|
|
|
+ success:(res)=>{
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ this.batchOffSubmit();
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ batchOffSubmit(){
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|