Browse Source

修改发料任务和发料接收

lijuncheng0816
lijuncheng 1 month ago
parent
commit
72c471f366
  1. 49
      src/pages/issue/job/issueDetail.vue
  2. 65
      src/pages/productionReceipt/job/productionReceiptDetail.vue

49
src/pages/issue/job/issueDetail.vue

@ -171,12 +171,6 @@
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
// this.$refs.mainCollapse.forEach(r => {
// r.childrens.forEach(i => {
// i.init();
// })
// r.resize();
// })
});
},
@ -290,6 +284,7 @@
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
console.log("自动提交submitJob")
this.submitJob();
} else {
uni.hideLoading();
@ -455,39 +450,43 @@
afterScan() {
this.resizeCollapse();
let str = ""
this.detailSource.forEach(detail => {
let s = '';
detail.Items.forEach(item => {
let totalHandleQty = 0;
var isHandleEmpty = false; // handleQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
if (batch.handleQty != 0) {
totalHandleQty = calc.add(totalHandleQty, batch
.handleQty)
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
isHandleEmpty = true;
tempHandleQty = 0
}
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
})
})
if (item.qty == totalHandleQty) {
if (isHandleEmpty) {
return;
}
this.submit();
} else {
this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty +
'】与物料需求数量【' + item.qty +
'】不一致,是否继续提交', res => {
})
})
})
if (str) {
str = '任务明细未全部完成,是否提交?\n' + str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submit();
//
this.$throttle(this.submit,2000,this)()
} else {
this.scanPopupGetFocus()
}
});
} else {
//
this.$throttle(this.submit,2000,this)()
}
})
})
},
scanPopupGetFocus() {

65
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -217,9 +217,7 @@
},
autoCommit(){
//
var noCommitInfo=null
let str=""
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
@ -238,11 +236,11 @@
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.commit()
this.$throttle(this.commit,2000,this)()
}
});
} else {
this.commit()
this.$throttle(this.commit,2000,this)()
}
},
@ -364,6 +362,7 @@
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
console.log("自动提交")
this.autoCommit();
} else {
this.scanPopupGetFocus();
@ -387,6 +386,7 @@
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
this.autoCommit();
}
}
@ -411,12 +411,14 @@
//
if (this.scanCount == this.subList.length) {
this.submitJob();
console.log("提交this.submitJob()")
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
console.log("提交this.submitJob()")
this.submitJob()
}
});
@ -470,34 +472,33 @@
this.showErrorMessage(error)
})
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
productionReceiptJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发料接收记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
// var itemCodes = []
// this.detailSource.forEach(item => {
// itemCodes.push(item.itemCode)
// })
// getManagementPrecisions(itemCodes, this.toLocationCode, res => {
// if (res.success) {
// this.managementList = res.list;
// var params = this.setParams()
// console.log("", JSON.stringify(params));
// productionReceiptJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("\n\n" + res.data)
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
},
setParams() {

Loading…
Cancel
Save