多组织仓位
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();
|
||||
}
|
||||
|
||||
@@ -269,7 +269,6 @@ export default {
|
||||
subStockCode: this.cwcode,
|
||||
details: []
|
||||
};
|
||||
console.log(this.dataList, '=this.dataList=');
|
||||
this.dataList.forEach((it) => {
|
||||
if (it.details && it.details.length > 0) {
|
||||
it.details.forEach((k) => {
|
||||
@@ -280,16 +279,19 @@ export default {
|
||||
qty: k.qty,
|
||||
subStockCode: k.subStockCode,
|
||||
serialNumbers: k.itxlhlist,
|
||||
remark: k.remark
|
||||
remark: k.remark,
|
||||
twoSerialNumbers:k.twoSerialNumbers.filter(Boolean)
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log('入库回退下架1', this.dataList, formdata);
|
||||
// console.log('入库回退下架1', this.dataList, formdata);
|
||||
// formData.details.twoSerialNumbers = formData?.details?.twoSerialNumbers?.length && formData?.details?.twoSerialNumbers.filter(Boolean);
|
||||
if (this.requestStatus) {
|
||||
return false;
|
||||
}
|
||||
this.requestStatus = true;
|
||||
|
||||
this.$api.post('/BackRecord/OffShelf', formdata).then((res) => {
|
||||
if (res.status == 200) {
|
||||
uni.showToast({
|
||||
@@ -474,6 +476,7 @@ export default {
|
||||
it.subStockCode = res.data.subStockCode;
|
||||
it.boxId = it.boxId;
|
||||
it.remark = '';
|
||||
it.twoSerialNumbers = it.twoSerialNumbers ? it.twoSerialNumbers : []
|
||||
});
|
||||
this.dataList = [res.data].concat(this.dataList);
|
||||
|
||||
@@ -608,8 +611,11 @@ export default {
|
||||
this.xlhVal = res.data.serialNumber;
|
||||
// 缓存序列号
|
||||
this.xlhstrList.push(res.data.serialNumber);
|
||||
|
||||
console.log(this.dataList,'=this.dataList=')
|
||||
//缓存2件装序列号
|
||||
if(res.data.isTwo==2) {
|
||||
this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].twoSerialNumbers.push(res.data.twoSerialNumber);
|
||||
this.twoData.push(res.data.twoSerialNumber)
|
||||
}
|
||||
uni.showToast({
|
||||
|
||||
@@ -408,7 +408,8 @@ export default {
|
||||
materialNumber: k.materialNumber,
|
||||
qty: parseInt(k.qty ? k.qty : 0),
|
||||
serialNumbers: k.itxlhlist,
|
||||
remark: k.remark
|
||||
remark: k.remark,
|
||||
twoSerialNumbers:k.twoSerialNumbers ? k.twoSerialNumbers.filter(Boolean): []
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -418,7 +419,10 @@ export default {
|
||||
if (this.requestStatus) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.requestStatus = true;
|
||||
|
||||
// formData.details.twoSerialNumbers = formData?.details?.twoSerialNumbers?.length && formData?.details?.twoSerialNumbers?.filter(Boolean);
|
||||
this.$api.post('/BackRecord/OnShelf', formdata).then((res) => {
|
||||
if (res.status == 200) {
|
||||
uni.showToast({
|
||||
@@ -699,6 +703,7 @@ export default {
|
||||
this.xlhstrList.push(res.data.serialNumber);
|
||||
if(res.data.isTwo==2) {
|
||||
this.twoData.push(res.data.twoSerialNumber)
|
||||
this.dataList[0].details[findindx].twoSerialNumbers.push(res.data.twoSerialNumber);
|
||||
}
|
||||
uni.showToast({
|
||||
title: '获取成功',
|
||||
@@ -746,7 +751,8 @@ export default {
|
||||
materialNumber: res.data.materialNumber,
|
||||
specifications: res.data.specifications,
|
||||
materialName: res.data.materialName,
|
||||
remark: ''
|
||||
remark: '',
|
||||
twoSerialNumbers:[]
|
||||
};
|
||||
if (this.xlhOrggType == 'xlh') {
|
||||
this.dqBoxInfo.details = [];
|
||||
@@ -767,7 +773,9 @@ export default {
|
||||
materialNumber: res.data.materialNumber,
|
||||
specifications: res.data.specifications,
|
||||
materialName: res.data.materialName,
|
||||
remark: ''
|
||||
remark: '',
|
||||
twoSerialNumbers:[]
|
||||
|
||||
});
|
||||
this.itIndx = this.dataList[0].details.length - 1;
|
||||
}
|
||||
@@ -784,7 +792,9 @@ export default {
|
||||
materialNumber: res.data.materialNumber,
|
||||
specifications: res.data.specifications,
|
||||
materialName: res.data.materialName,
|
||||
remark: ''
|
||||
remark: '',
|
||||
twoSerialNumbers:[]
|
||||
|
||||
};
|
||||
this.itIndx = this.dataList[0].details.length;
|
||||
}
|
||||
@@ -796,6 +806,7 @@ export default {
|
||||
//缓存2件装序列号
|
||||
if(res.data.isTwo==2) {
|
||||
this.twoData.push(res.data.twoSerialNumber)
|
||||
this.dataList[0].details[this.itIndx].twoSerialNumbers.push(res.data.twoSerialNumber);
|
||||
}
|
||||
}
|
||||
if (this.xlhOrggType == 'ggxh') {
|
||||
@@ -883,6 +894,8 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.status == 200) {
|
||||
if (res.data !== null) {
|
||||
console.log(this.cwcode,'=this.cwcode=')
|
||||
console.log(res.data.subStockCode ,'=res.data.subStockCode =')
|
||||
if (this.htfsType == '按产品回退' && this.cwcode !== res.data.subStockCode && res.data.subStockCode) {
|
||||
uni.showToast({
|
||||
title: '请扫描对应仓位内的箱号',
|
||||
@@ -1024,7 +1037,6 @@ export default {
|
||||
this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].itxlhlist.push(this.xlhVal);
|
||||
} else {
|
||||
const indexsh = this.dataList.findIndex((obj) => obj.boxBillNo === res.data.boxBillNo);
|
||||
console.log(12, indexsh);
|
||||
if (indexsh !== -1) {
|
||||
const shwlidindex = this.dataList[indexsh].details.findIndex((obj) => obj.materialNumber === res.data.materialNumber);
|
||||
console.log(13, shwlidindex, this.dataList[indexsh].details);
|
||||
|
||||
@@ -33,20 +33,24 @@
|
||||
<!-- 無聊 -->
|
||||
<view class="item" :class="{ itembg2: !warehouseName }" :style="{ 'pointer-events': !warehouseName ? 'none' : '' }">
|
||||
<view class="" style="display: flex;padding: 10rpx 0; margin:0 40rpx;border-bottom: 1rpx solid #E3E5E8; box-sizing: border-box;">
|
||||
<view style="border-right: 1rpx solid #E3E5E8;padding-right: 16rpx;">
|
||||
<!-- border-right: 1rpx solid #E3E5E8; -->
|
||||
<view style="width:130rpx;flex:3;border-right: 1rpx solid #E3E5E8;">
|
||||
<uni-data-select
|
||||
v-model="selectValue"
|
||||
:localdata="options"
|
||||
@change="hanldeSelectChange"
|
||||
:clear="false"
|
||||
|
||||
style=""
|
||||
></uni-data-select>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;justify-content: center;">
|
||||
<u-input :focus="focusTag==='box'" @clear="handleClear" border="bottom" :style="{width: inputWidth}" style="font-size: 14px; height:32rpx;"clearable v-model="inputVal" @confirm="handleInputConfirm()"
|
||||
<!-- <view style="width: 1rpx; height:50rpx;background-color:#E3E5E8 ;">
|
||||
|
||||
</view> -->
|
||||
<view style="display: flex; align-items: center;justify-content: center;flex:10">
|
||||
<u-input :focus="focusTag==='box'" @clear="handleClear" border="bottom" style="font-size: 14px; height:32rpx;"clearable v-model="inputVal" @confirm="handleInputConfirm()"
|
||||
></u-input>
|
||||
</view>
|
||||
<view style="display: flex;align-items: center;"@click="scanImg('box')">
|
||||
<view style="display: flex;align-items: center;flex: 2;justify-content: center;"@click="scanImg('box')">
|
||||
<image src="../../static/img/smico.png" class="searchico" style="margin-left:0;"></image>
|
||||
</view>
|
||||
|
||||
@@ -193,7 +197,7 @@
|
||||
warehouseList:[],//仓库列表数据
|
||||
inputVal:'',//input输入值
|
||||
timer:null,
|
||||
inputWidth:"470rpx",
|
||||
inputWidth:0,
|
||||
timer1:null,
|
||||
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
|
||||
scanTracker: {
|
||||
@@ -207,11 +211,12 @@
|
||||
this.getElHeight(".sh_gdInfo",1)
|
||||
this.getElHeight(".mianheade",2)
|
||||
/* #ifdef H5 */
|
||||
this.inputWidth = '470rpx'
|
||||
this.inputWidth = '450rpx'
|
||||
/*#endif*/
|
||||
/*#ifdef APP-PLUS*/
|
||||
this.inputWidth = '422rpx'
|
||||
this.inputWidth = '402rpx'
|
||||
/*#endif*/
|
||||
console.log(this.inputWidth,'=this.inputWidth')
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
Reference in New Issue
Block a user