Browse Source

YT-965成品发货,同一物料,多个批次,扫描第二个批次,显示如图

intex
zhang_li 5 days ago
parent
commit
8a07b5ac3a
  1. 39
      src/pages/deliver/job/deliverDetailBatch.vue

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

@ -89,6 +89,7 @@
getThreeDataSource, getThreeDataSource,
getDataSource, getDataSource,
calcHandleQty, calcHandleQty,
getDataSourceBatch
} from '@/common/detail.js'; } from '@/common/detail.js';
import { import {
getManagementPrecisions getManagementPrecisions
@ -199,7 +200,7 @@
that.jobStatus = res.data.status; that.jobStatus = res.data.status;
that.subList = res.data.subList; that.subList = res.data.subList;
// that.detailSource = res.data; // that.detailSource = res.data;
that.detailSource = getThreeDataSource(that.jobContent) that.detailSource = getDataSourceBatch(that.subList)
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty; that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse(); that.resizeCollapse();
@ -329,6 +330,7 @@
detail.handleQty = 0 detail.handleQty = 0
detail.qty = 0 detail.qty = 0
detail.subList.forEach(item=>{ detail.subList.forEach(item=>{
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty) detail.handleQty = calc.add(detail.handleQty,item.handleQty)
detail.qty = calc.add(detail.qty,item.qty) detail.qty = calc.add(detail.qty,item.qty)
// item.packList.forEach(cur=>{ // item.packList.forEach(cur=>{
@ -357,6 +359,7 @@
detail.handleQty = 0 detail.handleQty = 0
detail.balance = result.balance, detail.balance = result.balance,
detail.subList.forEach(item=>{ detail.subList.forEach(item=>{
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty) detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{ // item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty) // cur.handleQty = calc.add(detail.handleQty,item.handleQty)
@ -385,6 +388,7 @@
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0 detail.handleQty = 0
detail.subList.forEach(item=>{ detail.subList.forEach(item=>{
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty) detail.handleQty = calc.add(detail.handleQty,item.handleQty)
}) })
} else { } else {
@ -407,6 +411,7 @@
// }) // })
detail.handleQty = 0 detail.handleQty = 0
detail.subList.forEach(item=>{ detail.subList.forEach(item=>{
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty) detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{ // item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty) // cur.handleQty = calc.add(detail.handleQty,item.handleQty)
@ -572,10 +577,12 @@
submitJob() { submitJob() {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", params); console.log("提交参数", params);
const isTrue = params.subList.some(item=>{ console.log("提交参数", params.subList);
console.log(item.recordList.some(cur=>cur.scaned)) // const isTrue = params.subList.some(item=>{
return item.recordList.some(cur=>cur.scaned) == true // console.log(item.recordList.some(cur=>cur.scaned))
}) // return item.recordList.some(cur=>cur.scaned) == true
// })
const isTrue = params.subList.some(item=>item.scaned)
if(!isTrue){ if(!isTrue){
uni.hideLoading() uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发货任务") this.showErrorMessage("请扫描您需要提交的发货任务")
@ -616,15 +623,21 @@
var subList = [] var subList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
console.log(this.detailSource)
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
let obj = {...toLocationCode} // let obj = {...toLocationCode}
delete obj.subList // delete obj.subList
obj.recordList = [] let recordList = []
let obj1 ={} let obj1 ={}
let arr = toLocationCode.subList.filter(item=>item.scaned) let arr = toLocationCode.subList.filter(item=>item.scaned)
console.log(888,arr)
if(arr.length>0){
arr.forEach(record=>{ arr.forEach(record=>{
obj1.itemCode =toLocationCode.itemCode;
obj1.itemName =toLocationCode.itemName;
obj1.scaned =record.scaned; obj1.scaned =record.scaned;
obj1.handleQty =record.handleQty; obj1.handleQty =record.handleQty;
obj1.qty =record.qty;
obj1.fromLocationCode =record.fromLocationCode; obj1.fromLocationCode =record.fromLocationCode;
obj1.fromInventoryStatus =record.fromInventoryStatus; obj1.fromInventoryStatus =record.fromInventoryStatus;
obj1.copyContent =record.copyContent; obj1.copyContent =record.copyContent;
@ -639,9 +652,15 @@
obj1.toPackingNumber = ''; obj1.toPackingNumber = '';
obj1.packingNumber = ''; obj1.packingNumber = '';
obj1.fromPackingNumber =''; obj1.fromPackingNumber ='';
obj.recordList.push(obj1) // obj = {...obj1}
recordList.push(obj1)
})
subList.push({
...obj1,
recordList: recordList
}) })
subList.push(obj) }
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime; this.jobContent.createTime = createTime;

Loading…
Cancel
Save