Browse Source

YT-508合格转报废还是按单箱管理校验扫描数量;提交后生成的库存事务中数量为0,应该是实际扫描的数量

intex_online20241111
zhang_li 1 month ago
parent
commit
340c92cd05
  1. 99
      src/pages/inventoryMove/job/inventoryMoveDetail.vue

99
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -389,22 +389,41 @@
},
commit() {
async commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
await getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
//
//
if (this.scanCount == this.subList.length) {
this.checkCount();
if(this.managementType == 'BY_BATCH'){
this.checkCount();
}else{
this.checkCountBatch();
}
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY' ){
this.checkCountBatch();
}else{
this.checkCount();
}
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
@ -443,44 +462,56 @@
this.submitJob()
}
},
checkCountBatch(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
var tempHandleQty = 0
if (cur.handleQty) {
tempHandleQty = cur.handleQty
} else {
tempHandleQty = 0
}
str +=
`提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
}
})
})
if (str) {
str = '任务明细未全部完成,是否提交?\n' + str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
this.submitJob()
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
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) {
let showTitle = this.title
if (this.title.indexOf('任务') == this.title.length - 2) {
showTitle = this.title.replace('任务', '')
}
this.showCommitSuccessMessage("提交成功\n生成" + showTitle + "记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
let showTitle = this.title
if (this.title.indexOf('任务') == this.title.length - 2) {
showTitle = this.title.replace('任务', '')
}
this.showCommitSuccessMessage("提交成功\n生成" + showTitle + "记录\n" + res.data)
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setPrecisionStrategParams() {

Loading…
Cancel
Save