Browse Source

发料判断问题

intex
zhang_li 2 weeks ago
parent
commit
868a186ede
  1. 2
      src/pages/deliver/job/deliverDetailBatch.vue
  2. 2
      src/pages/issue/coms/comIssueDetailCardBatch.vue
  3. 95
      src/pages/issue/job/issueDetailBatch.vue

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

@ -509,7 +509,7 @@
item.totalQty=0
item.taskQty =calc.add(item.taskQty,item.qty)
item.totalQty =calc.add(item.totalQty,item.handleQty)
if (this.jobContent.allowPartialComplete == "FALSE") {
if (this.jobContent.allowSmallerQty == "FALSE") {
if(item.handleQty!=item.taskQty){
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n`
}

2
src/pages/issue/coms/comIssueDetailCardBatch.vue

@ -14,7 +14,7 @@
<uni-swipe-action ref="swipeAction" style="margin-top: 10px;"
v-for="(item,index) in dataContent.subList">
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" @click="itemCoceClick($event,item,index)">
:right-options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:options" @click="itemCoceClick($event,item,index)">
<view class="" :class="item.scaned?'scan_view':''">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</view>

95
src/pages/issue/job/issueDetailBatch.vue

@ -217,7 +217,7 @@
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
res.data.allowModifyLocation = 'FALSE'
// res.data.allowModifyLocation = 'FALSE'
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
@ -261,16 +261,36 @@
},
getScanResult(result, managementTypeParams) {
console.log(this.jobContent.allowModifyLocation)
// if(this.jobContent.allowModifyLocation == 'TRUE'){
// this.managementType = managementTypeParams
// if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
// this.setDataBatch(result)
// }
// }else{
// this.showErrorMessage(`${this.fromLocationCode}`)
// }
this.managementType = managementTypeParams
let array1 = []//
let array2 = []//
this.detailSource.forEach(item=>{
item.subList.forEach(cur=>{
array1.push(cur.fromLocationCode)
array2.push(cur.batch)
})
})
//
const obj1 = array1.find(item=>item == result.fromLocationCode)
const obj2 = array2.find(item=>item == result.label.batch)
if(this.jobContent.allowModifyLocation == 'FALSE'){
if(!obj1){
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
return
}
}
if(this.jobContent.allowModifyBatch == 'FALSE'){
if(!obj2){
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`)
return
}
}
if(!obj1){
this.recommendQty = 0
}else{
this.recommendQty = result.balance.qty
}
// this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
}
@ -327,7 +347,7 @@
toLocationCode:this.toLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:result.balance.qty,
qty:this.recommendQty,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
@ -596,8 +616,11 @@
autoCommit(){
// this.$throttle(this.submit, 2000, this)()
// this.jobContent.allowSmallerQty = 'FALSE'
this.jobContent.allowBiggerQty = 'FALSE'
let str=""
let str1=""
let str2=""
var totalQty =0;
var taskQty =0;
console.log(877,this.detailSource)
@ -605,29 +628,43 @@
detail.subList.forEach(item => {
if(item.scaned){
taskQty =calc.add(taskQty,item.qty)
totalQty =calc.add(totalQty,item.handleQty)
if(item.handleQty<item.qty){
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.qty}】不一致\n`
totalQty =calc.add(totalQty,item.handleQty)
if (this.jobContent.allowSmallerQty == "FALSE") {
if(parseFloat(item.handleQty)<parseFloat(item.qty)){
str += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许小于任务数量【${item.qty}`
}
}
if (this.jobContent.allowBiggerQty == 'FALSE') {
if (parseFloat( item.handleQty )> parseFloat(item.qty)){
str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}`
}
}
if(item.handleQty>item.balance.qty){
str1 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}`
if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){
str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}`
}
}
})
})
if(str1){
this.$refs.comMessage.showMessage(str1, res => {
if (res) {
this.afterCloseMessage()
}
});
console.log(877,str)
if (str) {
str1 = '不允许提交\n' + str
this.showErrorMessage(str)
return
}
if (str1) {
str1 = '不允许提交\n' + str1
this.showErrorMessage(str1)
return
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
return
}
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
@ -635,18 +672,6 @@
//
this.$throttle(this.submit, 2000, this)()
} else {
// this.detailSource.forEach(detail => {
// detail.Items.forEach(item => {
// taskQty =calc.add(taskQty,item.qty)
// item.Locations.forEach(lco => {
// lco.Batchs.forEach(batch => {
// batch.Records = []
// })
// })
// })
// })
// this.$refs.comScanIssuePack.clearList()
this.scanPopupGetFocus()
}
});

Loading…
Cancel
Save