|
|
@ -1,68 +1,86 @@ |
|
|
|
<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)"> |
|
|
|
<com-deliver :dataContent="item"></com-deliver> |
|
|
|
<view style="padding: 15rpx;"> |
|
|
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" |
|
|
|
activeColor="#007AFF"></uni-segmented-control> |
|
|
|
<view class="content"> |
|
|
|
<view v-show="current === 0"> |
|
|
|
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
|
|
|
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index"> |
|
|
|
|
|
|
|
<view class="device-detail" style="font-size: 32rpx;"> |
|
|
|
<com-job-top-info :jobContent="item"></com-job-top-info> |
|
|
|
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view> |
|
|
|
<view>器具规格 : {{item.specificationsTypeName}}</view> |
|
|
|
<view>库位 : {{item.requestLocationCode}} </view> |
|
|
|
<view>操作人 : {{item.worker}} </view> |
|
|
|
<view>创建时间 : {{item.creationTime| formatDate}} </view> |
|
|
|
|
|
|
|
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" |
|
|
|
@click="complete(item)">完成</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-show="current === 1"> |
|
|
|
<win-empty-view v-if="dataList.length==0"></win-empty-view> |
|
|
|
<view v-if="dataList.length>0" v-for="(item, index) in dataList" :key="index"> |
|
|
|
<view class="device-detail" style="font-size: 32rpx;"> |
|
|
|
<com-job-top-info :jobContent="item"></com-job-top-info> |
|
|
|
<view>器具类型 : {{item.containerType|getContainerTypeName}} </view> |
|
|
|
<view>器具规格 : {{item.specificationsTypeName}}</view> |
|
|
|
<view>库位 : {{item.requestLocationCode}} </view> |
|
|
|
<view>操作人 : {{item.worker}} </view> |
|
|
|
<view>创建时间 : {{item.creationTime| formatDate}} </view> |
|
|
|
</view> |
|
|
|
</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> |
|
|
|
</view> |
|
|
|
<uni-load-more :status="loadingType" v-if="dataList.length>0" /> |
|
|
|
<com-message ref="comMessage"></com-message> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getPlasticsList, |
|
|
|
getDeliverJobByNumber |
|
|
|
getContainerList, |
|
|
|
getDictByCode, |
|
|
|
finshContainerJob |
|
|
|
} from '@/api/index.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome |
|
|
|
goHome, |
|
|
|
dateFormat, |
|
|
|
getContainerTypeName, |
|
|
|
showConfirmMsg |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue' |
|
|
|
import comDeliver from '@/mycomponents/coms/task/comDeliver.vue'; |
|
|
|
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|
|
|
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue' |
|
|
|
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue' |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
export default { |
|
|
|
name: 'deliver', |
|
|
|
components: { |
|
|
|
winEmptyView, |
|
|
|
winScanButton, |
|
|
|
winMulitScan, |
|
|
|
comDeliver, |
|
|
|
comJobTopInfo, |
|
|
|
comMessage |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
deliverList: [], |
|
|
|
reload: false, |
|
|
|
status: '', |
|
|
|
contentText: { |
|
|
|
contentdown: '上拉加载更多', |
|
|
|
contentrefresh: '加载中', |
|
|
|
contentnomore: '没有更多' |
|
|
|
}, |
|
|
|
items: ['未完成', '已完成'], |
|
|
|
current: 0, |
|
|
|
pageSize: this.modelConfig, |
|
|
|
pageIndex: 1, |
|
|
|
isTimeWindowSorting: false, |
|
|
|
isToday: true, |
|
|
|
titleArray: ['任务编号'], |
|
|
|
loadingType: "nomore" |
|
|
|
loadingType: "nomore", |
|
|
|
dataList: [], |
|
|
|
containerModelList: [], |
|
|
|
isFinished:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
|
datacontent: { |
|
|
|
type: Object, |
|
|
|
value: null |
|
|
|
} |
|
|
|
filters: { |
|
|
|
formatDate: function(val) { |
|
|
|
return dateFormat(val) |
|
|
|
}, |
|
|
|
getContainerTypeName: function(val) { |
|
|
|
return getContainerTypeName(val) |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow: function() { |
|
|
|
|
|
|
|
onShow() { |
|
|
|
this.getList('refresh'); |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
@ -87,24 +105,32 @@ |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome(); |
|
|
|
}else if(e.index === 1){ |
|
|
|
} else if (e.index === 1) { |
|
|
|
window.location.reload(); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
openScanPopup() { |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
complete(item) { |
|
|
|
showConfirmMsg("是否确认完成?", callback => { |
|
|
|
if (callback) { |
|
|
|
this.submit(item) |
|
|
|
} else { |
|
|
|
console.log('cancel') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//按时间窗口排序 |
|
|
|
timeSortingChange: function(e) { |
|
|
|
this.isTimeWindowSorting = e.detail.value |
|
|
|
this.getList() |
|
|
|
onClickItem(item) { |
|
|
|
this.current = item.currentIndex; |
|
|
|
console.log("点击", this.current) |
|
|
|
if(this.current==0){ |
|
|
|
this.isFinished =false; |
|
|
|
}else { |
|
|
|
this.isFinished =true; |
|
|
|
} |
|
|
|
this.getList("refresh"); |
|
|
|
}, |
|
|
|
|
|
|
|
//只看当天到货 |
|
|
|
isTodayChange: function(e) { |
|
|
|
this.isToday = e.detail.value |
|
|
|
this.getList() |
|
|
|
openScanPopup() { |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
//查询发货任务 |
|
|
@ -117,15 +143,16 @@ |
|
|
|
this.loadingType = "loading"; |
|
|
|
if (type === "refresh") { |
|
|
|
this.pageIndex = 1; |
|
|
|
this.deliverList = []; |
|
|
|
this.dataList = []; |
|
|
|
} |
|
|
|
let params = { |
|
|
|
pageSize: that.pageSize, |
|
|
|
pageIndex: that.pageIndex, |
|
|
|
isFinished:that.isFinished |
|
|
|
// isCreationTimeSorting: that.isTimeWindowSorting, |
|
|
|
// isToday: that.isToday |
|
|
|
}; |
|
|
|
getPlasticsList(params) |
|
|
|
getContainerList(params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (type === "refresh") { |
|
|
@ -138,8 +165,8 @@ |
|
|
|
this.loadingType = "nomore"; |
|
|
|
return; |
|
|
|
} |
|
|
|
// that.deliverList = [...that.deliverList, ...list]; |
|
|
|
that.deliverList = type === "refresh" ? list : this.deliverList.concat(list); |
|
|
|
// that.dataList = [...that.dataList, ...list]; |
|
|
|
that.dataList = type === "refresh" ? list : this.dataList.concat(list); |
|
|
|
that.pageIndex++; |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
@ -151,42 +178,32 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(type, result) { |
|
|
|
if (type == '任务编号') { |
|
|
|
this.getByNumber(type, result.data.code); |
|
|
|
} |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
getByNumber(type, code) { |
|
|
|
let that = this; |
|
|
|
showCommitSuccessMessage() { |
|
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
|
}, |
|
|
|
submit(item) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
title: "提交中...", |
|
|
|
mask:true |
|
|
|
}); |
|
|
|
getDeliverJobByNumber(code).then(res => { |
|
|
|
let params = this.dataList.find(r => r.id == item.id); |
|
|
|
console.log("测试",JSON.stringify(params)); |
|
|
|
finshContainerJob(item.id, params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res != null) { |
|
|
|
that.openDetail(res); |
|
|
|
} else { |
|
|
|
that.showMessage('未查找到' + type + '为【' + code + '】的盘点任务'); |
|
|
|
this.showCommitSuccessMessage(); |
|
|
|
this.getList("refresh") |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
that.showMessage(err.message); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.showMessage(err.message); |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
openDetail(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './containerMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus |
|
|
|
}); |
|
|
|
}, |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
|
|
</style> |
|
|
|