Browse Source

YT-505成品发货:扫描数量大于任务数量时,如果配置了不允许大于推荐数量,则不可提交任务。

intex_online20241111
张立 4 months ago
parent
commit
1c09667a27
  1. 78
      src/pages/deliver/job/deliverDetailBatch.vue

78
src/pages/deliver/job/deliverDetailBatch.vue

@ -224,6 +224,8 @@
getManagementPrecisions(itemCodes, locationCode, res => { getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.submitJob(); this.submitJob();
} else { } else {
uni.hideLoading(); uni.hideLoading();
@ -248,28 +250,67 @@
}, },
checkCount() { checkCount() {
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
//
item.totalQty =totalQty
})
})
//
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
}
}
})
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
checkCountBatch() {
let str = "" let str = ""
let str1 = "" let str1 = ""
var taskQty = 0;
var totalQty = 0;
this.detailSource.subList.forEach(item => { this.detailSource.subList.forEach(item => {
var taskQty = 0;
var totalQty = 0;
item.taskQty = calc.add(taskQty, item.qty) item.taskQty = calc.add(taskQty, item.qty)
var hanleQty = item.qty ? item.qty : 0 totalQty = calc.add(totalQty, item.handleQty)
totalQty = calc.add(totalQty, hanleQty)
// //
item.totalQty = totalQty item.totalQty = totalQty
}) })
// //
this.detailSource.subList.forEach(detail => { this.detailSource.subList.forEach(detail => {
if (this.jobContent.allowPartialComplete == "FALSE") { if (this.jobContent.allowPartialComplete == "FALSE") {
if (taskQty != totalQty) { if (detail.taskQty != detail.totalQty) {
str += `物料号【${detail.itemCode}】任务数量【${taskQty}】与实际提交数量【${totalQty}】不一致\n` str += `物料号【${detail.itemCode}】任务数量【${detail.taskQty}】与实际提交数量【${detail.totalQty}】不一致\n`
} }
} }
if (this.allowBiggerQty == 'FALSE') { if (this.allowBiggerQty == 'FALSE') {
if (taskQty > totalQty) { if ( detail.taskQty < detail.totalQty) {
str1 += '数量[' + totalQty + ']不允许大于任务数量[' + taskQty + ']' str1 += '数量[' + detail.totalQty + ']不允许大于任务数量[' + detail.taskQty + ']'
} }
} }
}) })
@ -279,8 +320,8 @@
this.showErrorMessage(str) this.showErrorMessage(str)
} }
if (str1) { if (str1) {
str = '不允许提交\n' + str str1 = '不允许提交\n' + str1
this.showErrorMessage(str) this.showErrorMessage(str1)
} }
return str || str1 ? false : true return str || str1 ? false : true
@ -295,11 +336,18 @@
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码') this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return return
} }
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){
if (!this.checkCount()) { if (!this.checkCountBatch()) {
uni.hideLoading() uni.hideLoading()
return; return;
}
}else{
if (!this.checkCount()) {
uni.hideLoading()
return;
}
} }
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {

Loading…
Cancel
Save