lijuncheng 1 day ago
parent
commit
b9745a72a5
  1. 39
      src/pages/deliver/job/deliverDetailBatch.vue

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

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

Loading…
Cancel
Save