Browse Source

HL-5952 修改发料任务跳转详情逻辑

hella_online_20240913
lijuncheng 5 months ago
parent
commit
55c010ce23
  1. 81
      src/pages/issue/job/issueJob.vue

81
src/pages/issue/job/issueJob.vue

@ -506,6 +506,10 @@
} }
}, },
getScanResult(result) { getScanResult(result) {
uni.showLoading({
title:"查询中",
mask:true
})
let balance = result.balance; let balance = result.balance;
if (balance != null) { if (balance != null) {
this.scanMessage = "" this.scanMessage = ""
@ -517,7 +521,6 @@
this.showMessage("物料号为空") this.showMessage("物料号为空")
return; return;
} }
try {
var filters = [{ var filters = [{
column: "status", column: "status",
action: "in", action: "in",
@ -554,6 +557,78 @@
sort: 'createTime', sort: 'createTime',
by: 'asc' by: 'asc'
}).then(res => { }).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 this.scanMessage = result.scanMessage
let resultList = res.data.list; let resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
@ -576,12 +651,10 @@
.scanMessage + "]") .scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
uni.hideLoading()
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
}) })
} catch (e) {
this.showMessage(e.message)
}
} }
}, },
} }

Loading…
Cancel
Save