Browse Source

修改发料任务和发料接收

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

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

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

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

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

Loading…
Cancel
Save