You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
217 lines
5.1 KiB
217 lines
5.1 KiB
<template>
|
|
<page-meta root-font-size="18px"></page-meta>
|
|
<view class="">
|
|
<win-empty-view v-if="deliverList.length==0"></win-empty-view>
|
|
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id"
|
|
@click="openDetail(item)">
|
|
<comThirdLocationRequestItem :dataContent="item" @finish="finish" @cancle="cancle" >
|
|
</comThirdLocationRequestItem>
|
|
<!-- <comInjectIssue :dataContent="item"></comInjectIssue> -->
|
|
</view>
|
|
<uni-load-more :status="loadingType" v-if="deliverList.length>0" />
|
|
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button>
|
|
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
|
|
</win-mulit-scan> -->
|
|
<comMessage ref="comMessage"></comMessage>
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getThirdLocationRequestList,
|
|
thirdLocationRequestFinish,
|
|
thirdLocationRequestCancel
|
|
} from '@/api/index.js';
|
|
|
|
import {
|
|
goHome
|
|
} from '@/common/basic.js';
|
|
|
|
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
|
|
import comInjectIssue from '@/mycomponents/coms/task/comInjectIssue.vue';
|
|
import comThirdLocationRequestItem from '@/mycomponents/comRequest/comThirdLocationRequestItem.vue';
|
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
|
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
|
|
|
export default {
|
|
name: 'deliver',
|
|
components: {
|
|
winEmptyView,
|
|
winScanButton,
|
|
winMulitScan,
|
|
comInjectIssue,
|
|
comThirdLocationRequestItem,
|
|
comMessage
|
|
},
|
|
data() {
|
|
return {
|
|
deliverList: [],
|
|
reload: false,
|
|
status: '',
|
|
contentText: {
|
|
contentdown: '上拉加载更多',
|
|
contentrefresh: '加载中',
|
|
contentnomore: '没有更多'
|
|
},
|
|
pageSize: this.modelConfig,
|
|
pageIndex: 1,
|
|
isTimeWindowSorting: false,
|
|
isToday: true,
|
|
titleArray: ['任务编号'],
|
|
loadingType: "nomore"
|
|
|
|
};
|
|
},
|
|
props: {
|
|
datacontent: {
|
|
type: Object,
|
|
value: null
|
|
}
|
|
},
|
|
onShow: function() {
|
|
this.getList('refresh');
|
|
},
|
|
onReachBottom() {
|
|
//避免多次触发
|
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
|
|
return;
|
|
}
|
|
this.getList("more");
|
|
},
|
|
onPullDownRefresh() {
|
|
this.getList('refresh');
|
|
},
|
|
//后退按钮
|
|
onBackPress(options) {
|
|
if (options.from === 'navigateBack') {
|
|
return false;
|
|
}
|
|
goHome();
|
|
return true;
|
|
},
|
|
//返回首页
|
|
onNavigationBarButtonTap(e) {
|
|
if (e.index === 0) {
|
|
goHome();
|
|
} else if (e.index === 1) {
|
|
window.location.reload();
|
|
}
|
|
},
|
|
methods: {
|
|
finish(item) {
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
mask: true
|
|
})
|
|
thirdLocationRequestFinish(item.id).then(res => {
|
|
uni.hideLoading()
|
|
if(res.error){
|
|
this.showMessage("完成失败" + res.error.message)
|
|
}else {
|
|
uni.showToast({
|
|
title:"完成成功"
|
|
})
|
|
}
|
|
this.getList('refresh');
|
|
|
|
}).catch(error => {
|
|
uni.hideLoading()
|
|
this.showMessage("完成失败" + error)
|
|
})
|
|
|
|
},
|
|
|
|
cancle(item){
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
mask: true
|
|
})
|
|
thirdLocationRequestCancel(item.id).then(res => {
|
|
uni.hideLoading()
|
|
if(res.error){
|
|
this.showMessage("取消失败" + res.error.message)
|
|
}else {
|
|
uni.showToast({
|
|
title:"取消成功"
|
|
})
|
|
}
|
|
this.getList('refresh');
|
|
|
|
}).catch(error => {
|
|
uni.hideLoading()
|
|
this.showMessage("取消失败" + error)
|
|
})
|
|
|
|
},
|
|
|
|
openScanPopup() {
|
|
this.$refs.scanPopup.openScanPopup();
|
|
},
|
|
//按时间窗口排序
|
|
timeSortingChange: function(e) {
|
|
this.isTimeWindowSorting = e.detail.value
|
|
this.getList()
|
|
},
|
|
|
|
//只看当天到货
|
|
isTodayChange: function(e) {
|
|
this.isToday = e.detail.value
|
|
this.getList()
|
|
},
|
|
|
|
//查询发货任务
|
|
getList(type) {
|
|
let that = this;
|
|
uni.showLoading({
|
|
title: "加载中....",
|
|
mask: true
|
|
});
|
|
this.loadingType = "loading";
|
|
if (type === "refresh") {
|
|
this.pageIndex = 1;
|
|
this.deliverList = [];
|
|
}
|
|
getThirdLocationRequestList(that.pageIndex, that.pageSize, false)
|
|
.then(res => {
|
|
uni.hideLoading();
|
|
if (type === "refresh") {
|
|
uni.stopPullDownRefresh();
|
|
}
|
|
var list = res.items;
|
|
this.loadingType = "loadmore";
|
|
if (list == null || list.length == 0) {
|
|
//没数据了
|
|
this.loadingType = "nomore";
|
|
return;
|
|
}
|
|
// that.deliverList = [...that.deliverList, ...list];
|
|
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list);
|
|
that.pageIndex++;
|
|
})
|
|
.catch(err => {
|
|
this.loadingType = "";
|
|
this.showMessage(err.message);
|
|
uni.hideLoading();
|
|
if (type === "refresh") {
|
|
uni.stopPullDownRefresh();
|
|
}
|
|
});
|
|
},
|
|
|
|
openDetail(item) {
|
|
uni.navigateTo({
|
|
url: './thirdLocationRequestListDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
|
|
});
|
|
},
|
|
showMessage(message) {
|
|
this.$refs.comMessage.showMessage(message);
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped lang="scss">
|
|
</style>
|