|
@ -24,6 +24,9 @@ export default { |
|
|
props: { |
|
|
props: { |
|
|
shipOrderId: { |
|
|
shipOrderId: { |
|
|
default: '', |
|
|
default: '', |
|
|
|
|
|
}, |
|
|
|
|
|
tableData: { |
|
|
|
|
|
default: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
@ -31,31 +34,77 @@ export default { |
|
|
pickCode: '', |
|
|
pickCode: '', |
|
|
statusInfo: '', |
|
|
statusInfo: '', |
|
|
isSuccess: false, |
|
|
isSuccess: false, |
|
|
|
|
|
currentShipOrder: '', |
|
|
|
|
|
newEmitObj: {}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 扫码之后的处理 |
|
|
enterPress() { |
|
|
enterPress() { |
|
|
if (!this.shipOrderId) { |
|
|
|
|
|
this.msgInfo('请先选择发运单!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
let params = { |
|
|
|
|
|
shipOrderId: this.shipOrderId, |
|
|
|
|
|
packOrderId: this.pickCode |
|
|
|
|
|
} |
|
|
|
|
|
checkScancarpack(params).then(res => { |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
this.isSuccess = true |
|
|
|
|
|
this.$emit('handleSuccessCode', this.shipOrderId) |
|
|
|
|
|
|
|
|
this.statusInfo = '' |
|
|
|
|
|
// this.checkCode() |
|
|
|
|
|
if (this.pickCode.indexOf('PACK-') != -1) { // 拣料项 |
|
|
|
|
|
if (!this.shipOrderId) { |
|
|
|
|
|
this.msgInfo('请先扫描发运单!') |
|
|
|
|
|
return |
|
|
} else { |
|
|
} else { |
|
|
this.isSuccess = false |
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
shipOrderId: this.shipOrderId, |
|
|
|
|
|
packOrderId: this.pickCode |
|
|
|
|
|
} |
|
|
|
|
|
checkScancarpack(params).then(res => { |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
this.isSuccess = true |
|
|
|
|
|
this.newEmitObj = { |
|
|
|
|
|
shipOrderId: this.shipOrderId, |
|
|
|
|
|
} |
|
|
|
|
|
this.$emit('handleSuccessCode', this.newEmitObj) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.isSuccess = false |
|
|
|
|
|
} |
|
|
|
|
|
this.statusInfo = res.msg |
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
this.statusInfo = res.msg |
|
|
|
|
|
this.isSuccess = false |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
this.statusInfo = res.msg |
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
this.statusInfo = res.msg |
|
|
|
|
|
this.isSuccess = false |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} else { // 发运单 |
|
|
|
|
|
this.tableData.forEach(el => { |
|
|
|
|
|
if (el['JIT_ShipOrder-ShipOrderId'] === this.pickCode) { |
|
|
|
|
|
this.currentShipOrder = el |
|
|
|
|
|
this.newEmitObj = { |
|
|
|
|
|
currentShipOrder: el, |
|
|
|
|
|
} |
|
|
|
|
|
this.$emit('handleSuccessCode', this.newEmitObj) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.statusInfo = '发运单信息不存在!' |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 校验扫码是发运单还是拣料项 |
|
|
|
|
|
checkCode() { |
|
|
|
|
|
if (this.pickCode.indexOf('PACK-') != -1) { // 拣料项 |
|
|
|
|
|
if (!this.shipOrderId) { |
|
|
|
|
|
this.msgInfo('请先选择发运单!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} else { // 发运单 |
|
|
|
|
|
this.tableData.forEach(el => { |
|
|
|
|
|
if (el['JIT_ShipOrder-ShipOrderId'] === this.pickCode) { |
|
|
|
|
|
this.currentShipOrder = el['JIT_ShipOrder-ShipOrderId'] |
|
|
|
|
|
this.newEmitObj = { |
|
|
|
|
|
currentShipOrder: this.currentShipOrder, |
|
|
|
|
|
} |
|
|
|
|
|
this.$emit('handleSuccessCode', this.newEmitObj) |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 重置扫描条码 |
|
|
resetCode() { |
|
|
resetCode() { |
|
|
this.pickCode = '' |
|
|
this.pickCode = '' |
|
|
} |
|
|
} |
|
|