|
|
@ -59,9 +59,12 @@ |
|
|
|
getDetailCloseOption |
|
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
planRefreshTime |
|
|
|
} from '@/common/config.js'; |
|
|
|
|
|
|
|
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
|
|
|
import jobFilter from '@/mycomponents/job/jobFilter.vue' |
|
|
|
|
|
|
|
import comRepleinshJobCard from '@/pages/repleinsh/coms/comRepleinshJobCard.vue' |
|
|
|
import repleinshJobListPopup from '@/pages/repleinsh/coms/repleinshJobListPopup.vue' |
|
|
|
import repleinshInfoPopup from '@/pages/repleinsh/coms/repleinshInfoPopup.vue' |
|
|
@ -105,7 +108,8 @@ |
|
|
|
productionLineCode: "", |
|
|
|
productionlineList: [], |
|
|
|
fromLocationCode:'', |
|
|
|
filterItemCode:'' |
|
|
|
filterItemCode:'', |
|
|
|
timer:null |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -113,8 +117,13 @@ |
|
|
|
this.getBusinessTypeFunc() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onShow() { |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
this.timerRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
onHide() { |
|
|
|
this.stopRefresh(); |
|
|
|
}, |
|
|
|
|
|
|
|
onReady() { |
|
|
@ -155,6 +164,21 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
timerRefresh() { |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
this.stopRefresh(); |
|
|
|
var that = this; |
|
|
|
this.timer = setInterval(function() { |
|
|
|
that.getList('refresh', that.fromLocationCode, that.filterItemCode) |
|
|
|
console.log('补料刷新'); |
|
|
|
}, planRefreshTime) |
|
|
|
}, |
|
|
|
stopRefresh() { |
|
|
|
if (this.timer) { |
|
|
|
clearInterval(this.timer); |
|
|
|
this.timer = null; |
|
|
|
} |
|
|
|
}, |
|
|
|
getBusinessTypeFunc() { |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
@ -197,11 +221,6 @@ |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
if (fromLocationCode != '') { |
|
|
|
// 来源库位 |
|
|
|
filters.push({ |
|
|
@ -275,12 +294,6 @@ |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
if (params.fromLocationCode) { |
|
|
|
// 来源库位 |
|
|
|
this.fromLocationCode = params.fromLocationCode |
|
|
@ -335,11 +348,62 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
openJobDetail(item, scanMessage = '') { |
|
|
|
this.getJobInfoByNumber(item.number,scanMessage = '') |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
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, |
|
|
|
} |
|
|
|
getRepleinshJobList(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.fromLocationCode, this.filterItemCode) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + |
|
|
|
url: './repleinshDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' + |
|
|
|
scanMessage + '&title=' + this.title |
|
|
|
}); |
|
|
|
this.scanMessage = "" |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading(); |
|
|
|
that.showMessage(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showItemList(itemList) { |
|
|
@ -377,7 +441,7 @@ |
|
|
|
cancleJob(id) { |
|
|
|
cancleTakeRepleinshJob(id).then(res => { |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
uni.showToast({ |
|
|
|
title: "放弃任务成功" |
|
|
|
}) |
|
|
@ -397,7 +461,7 @@ |
|
|
|
closeTakeRepleinshJob(id).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.getList("refresh") |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
uni.showToast({ |
|
|
|
title: "关闭任务成功" |
|
|
|
}) |
|
|
@ -413,13 +477,13 @@ |
|
|
|
switchChangeToday(state, creationTime) { |
|
|
|
this.checkedToday = state; |
|
|
|
this.todayTime = creationTime; |
|
|
|
this.getList("refresh"); |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
}, |
|
|
|
|
|
|
|
switchChangeWait(state, jobStatus) { |
|
|
|
this.checkedWaitTask = state; |
|
|
|
this.status = jobStatus; |
|
|
|
this.getList("refresh"); |
|
|
|
this.getList('refresh', this.fromLocationCode, this.filterItemCode) |
|
|
|
}, |
|
|
|
getScanNumber(code) { |
|
|
|
this.getDataListByType(code) |
|
|
@ -441,11 +505,6 @@ |
|
|
|
action: "==", |
|
|
|
value: code |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
var params = { |
|
|
|
filters: filters, |
|
|
@ -513,11 +572,6 @@ |
|
|
|
action: "==", |
|
|
|
value: result.label.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "fromLocationCode", |
|
|
|
action: "==", |
|
|
|