|
|
@ -41,7 +41,6 @@ |
|
|
|
style='width: 100px;' |
|
|
|
@change="qtyChanged($event,item,index)"> |
|
|
|
</com-number-box> |
|
|
|
<text class="text_black">({{item.uom}})</text> |
|
|
|
</view> |
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
@ -174,7 +173,6 @@ |
|
|
|
}, |
|
|
|
options: [], |
|
|
|
facDetails: [], |
|
|
|
currentData: null |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
@ -229,10 +227,10 @@ |
|
|
|
this.$refs.location.openScanPopup() |
|
|
|
}, |
|
|
|
getToLocation(locationInfo) { |
|
|
|
if (this.currentItem.originalLocationCode != locationInfo.code) { |
|
|
|
if (this.datacontent.fromErpLocationCode != locationInfo.erpLocationCode) { |
|
|
|
scanFailedAudio() |
|
|
|
this.showMessage("扫描库位[" + locationInfo.code + "]与推荐来源库位[" + this.currentItem |
|
|
|
.originalLocationCode + "]不一致") |
|
|
|
this.showMessage("扫描库位[" + locationInfo.code + "]的ERP储位与推荐来源库位的ERP储位[" + this.datacontent |
|
|
|
.fromErpLocationCode + "]不一致") |
|
|
|
return; |
|
|
|
} |
|
|
|
scanSuccessAudio() |
|
|
@ -312,6 +310,10 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
showRecommend() { |
|
|
|
if(this.facDetails.length==0){ |
|
|
|
this.showMessage("无推荐信息") |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$refs.recommendList.openScanPopup(this.facDetails) |
|
|
|
}, |
|
|
|
|
|
|
@ -350,7 +352,8 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
if (res) { |
|
|
|
var result = { |
|
|
|
itemCode: res.code |
|
|
|
itemCode: res.code, |
|
|
|
uom:res.basicUom |
|
|
|
} |
|
|
|
this.getScanResult(result, false) |
|
|
|
} else { |
|
|
@ -365,13 +368,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result, isMesCode = true) { |
|
|
|
|
|
|
|
// AH240321AM0153 AH240321AM0198 AH240321AM0199 |
|
|
|
let item = this.facDetails.find(r => { |
|
|
|
return r.itemCode == result.itemCode |
|
|
|
}); |
|
|
|
if (item) { |
|
|
|
this.currentData = item; |
|
|
|
if(result.itemCode==this.datacontent.itemCode){ |
|
|
|
let scanItem = this.details.find(r => r.itemCode === result.itemCode) |
|
|
|
//已经存在 |
|
|
|
if (scanItem) { |
|
|
@ -382,7 +379,7 @@ |
|
|
|
} |
|
|
|
} else { |
|
|
|
scanSuccessAudio() |
|
|
|
var addItem = this.setItemInfo(result, item) |
|
|
|
var addItem = this.setItemInfo(result) |
|
|
|
this.details.unshift(addItem) |
|
|
|
this.scanCount = 0; |
|
|
|
this.details.forEach(res => { |
|
|
@ -390,8 +387,7 @@ |
|
|
|
}) |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
}else { |
|
|
|
if (isMesCode) { |
|
|
|
this.showMessage('单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描'); |
|
|
|
} else { |
|
|
@ -399,16 +395,17 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setItemInfo(result, item) { |
|
|
|
setItemInfo(result) { |
|
|
|
var item = { |
|
|
|
id: guid(), |
|
|
|
itemCode: item.itemCode, |
|
|
|
itemName: item.itemName, |
|
|
|
itemDesc1: item.itemDesc1, |
|
|
|
itemDesc2: item.itemDesc2, |
|
|
|
stdPackQty: item.stdPackQty, |
|
|
|
itemCode: this.datacontent.itemCode, |
|
|
|
itemName: this.datacontent.itemName, |
|
|
|
itemDesc1: this.datacontent.itemDesc1, |
|
|
|
itemDesc2: this.datacontent.itemDesc2, |
|
|
|
stdPackQty: this.datacontent.stdPackQty, |
|
|
|
masterID: this.datacontent.id, |
|
|
|
|
|
|
|
recommendContainerCode: "", |
|
|
@ -418,9 +415,8 @@ |
|
|
|
recommendProduceDate: getCurrDateTimeAndT(), |
|
|
|
recommendExpireDate: getCurrDateTimeAndT(), |
|
|
|
recommendLot: "", |
|
|
|
originalLocationCode: item.recommendFromLocationCode, |
|
|
|
recommendQty: item.qty, |
|
|
|
uom: item.uom, |
|
|
|
recommendQty: this.datacontent.qty, |
|
|
|
uom: result.uom, |
|
|
|
|
|
|
|
handledContainerCode: "", |
|
|
|
handledPackingCode: "", |
|
|
@ -429,7 +425,7 @@ |
|
|
|
handledProduceDate: getCurrDateTimeAndT(), |
|
|
|
handledExpireDate: getCurrDateTimeAndT(), |
|
|
|
handledLot: "", |
|
|
|
handledQty: item.recommendQty, |
|
|
|
handledQty: this.datacontent.qty, |
|
|
|
|
|
|
|
creatorId: guid(), |
|
|
|
creationTime: getCurrDateTimeAndT(), |
|
|
@ -449,18 +445,23 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value == 0) { |
|
|
|
if (value<= 0) { |
|
|
|
this.showMessage('领料数量必须大于0') |
|
|
|
item.handledQty = this.currentData.recommendQty |
|
|
|
item.handledQty = this.datacontent.qty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (value > this.currentData.recommendQty) { |
|
|
|
}else if (value > this.datacontent.qty) { |
|
|
|
this.showMessage("实际领料数量不能大于申请数量") |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(this.currentData.recommendQty); |
|
|
|
return; |
|
|
|
item.handledQty = this.datacontent.qty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|
|
|
}else { |
|
|
|
item.handledQty =value |
|
|
|
} |
|
|
|
|
|
|
|
this.scanCount = 0; |
|
|
|
this.details.forEach(res => { |
|
|
|
this.scanCount += res.handledQty |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// //接收 |
|
|
@ -479,10 +480,18 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
|
|
|
|
if (this.details.length == 0) { |
|
|
|
this.showMessage('扫描列表为0,请先扫描'); |
|
|
|
return; |
|
|
|
showConfirmMsg("扫描列表为0,是否提交?",res=>{ |
|
|
|
if(res){ |
|
|
|
this.finsh(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.scanCount = 0; |
|
|
|
this.details.forEach(res => { |
|
|
|
this.scanCount += res.handledQty |
|
|
|
}) |
|
|
|
var locationHint = "" |
|
|
|
this.details.forEach(res => { |
|
|
|
if (!res.handledFromLocationCode) { |
|
|
@ -494,11 +503,20 @@ |
|
|
|
this.showMessage(locationHint); |
|
|
|
return |
|
|
|
} |
|
|
|
if(this.scanCount>this.datacontent.qty){ |
|
|
|
this.showMessage('提交的数量大于扫描的数量,不可以提交'); |
|
|
|
|
|
|
|
if(this.scanCount<this.datacontent.qty){ |
|
|
|
showConfirmMsg("提交的数量小于需求的数量,是否提交?",res=>{ |
|
|
|
if(res){ |
|
|
|
this.finsh(); |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(this.scanCount>this.datacontent.qty){ |
|
|
|
this.showMessage('提交的数量大于需求的数量,不可以提交'); |
|
|
|
}else { |
|
|
|
this.finsh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|