|
|
@ -96,7 +96,7 @@ |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
businessTypeInfo: {}, |
|
|
|
managementList: [], |
|
|
|
jobStatus:"" |
|
|
|
jobStatus: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -122,7 +122,7 @@ |
|
|
|
onBackPress(e) { |
|
|
|
//已经接收但是没提交任务 |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (this.jobStatus=="2") { |
|
|
|
if (this.jobStatus == "2") { |
|
|
|
//取消承接任务 |
|
|
|
cancleTakePurchasereturnJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
@ -230,54 +230,81 @@ |
|
|
|
var batch = result.label.batch; |
|
|
|
var qty = result.label.qty; |
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
var itemDetail = undefined; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
|
//箱码、批次、库位、 |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
r.inventoryStatus ==result.balance.inventoryStatus |
|
|
|
r.fromLocationCode == result.fromLocationCode |
|
|
|
}) |
|
|
|
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|
|
|
//不存在提示 |
|
|
|
if (itemDetail == undefined) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【"+result.fromLocationCode+"】不在列表中") |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|
|
|
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|
|
|
return; |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【"+result.fromLocationCode+"】已经扫描") |
|
|
|
} else { |
|
|
|
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode && |
|
|
|
r.inventoryStatus == result.balance.inventoryStatus |
|
|
|
}) |
|
|
|
//箱码、批次、库位、状态不一致 |
|
|
|
if (itemDetail == undefined) { |
|
|
|
itemDetail = detail.subList.find(r => { |
|
|
|
return r.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode |
|
|
|
}) |
|
|
|
if (itemDetail.scaned) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|
|
|
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); |
|
|
|
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
|
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { |
|
|
|
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
']不一致,是否继续退货?', res => { |
|
|
|
if (res) { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.balance.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.stdPackQty = result.package.stdPackQty |
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
|
|
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + |
|
|
|
itemStatus + |
|
|
|
']不一致,不允许转移!', res => { |
|
|
|
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { |
|
|
|
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
']不一致,是否继续退货?', res => { |
|
|
|
if (res) { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.balance.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.inventoryStatus =result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = result.balance.qty; |
|
|
|
itemDetail.balance.stdPackQty = result.package.stdPackQty |
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + |
|
|
|
itemStatus + |
|
|
|
']不一致,不允许转移!', res => { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
// 箱码、批次、库位、状态一致 |
|
|
|
if (itemDetail.scaned) { |
|
|
|
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result |
|
|
|
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") |
|
|
|
return; |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.balance.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.inventoryStatus =result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty); |
|
|
|
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty) |
|
|
@ -285,7 +312,9 @@ |
|
|
|
this.calcHandleQty(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} catch (e) { |
|
|
|