|
@ -41,7 +41,6 @@ |
|
|
style='width: 100px;' |
|
|
style='width: 100px;' |
|
|
@change="qtyChanged($event,item,index)"> |
|
|
@change="qtyChanged($event,item,index)"> |
|
|
</com-number-box> |
|
|
</com-number-box> |
|
|
<text class="text_black">({{item.uom}})</text> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</uni-th> |
|
|
</uni-th> |
|
|
</uni-tr> |
|
|
</uni-tr> |
|
@ -283,6 +282,10 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showRecommend() { |
|
|
showRecommend() { |
|
|
|
|
|
if(this.facDetails.length==0){ |
|
|
|
|
|
this.showMessage("无推荐信息") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.$refs.recommendList.openScanPopup(this.facDetails) |
|
|
this.$refs.recommendList.openScanPopup(this.facDetails) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -309,9 +312,8 @@ |
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
this.currentItem = result; |
|
|
this.currentItem = result; |
|
|
//扫描的ERP料号是否在任务列表中 |
|
|
//扫描的ERP料号是否在任务列表中 |
|
|
let item = this.facDetails.find(r => r.itemCode == result.data.itemCode); |
|
|
let item ="" |
|
|
//在任务列表中 |
|
|
if(result.data.itemCode==this.datacontent.itemCode){ |
|
|
if (item) { |
|
|
|
|
|
//校验箱码是否已经扫描 |
|
|
//校验箱码是否已经扫描 |
|
|
let scanItem = this.details.find(r => r.handledPackingCode == result.data.code); |
|
|
let scanItem = this.details.find(r => r.handledPackingCode == result.data.code); |
|
|
if (scanItem) { |
|
|
if (scanItem) { |
|
@ -322,28 +324,37 @@ |
|
|
if (res.totalCount === 1) { |
|
|
if (res.totalCount === 1) { |
|
|
this.balancesItem = res.items[0]; |
|
|
this.balancesItem = res.items[0]; |
|
|
if (this.balancesItem) { |
|
|
if (this.balancesItem) { |
|
|
|
|
|
if(this.balancesItem.qty<0){ |
|
|
|
|
|
scanFailedAudio() |
|
|
|
|
|
this.showMessage("扫描数量必须大于等于0") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
var addItem = this.setItemInfo(result, this.balancesItem) |
|
|
var addItem = this.setItemInfo(result, this.balancesItem) |
|
|
if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) { |
|
|
if (this.datacontent.fromErpLocationCode != addItem.handledFromLocationErpCode) { |
|
|
|
|
|
scanFailedAudio() |
|
|
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
|
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
|
} else { |
|
|
} else { |
|
|
if (item.recommendPackingCode != result.data.code) { |
|
|
var item =this.facDetails.find(r=>r.handledPackingCode==result.data.code) |
|
|
showConfirmMsg("扫描的箱码[" + result.data.code + "]与任务中的箱码[" + item |
|
|
//判断是否在推荐列表中 |
|
|
.recommendPackingCode + "]不一致,是否添加到列表中", res => { |
|
|
if(item){ |
|
|
if (res) { |
|
|
scanSuccessAudio() |
|
|
this.details.unshift(addItem) |
|
|
this.details.unshift(addItem) |
|
|
this.scanCount = 0; |
|
|
this.scanCount = 0; |
|
|
this.details.forEach(res => { |
|
|
this.details.forEach(res => { |
|
|
this.scanCount += res.handledQty |
|
|
this.scanCount += res.handledQty |
|
|
}) |
|
|
}) |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else { |
|
|
}else { |
|
|
|
|
|
scanFailedAudio() |
|
|
|
|
|
showConfirmMsg("扫描的箱码[" + result.data.code + "]与推荐的箱码不一致,是否确认?", res => { |
|
|
|
|
|
if (res) { |
|
|
this.details.unshift(addItem) |
|
|
this.details.unshift(addItem) |
|
|
this.scanCount = 0; |
|
|
this.scanCount = 0; |
|
|
this.details.forEach(res => { |
|
|
this.details.forEach(res => { |
|
|
this.scanCount += res.handledQty |
|
|
this.scanCount += res.handledQty |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -358,7 +369,6 @@ |
|
|
this.showMessage('扫描的ERP料号[' + result.data.itemCode + "]不在推荐任务列表中") |
|
|
this.showMessage('扫描的ERP料号[' + result.data.itemCode + "]不在推荐任务列表中") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setItemInfo(result, balance) { |
|
|
setItemInfo(result, balance) { |
|
@ -383,7 +393,7 @@ |
|
|
recommendFromLocationGroup: balance.locationCode, |
|
|
recommendFromLocationGroup: balance.locationCode, |
|
|
recommendFromLocationErpCode: balance.locationErpCode, |
|
|
recommendFromLocationErpCode: balance.locationErpCode, |
|
|
recommendFromWarehouseCode: balance.warehouseCode, |
|
|
recommendFromWarehouseCode: balance.warehouseCode, |
|
|
recommendQty: result.data.qty, |
|
|
recommendQty: balance.qty, |
|
|
uom: result.data.uom, |
|
|
uom: result.data.uom, |
|
|
|
|
|
|
|
|
handledContainerCode: "", |
|
|
handledContainerCode: "", |
|
@ -398,7 +408,7 @@ |
|
|
handledFromLocationGroup: balance.locationCode, |
|
|
handledFromLocationGroup: balance.locationCode, |
|
|
handledFromLocationErpCode: balance.locationErpCode, |
|
|
handledFromLocationErpCode: balance.locationErpCode, |
|
|
handledFromWarehouseCode: balance.warehouseCode, |
|
|
handledFromWarehouseCode: balance.warehouseCode, |
|
|
handledQty: result.data.qty, |
|
|
handledQty: balance.qty, |
|
|
|
|
|
|
|
|
creatorId: guid(), |
|
|
creatorId: guid(), |
|
|
creationTime: getCurrDateTimeAndT(), |
|
|
creationTime: getCurrDateTimeAndT(), |
|
@ -442,7 +452,7 @@ |
|
|
result |
|
|
result |
|
|
.data.lot + '】未查询到库存信息'); |
|
|
.data.lot + '】未查询到库存信息'); |
|
|
} else { |
|
|
} else { |
|
|
scanSuccessAudio() |
|
|
|
|
|
callback(res); |
|
|
callback(res); |
|
|
} |
|
|
} |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -456,6 +466,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedBalanceItem(balanceItem) { |
|
|
selectedBalanceItem(balanceItem) { |
|
|
|
|
|
if(balancesItem.qty<0){ |
|
|
|
|
|
scanFailedAudio() |
|
|
|
|
|
this.showMessage("扫描数量必须大于等于0") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
var addItem = this.setItemInfo(result, this.balancesItem) |
|
|
var addItem = this.setItemInfo(result, this.balancesItem) |
|
|
if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) { |
|
|
if (item.recommendFromLocationErpCode != addItem.handledFromLocationErpCode) { |
|
|
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
|
this.showMessage('扫描箱码[' + result.data.code + "]的ERP储位与推荐的不在同一个ERP储位") |
|
@ -497,19 +512,30 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
submit() { |
|
|
submit() { |
|
|
|
|
|
|
|
|
if(this.details.length==0){ |
|
|
if(this.details.length==0){ |
|
|
this.showMessage('扫描列表为0,请先扫描'); |
|
|
showConfirmMsg("扫描列表为0,是否提交?",res=>{ |
|
|
return; |
|
|
if(res){ |
|
|
|
|
|
this.finsh(); |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else { |
|
|
this.scanCount = 0; |
|
|
this.scanCount = 0; |
|
|
this.details.forEach(res => { |
|
|
this.details.forEach(res => { |
|
|
this.scanCount += res.handledQty |
|
|
this.scanCount += res.handledQty |
|
|
}) |
|
|
}) |
|
|
if(this.scanCount>this.datacontent.qty){ |
|
|
if(this.scanCount<this.datacontent.qty){ |
|
|
this.showMessage('提交的数量大于扫描的数量,不可以提交'); |
|
|
showConfirmMsg("提交的数量小于需求的数量,是否提交?",res=>{ |
|
|
|
|
|
if(res){ |
|
|
|
|
|
this.finsh(); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else if(this.scanCount>this.datacontent.qty){ |
|
|
|
|
|
this.showMessage('提交的数量大于需求的数量,不可以提交'); |
|
|
}else { |
|
|
}else { |
|
|
this.finsh(); |
|
|
this.finsh(); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -619,14 +645,22 @@ |
|
|
qtyChanged(value, item, index) { |
|
|
qtyChanged(value, item, index) { |
|
|
if (value <= 0) { |
|
|
if (value <= 0) { |
|
|
this.showMessage('领料数量不能小于或等于0') |
|
|
this.showMessage('领料数量不能小于或等于0') |
|
|
item.handledQty = this.currentItem.data.qty |
|
|
item.handledQty = this.datacontent.qty |
|
|
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
|
|
}else if(value>this.datacontent.qty){ |
|
|
|
|
|
item.handledQty =this.datacontent.qty |
|
|
|
|
|
this.showMessage("实际领料数量不能大于申请数量") |
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
} |
|
|
} |
|
|
// else if (value > this.currentItem.data.qty) { |
|
|
else { |
|
|
// item.handledQty = this.currentItem.data.qty |
|
|
item.handledQty =value |
|
|
// this.showMessage("实际领料数量不能大于申请数量") |
|
|
} |
|
|
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
|
|
// } |
|
|
this.scanCount = 0; |
|
|
|
|
|
this.details.forEach(res => { |
|
|
|
|
|
this.scanCount += res.handledQty |
|
|
|
|
|
}) |
|
|
|
|
|
this.$forceUpdate(); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|