|
|
@ -1,8 +1,12 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList" |
|
|
|
ref="filter" otherTitle="" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true" :isShowProductionLineCode="true" :productionline="productionlineList" |
|
|
|
ref="filter" otherTitle="" |
|
|
|
:checkedToday="checkedToday" |
|
|
|
:checkedWaitTask="checkedWaitTask" |
|
|
|
@switchChangeWait="switchChangeWait" |
|
|
|
@switchChangeToday="switchChangeToday" |
|
|
|
:isShowItemCode="true" @onQuery="getListByFilter" :isShowQurery='true'> |
|
|
|
<!-- <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" |
|
|
|
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" |
|
|
@ -52,6 +56,11 @@ |
|
|
|
import { |
|
|
|
getBusinessType |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
planRefreshTime |
|
|
|
} from '@/common/config.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
getDetailOption, |
|
|
@ -100,9 +109,12 @@ |
|
|
|
title: '', |
|
|
|
productionLine: "", |
|
|
|
fromLocation: "", |
|
|
|
fromAreaCode: '', // 来源库区 |
|
|
|
toAreaCode: '', // 到库区 |
|
|
|
filterItemCode: "", |
|
|
|
businessTypeCode: "Issue", |
|
|
|
businessType: null, |
|
|
|
timer:null |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -110,8 +122,15 @@ |
|
|
|
this.getIssueJobByProductionline() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
|
|
|
|
this.timerRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
onHide() { |
|
|
|
this.stopRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
onUnload(){ |
|
|
|
this.stopRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
@ -124,13 +143,13 @@ |
|
|
|
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
}, |
|
|
|
|
|
|
|
//后退按钮 |
|
|
@ -153,6 +172,21 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
timerRefresh() { |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
this.stopRefresh(); |
|
|
|
var that = this; |
|
|
|
this.timer = setInterval(function() { |
|
|
|
that.getList('refresh', that.fromLocation, that.productionLine, that.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
console.log('发料刷新'); |
|
|
|
}, planRefreshTime) |
|
|
|
}, |
|
|
|
stopRefresh() { |
|
|
|
if (this.timer) { |
|
|
|
clearInterval(this.timer); |
|
|
|
this.timer = null; |
|
|
|
} |
|
|
|
}, |
|
|
|
getBusinessTypeFunc() { |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
@ -183,7 +217,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getList(type, fromLocation = '', productionLine = '',filterItemCode='') { |
|
|
|
getList(type, fromLocation = '', productionLine = '',filterItemCode='',fromAreaCode='',toAreaCode='') { |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
@ -210,11 +244,6 @@ |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
if (fromLocation) { |
|
|
|
// 来源库位 |
|
|
@ -223,6 +252,22 @@ |
|
|
|
action: "==", |
|
|
|
value: fromLocation |
|
|
|
}) |
|
|
|
} |
|
|
|
if(fromAreaCode){ |
|
|
|
//来源库区 |
|
|
|
filters.push({ |
|
|
|
column: "fromAreaCode", |
|
|
|
action: "==", |
|
|
|
value: fromAreaCode |
|
|
|
}) |
|
|
|
} |
|
|
|
if(toAreaCode){ |
|
|
|
//到库区 |
|
|
|
filters.push({ |
|
|
|
column: "toAreaCode", |
|
|
|
action: "==", |
|
|
|
value: toAreaCode |
|
|
|
}) |
|
|
|
} |
|
|
|
if (productionLine) { |
|
|
|
// 生产线 |
|
|
@ -297,11 +342,6 @@ |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
if (params.fromLocationCode) { |
|
|
|
// 来源库位 |
|
|
@ -335,6 +375,28 @@ |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.filterItemCode = '' |
|
|
|
} |
|
|
|
if (params.fromAreaCode) { |
|
|
|
// 来源库区 |
|
|
|
this.fromAreaCode = params.fromAreaCode |
|
|
|
filters.push({ |
|
|
|
column: "fromAreaCode", |
|
|
|
action: "==", |
|
|
|
value: params.fromAreaCode |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.fromAreaCode = '' |
|
|
|
} |
|
|
|
if (params.toAreaCode) { |
|
|
|
// 到库区 |
|
|
|
this.toAreaCode = params.toAreaCode |
|
|
|
filters.push({ |
|
|
|
column: "toAreaCode", |
|
|
|
action: "==", |
|
|
|
value: params.toAreaCode |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.toAreaCode = '' |
|
|
|
} |
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
@ -342,7 +404,7 @@ |
|
|
|
pageSize: 100, |
|
|
|
} |
|
|
|
|
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
// getIssueJobList(params).then(res => { |
|
|
|
// uni.hideLoading(); |
|
|
|
// if (res.data.total == 0) { |
|
|
@ -361,12 +423,12 @@ |
|
|
|
|
|
|
|
fromLocationCode(fromLocation) { |
|
|
|
this.fromLocation = fromLocation; |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
|
|
|
|
}, |
|
|
|
productionLineCode(productionLineCode) { |
|
|
|
this.productionLine = productionLineCode |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
}, |
|
|
|
getByAsnNumber(code) { |
|
|
|
let that = this; |
|
|
@ -395,10 +457,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
openJobDetail(item, scanMessage = '') { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + |
|
|
|
scanMessage + '&title=' + this.title |
|
|
|
}); |
|
|
|
this.getJobInfoByNumber(item.number,scanMessage) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
showItemList(itemList) { |
|
|
@ -441,7 +501,7 @@ |
|
|
|
cancleJob(id) { |
|
|
|
cancleTakeIssueJob(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
title: "放弃任务成功" |
|
|
@ -478,14 +538,66 @@ |
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|
this.todayTime = creationTime; |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode) |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
}, |
|
|
|
getJobInfoByNumber(number,scanMessage){ |
|
|
|
let that = this; |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1,2' |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "number", |
|
|
|
action: "==", |
|
|
|
value: number |
|
|
|
}) |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100, |
|
|
|
} |
|
|
|
getIssueJobList(params).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.data.list.length == 0) { |
|
|
|
that.showMessage('未查找到' + '【' + number + '】的发料任务'); |
|
|
|
} else { |
|
|
|
var result =res.data.list[0]; |
|
|
|
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){ |
|
|
|
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => { |
|
|
|
if (res) { |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.getfocus() |
|
|
|
} |
|
|
|
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
uni.navigateTo({ |
|
|
|
url: './issueDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' + |
|
|
|
scanMessage + '&title=' + this.title |
|
|
|
}); |
|
|
|
this.scanMessage="" |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading(); |
|
|
|
that.showMessage(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getScanNumber(code) { |
|
|
@ -509,12 +621,6 @@ |
|
|
|
value: code |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
@ -523,7 +629,7 @@ |
|
|
|
getIssueJobList(params).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.data.list.length == 0) { |
|
|
|
that.showMessage('未查找到' + '【' + code + '】的收货任务'); |
|
|
|
that.showMessage('未查找到' + '【' + code + '】的发料任务'); |
|
|
|
} else if (res.data.list.length == 1) { |
|
|
|
that.openJobDetail(res.data.list[0]); |
|
|
|
} |
|
|
@ -537,7 +643,7 @@ |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
|
this.$refs.scanPopup.getfocus() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -549,9 +655,6 @@ |
|
|
|
this.$refs.scanPopup.openScanPopup(this.businessType); |
|
|
|
} |
|
|
|
}, |
|
|
|
// openScanPopup() { |
|
|
|
// this.$refs.scanPopup.openScanPopup(); |
|
|
|
// }, |
|
|
|
getScanResult(result) { |
|
|
|
let balance = result.balance; |
|
|
|
if (balance != null) { |
|
|
@ -611,11 +714,11 @@ |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch + |
|
|
|
"]物料号[" + result.label.itemCode + "]未查找到任务<br>" + "扫描[" + result |
|
|
|
"]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result |
|
|
|
.scanMessage + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") |
|
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
|
}) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|