|
|
@ -506,6 +506,10 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
|
uni.showLoading({ |
|
|
|
title:"查询中", |
|
|
|
mask:true |
|
|
|
}) |
|
|
|
let balance = result.balance; |
|
|
|
if (balance != null) { |
|
|
|
this.scanMessage = "" |
|
|
@ -517,7 +521,6 @@ |
|
|
|
this.showMessage("物料号为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
var filters = [{ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
@ -554,6 +557,78 @@ |
|
|
|
sort: 'createTime', |
|
|
|
by: 'asc' |
|
|
|
}).then(res => { |
|
|
|
this.scanMessage = result.scanMessage |
|
|
|
let resultList = res.data.list; |
|
|
|
if (resultList.length > 0) { |
|
|
|
uni.hideLoading() |
|
|
|
resultList.forEach(item => { |
|
|
|
item.title = item.number; |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
let list = [] |
|
|
|
resultList.forEach(item => { |
|
|
|
if (!list.find(subItem => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (list.length > 0) { |
|
|
|
this.selectItem(list[0]) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.queryByItemCode(result) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
//按物料和查询条件查询 |
|
|
|
queryByItemCode(result) { |
|
|
|
let balance = result.balance; |
|
|
|
if (balance != null) { |
|
|
|
this.scanMessage = "" |
|
|
|
if (!result.label.batch) { |
|
|
|
this.showMessage("批次为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!result.label.itemCode) { |
|
|
|
this.showMessage("物料号为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
var filters = [{ |
|
|
|
column: "status", |
|
|
|
action: "in", |
|
|
|
value: '1,2' |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|
value: result.label.itemCode |
|
|
|
}, |
|
|
|
{ |
|
|
|
column: "fromLocationCode", |
|
|
|
action: "==", |
|
|
|
value: balance.locationCode |
|
|
|
} |
|
|
|
] |
|
|
|
if(this.productionLineCode){ |
|
|
|
filters.push({ |
|
|
|
column: "productionLineCode", |
|
|
|
action: "==", |
|
|
|
value: this.productionLineCode |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
getIssueJobList({ |
|
|
|
filters: filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 1000, |
|
|
|
sort: 'createTime', |
|
|
|
by: 'asc' |
|
|
|
}).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.scanMessage = result.scanMessage |
|
|
|
let resultList = res.data.list; |
|
|
|
if (resultList.length > 0) { |
|
|
@ -576,12 +651,10 @@ |
|
|
|
.scanMessage + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
|
}) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
this.showMessage(e.message) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|