多组织仓位
This commit is contained in:
@@ -337,6 +337,7 @@ export default {
|
||||
this.dqNumTag = '';
|
||||
this.xlhOrggStrlist = [];
|
||||
this.twoData=[]
|
||||
this.confirmParams=[]
|
||||
this.MbNoTag = false;
|
||||
this.YyNoTag = false;
|
||||
this.xlhOrggTag = false;
|
||||
@@ -375,11 +376,13 @@ export default {
|
||||
qty: obj.serialNumber ? 1 : obj.qty, //如归是序列号默认为1,如果是规格型号取用户输入的值
|
||||
srcBoxId: obj.boxId,
|
||||
serialNumber: obj.serialNumber,
|
||||
serialNumbers: []
|
||||
twoSerialNumber:obj.twoSerialNumber,
|
||||
serialNumbers: [],
|
||||
twoSerialNumbers:[],
|
||||
});
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
let srcBoxId =null
|
||||
const result = Object.values(groupedBySrcBoxId).map((group) => {
|
||||
return group.reduce((acc, obj) => {
|
||||
const existing = acc.find((item) => item.materialNumber === obj.materialNumber);
|
||||
@@ -387,29 +390,41 @@ export default {
|
||||
if (obj.serialNumber) {
|
||||
existing.qty += obj.qty;
|
||||
existing.serialNumbers.push(obj.serialNumber);
|
||||
|
||||
}
|
||||
// existing.qty += obj.qty;
|
||||
// existing.serialNumbers.push(obj.serialNumber);
|
||||
if(obj.twoSerialNumber) {
|
||||
existing.twoSerialNumbers.push(obj.twoSerialNumber)
|
||||
console.log(existing,'=existing=')
|
||||
}
|
||||
|
||||
} else {
|
||||
let twoSerialNumbers = []
|
||||
if(obj.twoSerialNumber) {
|
||||
twoSerialNumbers.push(obj.twoSerialNumber)
|
||||
}
|
||||
acc.push({
|
||||
materialNumber: obj.materialNumber,
|
||||
qty: obj.qty,
|
||||
serialNumbers: obj.serialNumber ? [obj.serialNumber] : [],
|
||||
srcBoxId: obj.srcBoxId
|
||||
// srcBoxId: obj.srcBoxId,
|
||||
twoSerialNumbers:twoSerialNumbers,
|
||||
});
|
||||
srcBoxId = obj.srcBoxId
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
});
|
||||
|
||||
console.log()
|
||||
let params = [];
|
||||
let length = result.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
let obj = {
|
||||
destBoxBillNo: this.boxMbNo,
|
||||
srcBoxId: this.YyboxId ? this.YyboxId : result[i][0].srcBoxId,
|
||||
srcBoxId: this.YyboxId ? this.YyboxId : srcBoxId,
|
||||
destBoxId: this.MbBoxId ? this.MbBoxId : 0,
|
||||
subStockCode: cwcode ? cwcode : this.subStockCode ? this.subStockCode : 0, //目标箱仓位或重新上架选择仓位
|
||||
details: result[i]
|
||||
details: result[i],
|
||||
};
|
||||
params.push(obj);
|
||||
}
|
||||
@@ -419,8 +434,8 @@ export default {
|
||||
if (this.requestStatus) {
|
||||
return false;
|
||||
}
|
||||
console.log('提交的數據',params)
|
||||
this.requestStatus = true;
|
||||
this.requestStatus = true;
|
||||
console.log(params,'=params=')
|
||||
this.$api.post('/ChangeBoxRecord/Save', params).then((res) => {
|
||||
if (res.status == 200) {
|
||||
uni.showToast({
|
||||
@@ -633,7 +648,7 @@ export default {
|
||||
specifications: this.itData.specifications,
|
||||
materialNumber: this.itData.materialNumber,
|
||||
qty: this.dqNum,
|
||||
srcBoxId: this.itData.boxId
|
||||
srcBoxId: this.itData.boxId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -834,13 +849,15 @@ export default {
|
||||
specifications: res.data.specifications,
|
||||
materialNumber: res.data.materialNumber,
|
||||
qty: 1,
|
||||
srcBoxId: res.data.boxId
|
||||
srcBoxId: res.data.boxId,
|
||||
twoSerialNumber:res.data.twoSerialNumber ? res.data.twoSerialNumber: ''
|
||||
});
|
||||
}
|
||||
//数量默认为1
|
||||
this.focusInput = 'xlhggxh';
|
||||
this.setSMinputxlhOrggxh();
|
||||
this.xlhOrggStrlist.push(this.xlhOrggType == 'xlh' ? res.data.serialNumber : res.data.specifications);
|
||||
this.xlhOrggStrlist.push(this.xlhOrggType == 'xlh' ? res.data.serialNumber : res.data.specifications);
|
||||
this.confirmParams.push(res.data);
|
||||
uni.showToast({
|
||||
title: '设置成功',
|
||||
icon: 'none',
|
||||
@@ -858,7 +875,7 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.xlhOrggStrlist.includes(this.xlhOrggxhVal) || this.twoData.includes(this.xlhVal)) {
|
||||
if (this.xlhOrggStrlist.includes(this.xlhOrggxhVal) || this.twoData.includes(this.xlhOrggxhVal)) {
|
||||
this.setSMinputxlhOrggxh();
|
||||
uni.showToast({
|
||||
title: '该序列号/格型号已扫描',
|
||||
@@ -880,7 +897,6 @@ export default {
|
||||
this.xlhggxhData = res;
|
||||
this.useGGXH = res.data.specifications;
|
||||
this.entGGXH = res.data.specifications;
|
||||
this.confirmParams.push(res.data);
|
||||
// 明细添加,如果该序列号对应的规格型号不存在,就明细填加一条,如果存在就数量加一(booleacz 这个是判断规格型号)
|
||||
this.booleacz = this.dataList.some((obj) => obj.specifications === res.data.specifications);
|
||||
// 判断扫码的是个序列号还是规格型号
|
||||
@@ -895,6 +911,10 @@ export default {
|
||||
});
|
||||
return;
|
||||
}
|
||||
//缓存2件装序列号
|
||||
if(res.data.isTwo==2 ) {
|
||||
this.twoData.push(res.data.twoSerialNumber)
|
||||
}
|
||||
if (this.xlhOrggType == 'xlh') {
|
||||
let xlhyyitlist = [];
|
||||
this.yyMXlist.forEach((it) => {
|
||||
@@ -902,6 +922,7 @@ export default {
|
||||
xlhyyitlist = it.serialNumbers;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
原箱号有值,序列号=激活、激活且非冻结、非激活且非冻结=扫描成功,
|
||||
原箱号没有值,序列号=非激活且非冻结、激活且冻结=扫描成功
|
||||
@@ -991,13 +1012,15 @@ export default {
|
||||
this.dqNum = null;
|
||||
this.focusInput = 'dqNum';
|
||||
this.xlhOrggStrlist.push(this.xlhOrggType == 'xlh' ? res.data.serialNumber : res.data.specifications);
|
||||
this.confirmParams.push(res.data);
|
||||
//缓存2件装序列号
|
||||
if(res.data.isTwo==2 && this.xlhOrggType == 'xlh') {
|
||||
this.twoData.push(res.data.twoSerialNumber)
|
||||
}
|
||||
// if(res.data.isTwo==2 && this.xlhOrggType == 'xlh') {
|
||||
// this.twoData.push(res.data.twoSerialNumber)
|
||||
// console.log(this.twoData,'=this.twoData=')
|
||||
// }
|
||||
}
|
||||
this.focusInput = this.xlhOrggType == 'ggxh' ? 'dqNum' : 'xlhggxh';
|
||||
|
||||
|
||||
} else {
|
||||
this.setSMinputxlhOrggxh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user