|
|
@ -1,10 +1,10 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<com-empty-view v-if="jobList.length==0"></com-empty-view> |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" ref="filter" otherTitle="" |
|
|
|
@switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" |
|
|
|
:checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" |
|
|
|
@fromLocationCode="fromLocationCode"> |
|
|
|
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionline" |
|
|
|
ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" |
|
|
|
@onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" |
|
|
|
@productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> |
|
|
|
</job-filter> |
|
|
|
<view v-if="jobList.length>0"> |
|
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
@ -22,7 +22,7 @@ |
|
|
|
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> |
|
|
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> |
|
|
|
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> |
|
|
|
<jobList ref="jobList" @selectItem="selectItem"></jobList> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
@ -31,7 +31,7 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
cancleTakeIssueJob, |
|
|
|
getIssueJobList, |
|
|
|
getIssueJobList, |
|
|
|
getIssueJobByProductionline |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
@ -77,12 +77,12 @@ |
|
|
|
todayTime: "", |
|
|
|
status: '1,2', //待处理 、进行中 |
|
|
|
detailOptions: [], |
|
|
|
detailGiveupOptions: [], |
|
|
|
productionline:[] |
|
|
|
detailGiveupOptions: [], |
|
|
|
productionline: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
this.getIssueJobByProductionline() |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.getIssueJobByProductionline() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getList('refresh'); |
|
|
@ -123,19 +123,19 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getIssueJobByProductionline(){ |
|
|
|
getIssueJobByProductionline().then(res=>{ |
|
|
|
console.log('生产线',res) |
|
|
|
if(res.code==0){ |
|
|
|
this.productionline = res.data.map(item=>({ |
|
|
|
value: item.value, |
|
|
|
text: item.name |
|
|
|
})) |
|
|
|
}else{ |
|
|
|
this.productionline = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
methods: { |
|
|
|
getIssueJobByProductionline() { |
|
|
|
getIssueJobByProductionline().then(res => { |
|
|
|
console.log('生产线', res) |
|
|
|
if (res.code == 0) { |
|
|
|
this.productionline = res.data.map(item => ({ |
|
|
|
value: item.value, |
|
|
|
text: item.name |
|
|
|
})) |
|
|
|
} else { |
|
|
|
this.productionline = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getList(type, fromLocationCode = '', productionLineCode = '') { |
|
|
|
let that = this; |
|
|
@ -162,12 +162,12 @@ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: this.status |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "accept_user_id", |
|
|
|
action: "==", |
|
|
|
value: this.$store.state.user.id |
|
|
|
}) |
|
|
|
|
|
|
|
if (fromLocationCode != '') { |
|
|
@ -257,8 +257,8 @@ |
|
|
|
|
|
|
|
openJobDetail(item, scanMessage = '') { |
|
|
|
uni.navigateTo({ |
|
|
|
url: './issueDetail?id=' + item.masterId + '&status=' + item.status+'&scanMessage=' + |
|
|
|
scanMessage |
|
|
|
url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + |
|
|
|
scanMessage |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
@ -269,10 +269,10 @@ |
|
|
|
selectedItem(item) { |
|
|
|
this.openJobDetail(item); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectItem(item) { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
this.openJobDetail(item,this.scanMessage); |
|
|
|
this.openJobDetail(item, this.scanMessage); |
|
|
|
}, |
|
|
|
|
|
|
|
swipeClick(e, dataContent) { |
|
|
@ -361,7 +361,9 @@ |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
|
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packGetFocus() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -369,17 +371,16 @@ |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
if(!result.label.batch){ |
|
|
|
if (!result.label.batch) { |
|
|
|
this.showMessage("批次为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!result.label.itemCode){ |
|
|
|
if (!result.label.itemCode) { |
|
|
|
this.showMessage("物料号为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
var filters = [ |
|
|
|
{ |
|
|
|
var filters = [{ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1,2' |
|
|
@ -402,7 +403,7 @@ |
|
|
|
sort: 'createTime', |
|
|
|
by: 'asc' |
|
|
|
}).then(res => { |
|
|
|
this.scanMessage =result.scanMessage |
|
|
|
this.scanMessage = result.scanMessage |
|
|
|
let resultList = res.data.list; |
|
|
|
if (resultList.length > 0) { |
|
|
|
resultList.forEach(item => { |
|
|
@ -410,21 +411,22 @@ |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
let list = [] |
|
|
|
resultList.forEach(item=>{ |
|
|
|
if(!list.find(subItem=>subItem.title==item.title)){ |
|
|
|
resultList.forEach(item => { |
|
|
|
if (!list.find(subItem => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(list.length >0){ |
|
|
|
if (list.length > 0) { |
|
|
|
this.selectItem(list[0]) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage("物料号["+result.label.itemCode+"]批次["+result.label.batch+']未查找到任务') |
|
|
|
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch + |
|
|
|
']未查找到任务') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|