|
|
@ -72,6 +72,9 @@ |
|
|
|
calcHandleQty, |
|
|
|
getScanCount |
|
|
|
} from '@/common/detail.js'; |
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
@ -256,14 +259,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
|
// this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
|
this.toLocationCode = code |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
detail.toLocationCode = code |
|
|
|
}) |
|
|
|
}) |
|
|
|
// }) |
|
|
|
}, |
|
|
|
|
|
|
|
checkLocation() { |
|
|
@ -300,12 +301,17 @@ |
|
|
|
|
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
if (this.checkCount()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (this.scanCount < this.subList.length) { |
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
//提交 |
|
|
|
if (this.checkCount()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//不允许部分提交,提示 |
|
|
|
this.showMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + "]总共[" + this.subList |
|
|
@ -316,6 +322,33 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
checkCount() { |
|
|
|
var isCheck = true; |
|
|
|
var hint = "" |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
var item = this.detailSource[i]; |
|
|
|
for (var j = 0; j < item.subList.length; j++) { |
|
|
|
var subItem = item.subList[i] |
|
|
|
if (calc.sub(subItem.handleQty, subItem.qty) < 0) { |
|
|
|
isCheck = false; |
|
|
|
hint = "包装【" + subItem.packingNumber + "】实际收货数量:" + subItem.handleQty + "与包装数量" + subItem.qty + |
|
|
|
"不相等,是否继续收货?" |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isCheck) { |
|
|
|
this.showQuestMessage(hint, res => { |
|
|
|
if (res) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
return isCheck; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
submitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
@ -333,7 +366,7 @@ |
|
|
|
productReceiptJobsubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data, ) |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成预生产收货记录<br>" + res.data, ) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
@ -411,6 +444,13 @@ |
|
|
|
navigateBack(1) |
|
|
|
}) |
|
|
|
}, |
|
|
|
showQuestMessage(hint, callBack) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(hint, res => { |
|
|
|
if (res) { |
|
|
|
callBack(true) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|