|
|
@ -48,7 +48,8 @@ |
|
|
|
inventoryMoveSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
getManagementPrecisions, |
|
|
|
getPrecisionStrategyList |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -61,7 +62,7 @@ |
|
|
|
updateTitle, |
|
|
|
navigateBack, |
|
|
|
getCurrDateTime, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
getPackingNumberAndBatchByList, |
|
|
|
getInventoryStatusName |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
@ -264,16 +265,17 @@ |
|
|
|
} else { |
|
|
|
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); |
|
|
|
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); |
|
|
|
if (itemDetail.inventoryStatus != result.balance.inventoryStatus){ |
|
|
|
if(this.jobContent.allowModifyInventoryStatus=="TRUE"){ |
|
|
|
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
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.handleQty = Number(result.balance.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty =Number(result.balance.qty) ; |
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty); |
|
|
|
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty) |
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
|
this.calcHandleQty(); |
|
|
@ -281,15 +283,16 @@ |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}else { |
|
|
|
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + |
|
|
|
} else { |
|
|
|
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + |
|
|
|
itemStatus + |
|
|
|
']不一致,不允许转移!', res => { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.balance.qty) ; |
|
|
|
itemDetail.handleQty = Number(result.balance.qty); |
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus; |
|
|
|
itemDetail.balance = result.balance; |
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty); |
|
|
@ -297,27 +300,6 @@ |
|
|
|
itemDetail.balance.stdPackUnit = result.package.stdPackUnit |
|
|
|
this.calcHandleQty(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
|
// 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 { |
|
|
|
|
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -362,24 +344,15 @@ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.managementList = []; |
|
|
|
|
|
|
|
//查询管理模式 |
|
|
|
// this.detailSource.forEach(item => { |
|
|
|
// item.subList.forEach(detail => { |
|
|
|
// if (detail.scaned) { |
|
|
|
// getManagementPrecisions(item.itemCode,detail.toLocationCode,res=>{ |
|
|
|
// if (res.success) { |
|
|
|
// this.managementList = this.managementList.concat(res.list) |
|
|
|
|
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
this.managementList = []; |
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
|
|
inventoryMoveSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
@ -391,6 +364,39 @@ |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setPrecisionStrategParams(){ |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
if (res.itemCode == item.itemCode |
|
|
|
&&res.locationCode == detail.locationCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
//去掉重复元素 |
|
|
|
if(filterResult.length==0){ |
|
|
|
var result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.toLocationCode |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
@ -400,10 +406,10 @@ |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
// detail.packingNumber, detail.batch); |
|
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
detail.toBatch = detail.batch; |
|
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
|
detail.toBatch = info.batch; |
|
|
|
detail.toContainerNumber = ''; |
|
|
|
|
|
|
|
detail.toLocationCode = detail.toLocationCode; |
|
|
|