|
|
@ -253,6 +253,7 @@ |
|
|
|
// } |
|
|
|
this.allCount = that.details.length; |
|
|
|
this.scanCount = 0; |
|
|
|
|
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}) |
|
|
@ -306,53 +307,61 @@ |
|
|
|
|
|
|
|
dyIssue(result, scaned) { |
|
|
|
let that = this; |
|
|
|
|
|
|
|
that.currentItem = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendPackingCode === result.data.code && |
|
|
|
r.recommendLot === result.data.lot && |
|
|
|
r.scaned === scaned |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//没找到符合的箱码 |
|
|
|
if (that.currentItem === undefined) { |
|
|
|
that.currentItem = that.details.find(r => { |
|
|
|
return r.itemCode === result.data.itemCode && |
|
|
|
r.recommendLot === result.data.lot && |
|
|
|
r.scaned === scaned |
|
|
|
}); |
|
|
|
|
|
|
|
if (that.currentItem === undefined) { |
|
|
|
showConfirmMsg('按零件号【' + result.data.itemCode + '】和批次【' + result.data.lot + |
|
|
|
'】,在任务中未找到零件,是否按照零件号继续查找?', |
|
|
|
confirm => { |
|
|
|
if (confirm) { |
|
|
|
let items = that.details.filter(r => { |
|
|
|
return r.itemCode === result.data.itemCode && r.scaned == scaned |
|
|
|
}); |
|
|
|
if (items.length === 0) { |
|
|
|
that.showScanMessage('按零件号【' + result.data.itemCode + '】,在任务中未匹配到零件,请扫描其他标签'); |
|
|
|
} else { |
|
|
|
that.currentItem = items[0]; //匹配到的零件信息 |
|
|
|
var itemCode = that.details.find(res=>{ |
|
|
|
return res.itemCode ===result.data.itemCode&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
//零件号相等 |
|
|
|
if(itemCode!=undefined){ |
|
|
|
var lot = that.details.find(res=>{ |
|
|
|
return res.recommendLot ===result.data.lot&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
|
|
|
|
if(lot!=undefined){ |
|
|
|
//通过 |
|
|
|
that.currentItem =lot; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
}else { |
|
|
|
//批次不相等 |
|
|
|
// 提示未执行先进先出或者不是最先批次。 |
|
|
|
setTimeout(res=>{ |
|
|
|
showConfirmMsg('未执行先进先出或不是最先批次,是否继续?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.currentItem = itemCode; |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
}else { |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
},100) |
|
|
|
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
//零件号不相等 |
|
|
|
var lot = that.details.find(res=>{ |
|
|
|
return res.recommendLot ===result.data.lot&& |
|
|
|
res.scaned === scaned |
|
|
|
}) |
|
|
|
} else { |
|
|
|
showConfirmMsg('按零件号【' + result.data.itemCode + '】和批次【' + result.data.lot + '】,匹配到任务中的【' + that |
|
|
|
.currentItem |
|
|
|
.recommendPackingCode + '】箱,是否确认匹配?', |
|
|
|
confirm => { |
|
|
|
if (confirm) { |
|
|
|
that.afterScanPackLabel(result); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
//批次相等 |
|
|
|
if(lot!=undefined){ |
|
|
|
// 在该任务中未找到零件。 |
|
|
|
that.showScanMessage('在该任务中未找到零件'); |
|
|
|
}else { |
|
|
|
//零件号不相等,批次不相等 |
|
|
|
that.showScanMessage('所扫描的物料不在任务中'); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.afterScanPackLabel(result); |
|
|
|