多组织仓位

This commit is contained in:
2026-06-01 17:24:20 +08:00
parent e8b07fcece
commit da62f10df1
16 changed files with 797 additions and 503 deletions

View File

@@ -312,7 +312,7 @@ export default {
remarkIndex: null, //修改的是那个明细的备注
itremake: '', // 明细盘亏备注
choseBoxId: '', // 当前箱的箱id
subStockCode: null, // 当前箱的仓位code
// subStockCode: null, // 当前箱的仓位code
subStockCode: '', //仓位code
old_SubStockCode: '', //老仓位code,由箱号携带出来
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
@@ -407,13 +407,11 @@ export default {
},
//仓库change事件
ckchange(e) {
console.log(1232323);
this.xhDisabled = !e.name;
this.focusInput = '';
this.warehouseName = e.name;
this.warehouseCode = e.code;
this.orgCode = e.erpOrgCode;
setTimeout(() => {
this.focusInput = 'box';
}, 300);
@@ -534,7 +532,8 @@ export default {
remark: it.remark,
stockCode: this.warehouseCode,
BoxBillNo: this.xhNo,
old_SubStockCode: it.old_SubStockCode ? it.old_SubStockCode : this.subStockCode
old_SubStockCode: it.old_SubStockCode ? it.old_SubStockCode : this.subStockCode,
twoSerialNumbers:it.twoSerialNumbers ? it.twoSerialNumbers.filter(Boolean):[]
});
});
console.log('提交數據', formData);
@@ -543,6 +542,7 @@ export default {
if (this.requestStatus) {
return false;
}
this.requestStatus = true;
this.qrpdshow = false;
this.$api.post('/TakeStock/Save', formData).then((res) => {
@@ -715,6 +715,11 @@ export default {
this.dataList[findindx].itxlhList.push(res.data.serialNumber);
// 缓存当前扫描数据
this.xlhStrlist.push(res.data.serialNumber);
//缓存2件装序列号
if(res.data.isTwo==2) {
this.dataList[findindx].twoSerialNumbers.push(res.data.twoSerialNumber);
this.twoData.push(res.data.twoSerialNumber)
}
uni.showToast({
title: '获取成功',
icon: 'none',
@@ -753,7 +758,8 @@ export default {
old_SubStockCode: res.data.subStockCode,
pdNum: this.xlhOrggType == 'ggxh' ? 0 : this.xlhOrggType == 'xlh' ? 1 : 0,
serialNumbers: [],
itxlhList: []
itxlhList: [],
twoSerialNumbers:[],
});
if (this.xlhOrggType == 'xlh') {
this.xlhGgxNum = 1;
@@ -762,6 +768,7 @@ export default {
this.xlhStrlist.push(res.data.serialNumber);
//缓存2件装序列号
if(res.data.isTwo==2) {
this.dataList[this.dataList.length - 1].twoSerialNumbers.push(res.data.twoSerialNumber);
this.twoData.push(res.data.twoSerialNumber)
}
}
@@ -837,16 +844,8 @@ export default {
});
return;
}
//没有仓位就不添加明细数据
// if(!if()res.data.subStockCode) {
// return
// }if()
//明细数据
// if(!res.data.subStockCode) {
// retrun
// }
this.dataList = [];
this.dataList = [];
res.data.details.forEach((obj) => {
if (obj.qty > 0 && res.data.subStockCode) {
this.dataList.push({
@@ -857,7 +856,9 @@ export default {
subStockCode: res.data.subStockCode,
remark: '',
erpSubStockCode: null,
old_SubStockCode: res.data.subStockCode
old_SubStockCode: res.data.subStockCode,
twoSerialNumbers:res.data.twoSerialNumbers ? res.data.twoSerialNumbers: []
});
}
});

Binary file not shown.

View File

@@ -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;
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.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,10 +1012,12 @@ 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';

View File

@@ -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({

View File

@@ -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);

View File

@@ -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() {

View File

@@ -464,7 +464,6 @@ export default {
this.YiJiannum = 0;
this.YingJianum = 0;
}
console.log(n,'===========n===========')
//根据出库单号检索
this.pageNo = 1;
this.ckSelectlist = [];
@@ -701,7 +700,6 @@ export default {
},
// 一键清除出库单号
clearnFn(val) {
console.log('一键清除出库单号', val);
if (val == 'ckdhselect') {
// this.warehouseName = '';
// this.warehouseCode = '';
@@ -852,10 +850,12 @@ export default {
materialNumber: item.materialNumber,
boxId: item.boxId,
serialNumbers: [],
twoSerialNumbers:[],
qty: 0
};
}
mergedArray[key].serialNumbers.push(item.serialNumbers);
mergedArray[key].twoSerialNumbers.push(item.twoSerialNumbers);
mergedArray[key].qty += item.qty;
});
const result = Object.values(mergedArray);
@@ -864,9 +864,11 @@ export default {
} else {
thedetails = boxdetails;
}
// 过滤为0的数
// 过滤为0的数
formData.details = [];
formData.details = thedetails.filter((it) => {
//去掉空值
it.twoSerialNumbers = it?.twoSerialNumbers?.filter(Boolean)
return it.qty && it.qty > 0;
});
}
@@ -875,6 +877,7 @@ export default {
return false;
}
this.requestStatus = true;
this.$api.post('/OutStock/Save', formData).then((res) => {
if (res.status == 200) {
uni.showToast({
@@ -1112,8 +1115,6 @@ export default {
return;
}
let boxwlIds = res.data.details.filter((item) => item.qty > 0).map((item) => item.materialNumber);
console.log(boxwlIds,'=boxwlIds=')
console.log(this.dataList,'=this.dataList=')
let datawlds = this.dataList.map((it) => {
return it.materialNumber;
});
@@ -1371,6 +1372,7 @@ export default {
// 扫描序列号数据处理
setxlhdata(res) {
let thindx = this.dataList.findIndex((it) => it.materialNumber == res.data.materialNumber);
// 如果这个序列存在明细信息就缓存
if (!this.dataList[thindx].itxlhlist && this.dataList[thindx].itxlhlist.length == 0) {
this.dqYJnum = 0;
@@ -1382,7 +1384,8 @@ export default {
qty: 1,
boxId: this.isOldOps && this.isOldboxInfo.boxsubStock ? this.isOldboxInfo.boxId : res.data.boxId,
subStockCode: this.isOldOps && this.isOldboxInfo.boxsubStock ? this.isOldboxInfo.boxsubStock : res.data.subStockCode,
serialNumbers: res.data.serialNumber
serialNumbers: res.data.serialNumber,
twoSerialNumbers:res.data.twoSerialNumber
});
this.dataList[thindx].itxlhlist.push(this.xlhVal);
this.dataList[thindx].boxitNo = this.isOldOps && this.isOldboxInfo.boxsubStock ? this.isOldboxInfo.boxName : res.data.boxBillNo;
@@ -1653,7 +1656,6 @@ export default {
},
//根据出库单号获取对应的下拉数据
getCKselectlist(val) {
console.log('1232323')
// if (!val) return
clearTimeout(this.timer);
this.pagingSet = false;

View File

@@ -5,7 +5,7 @@
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<!-- /生产 -->
<text class="pagetitle">采购上架入库</text>
<text class="pagetitle">采购/生产上架入库</text>
</view>
<!-- 固定内容-->
<view class="sh_gdInfo">
@@ -231,6 +231,7 @@ export default {
qktkTitle: '确定清空已收货数量?',
qktkContent: '清空后页面数据将不保存',
fid: '', // 来源单号
instockType:null,
orgCode: '', // 组织编码
dqboxNO: '', //用来是否保存当前输入箱号的值
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
@@ -254,10 +255,10 @@ export default {
if (!n) {
this.cwselectList = [];
this.subStockCode = null;
this.orgCode = null;
// this.orgCode = null;
} else {
this.subStockCode = null;
this.orgCode = null;
// this.orgCode = null;
this.getcwList(n);
}
},
@@ -273,6 +274,7 @@ export default {
this.$refs.wselect1.inputData = '';
this.cwselectList = [];
this.daiboxstrList = [];
this.orgCode="";
this.krcwInfo = {
materialSubStocks: [],
materialNumber: '',
@@ -361,12 +363,11 @@ export default {
if (!val) return;
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.$api.get('/InStockTask/GetSourceOrder/' + val).then((res) => {
this.$api.get('/InStockTask/GetSourceOrder/' + val +"&").then((res) => {
if (res.status == 200) {
this.lyselectList = [];
this.lyselectList = res.data && res.data.length>0? res.data.filter(element => element.waitSlefQty > 0):[]
console.log(this.focusInput);
if (this.lyselectList && this.lyselectList.length == 1) {
this.lyOrderNo = this.lyselectList[0].sourceBillNo;
this.$refs.wselectlydd.filterList = res.data;
@@ -383,6 +384,7 @@ export default {
this.$refs.wselectlydd.optionsShow = false;
this.$refs.wselectlydd.isShow = false;
}
// console.log(this.instockType,'=this.instockType=')
}
});
}, 1000);
@@ -392,13 +394,18 @@ export default {
if (!this.lyOrderNo) {
return;
}
console.log(1111111111111,'=============')
// console.log(e,'===============>>>')
this.setItemdata(e);
},
// 选中的来源订单号相关物料
setItemdata(e) {
console.log(e,'==============e==============')
this.lyorderId = e.id;
this.detailsId = e.detailsId;
this.customerCode = e.customerCode;
this.instockType = e.instockType;
this.orgCode =e.orgCode;
// 仓库名称
this.warehouseName = e.stockName;
this.warehouseCode = e.stockCode;
@@ -461,6 +468,7 @@ export default {
orgCode: this.orgCode,
stockCode: this.warehouseCode,
subStockCode: this.subStockCode,
instockType:this.instockType,
details: thedetails
})
.then((res) => {
@@ -565,7 +573,8 @@ export default {
this.$api
.get('/SysConfig/GetSubUcStockByName', {
name: val,
stockCode: this.warehouseCode
stockCode: this.warehouseCode,
orgCode:this.orgCode,
})
.then((res) => {
if (res.status == 200) {
@@ -581,8 +590,10 @@ export default {
},
// 仓位下拉选择
cwchange(e, type) {
console.log(e,'=====================>')
console.log(this.instockType,'===============>')
this.subStockCode = e.code;
this.orgCode = e.erpOrgCode;
// this.orgCode = e.erpOrgCode;
},
// 輸入失去焦點
inputblur(val, type) {

View File

@@ -14,7 +14,7 @@
</view>
<view class="item" @click="otherPage(2)">
<image src="../../static/img/rk_fcgsjico.png" class="rkico"></image>
<text class="t1">采购上架</text>
<text class="t1">采购/生产上架</text>
</view>
<view class="item" @click="otherPage(3)">
<image src="../../static/img/rk_cgsjico.png" class="rkico"></image>

View File

@@ -419,17 +419,17 @@ export default {
}
let dataForm = {};
let details = [];
console.log(this.dataList);
console.log(this.dataList,);
details = this.dataList.map((it) => {
return {
qty: it.qty,
supplierId: it.supplierId,
materialNumber: it.materialNumber,
serialNumbers: it.xlhList, //序列号集
erpDetailId: it.erpDetailId
erpDetailId: it.erpDetailId,
twoSerialNumbers:it.twoSerialNumbers ? it.twoSerialNumbers.filter(Boolean):[]
};
});
console.log('提交数据1', this.dataList, dataForm);
if (this.sjfsType == '按产品上架') {
this.boxs[0].details = details;
}
@@ -441,7 +441,7 @@ export default {
subStockCode: this.subStockCode,
boxs: this.boxs
};
console.log('dataForm', dataForm);
console.log('提交数据===dataForm===', dataForm);
// 节流
if (this.requestStatus) {
return false;
@@ -480,6 +480,7 @@ export default {
this.dataList.forEach((it) => {
it.qty = 0;
it.xlhList = [];
it.twoSerialNumbers=[]
});
this.qktkshow = false;
this.focusInput = '';
@@ -783,10 +784,6 @@ export default {
}
this.focusInput = '';
console.log('序列號', this.xlhVal);
this.$api
.get('/SysConfig/GetMaterial', {
serialNumber: this.xlhVal,
@@ -844,13 +841,16 @@ export default {
});
return;
}
this.dataList = this.$util.scanAndAllocate(this.dataList, res.data.materialNumber, res.data.serialNumber);
//18LC-628W3Y CTN00094835
console.log('走到了这里')
this.dataList = this.$util.scanAndAllocate(this.dataList, res.data.materialNumber, res.data.serialNumber,res.data.twoSerialNumber);
// 缓存序列号
this.xlhstrList.push(res.data.serialNumber);
//缓存2件装序列号
if(res.data.isTwo==2) {
this.twoData.push(res.data.twoSerialNumber)
}
//保留当前输入的数据
this.dqboxXlh = res.data.serialNumber;
this.xlhVal = res.data.serialNumber;
@@ -874,6 +874,7 @@ export default {
list.forEach((it) => {
it.qty = 0;
it.xlhList = [];
it.twoSerialNumbers=[]
});
}
console.log('根据序列号的时候明细数据结构', list);
@@ -895,8 +896,8 @@ export default {
let objArray = [];
objArray = list;
let newObjArray = objArray.map((obj) => {
obj.zQty = JSON.parse(JSON.stringify(obj.qty)); // 修改 name 属性,这里是在姓名后加上 ' Smith'
obj.qty = 0; // 添加 age 属性,这里设定年龄为 30
obj.zQty = JSON.parse(JSON.stringify(obj.qty));
obj.qty = 0;
return obj;
});
return objArray;
@@ -919,15 +920,6 @@ export default {
this.heights.body = this.heights.body - 36;
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts');
}, 200);
// if(this.cwNum && this.cwselectList.length && !this.subStockCode){
// this.cwselectList.forEach((item)=>{
// if(item.name === this.cwNum) {
// this.subStockCode = item.code
// console.log(this.subStockCode,'=走到这里来了=')
// }
// })
// }
this.$forceUpdate();
},
// 获取仓位下拉数据
@@ -942,14 +934,6 @@ export default {
.then((res) => {
if (res.status == 200) {
this.cwselectList = res.data;
//&& this.cwselectList.length == 1
// if (this.cwselectList && this.cwselectList.length == 1) {
// this.cwNum = this.cwselectList[0].name;
// this.cwchange(this.cwselectList[0]);
// this.$refs.wselect1.optionsShow = false;
// this.$refs.wselect1.isShow = false;
// }
}
});
},

View File

@@ -3,7 +3,10 @@
<view class="shpage">
<!-- 标题栏 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<image
src="../../static/img/n_baiback.png"
class="blacBackico"
></image>
<text class="pagetitle">收货</text>
</view>
<!-- 固定内容-->
@@ -11,84 +14,153 @@
<view class="item itembg2">
<view class="it">
<text class="t1">仓库: </text>
<text class="t2">{{warehouseName}}</text>
<text class="t2">{{ warehouseName }}</text>
</view>
</view>
<view class="item" :class="{'itembg2':xhNo || boxstrList.length>0 }"
:style="{'pointer-events':xhNo ||boxstrList.length>0?'none':''}">
<view class="it itsp" >
<text class="t1"><text class="redtag">*</text>采购订单号: </text>
<!-- <view class="t1" style="display: flex;">
<view
class="item"
:class="{ itembg2: xhNo || boxstrList.length > 0 }"
:style="{
'pointer-events':
xhNo || boxstrList.length > 0 ? 'none' : '',
}"
>
<view class="it itsp">
<!-- <text class="t1"><text class="redtag">*</text>采购订单号: </text> -->
<view class="t1" style="display: flex">
<text class="redtag">*</text>
<uni-data-select
style="font-size:12px"
style="font-size: 12px; width: 200rpx !important"
v-model="selectValue"
:localdata="options"
@change="hanldeSelectChange"
:clear="false"
></uni-data-select>
</view> -->
</view>
<w-select class="wwselectit" v-model.trim='cgOrderVal' defaultValue="请输入订单号搜索" :list='cgselectList'
valueName='sourceBillNo' keyName="sourceBillNo" @change='cgchange' :filterable='filterable'
optionType="order" @onBottomPage="onBottomPage" :pagingSet='false' :focus="focusInput=='cgdd'"
@focus="inputfocus($event,'cgdd')" :showClose='true' ref="wselectcgdd">
<w-select
class="wwselectit"
v-model.trim="cgOrderVal"
defaultValue="请输入订单号搜索"
:list="list"
valueName="sourceBillNo"
keyName="sourceBillNo"
@change="cgchange"
:filterable="filterable"
optionType="order"
@onBottomPage="onBottomPage"
:pagingSet="false"
:focus="focusInput == 'cgdd'"
@focus="inputfocus($event, 'cgdd')"
:showClose="true"
ref="wselectcgdd"
>
</w-select>
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('cgdd')"></image>
<image
src="../../static/img/smico.png"
class="searchico"
@click="scanImg('cgdd')"
></image>
</view>
</view>
<view class="item" :class="{'itembg2':!cgOrderVal}" :style="{'pointer-events':!cgOrderVal?'none':''}">
<view
class="item"
:class="{ itembg2: !cgOrderVal }"
:style="{ 'pointer-events': !cgOrderVal ? 'none' : '' }"
>
<view class="it itsp">
<text class="t1"><text class="redtag">*</text>箱号: </text>
<input v-model.trim="xhNo" class="inpt1" type="text" @focus="inputfocus($event,'box')"
@blur="inputblur($event,'')" @confirm="inputConfirm($event,'box')"
:focus="focusInput == 'box'" />
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('box')"></image>
<input
v-model.trim="xhNo"
class="inpt1"
type="text"
@focus="inputfocus($event, 'box')"
@blur="inputblur($event, '')"
@confirm="inputConfirm($event, 'box')"
:focus="focusInput == 'box'"
/>
<image
src="../../static/img/smico.png"
class="searchico"
@click="scanImg('box')"
></image>
</view>
</view>
<view class="item itembg2">
<view class="it">
<text class="t1">数量: </text>
<text class="t1 tpleft">{{boxNum}} </text>
<text class="t1 tpleft">{{ boxNum }} </text>
</view>
</view>
<view class="item item2">
<view class="it2">
<text class="t1">{{cgOrderWLnum}}</text>
<text class="t1">{{ cgOrderWLnum }}</text>
<text class="t2">订单数量</text>
</view>
<view class="it2">
<text class="t1">{{krkNum}}</text>
<text class="t1">{{ krkNum }}</text>
<text class="t2">可入库数</text>
</view>
<view class="it2">
<text class="t1 rednum">{{yshNum}}</text>
<text class="t1 rednum">{{ yshNum }}</text>
<text class="t2">已收货数</text>
</view>
<view class="it2" @click="xhmodelOpen">
<text class="t1 rednum">{{boxstrList.length}}</text>
<text class="t1 rednum">{{ boxstrList.length }}</text>
<text class="t2">已收箱数</text>
</view>
</view>
</view>
<!-- 列表内容-->
<view class="shlb" :style="{'margin-top':heights.top+'px','height':heights.body+'px'}">
<z-paging ref="paging" v-model="dataList" @query="queryList" class="xlfeview"
loading-more-default-text="上拉加载更多" :refresher-enabled="false">
<view class="item" v-for="(i,index) in dataList" :key="index">
<view
class="shlb"
:style="{
'margin-top': heights.top + 'px',
height: heights.body + 'px',
}"
>
<z-paging
ref="paging"
v-model="dataList"
@query="queryList"
class="xlfeview"
loading-more-default-text="上拉加载更多"
:refresher-enabled="false"
>
<view class="item" v-for="(i, index) in dataList" :key="index">
<view class="it">
<text class="txt">{{i.specifications}}</text>
<text class="txt">{{i.materialNumber}}</text>
<text class="txt">明细备注:{{i.remark}}</text>
<text class="txt">{{ i.specifications }}</text>
<text class="txt">{{ i.materialNumber }}</text>
<text class="txt">明细备注:{{ i.remark }}</text>
</view>
</view>
<zero-loading v-if="listloading" type="circle" style="top: 60%;"></zero-loading>
<zero-loading
v-if="listloading"
type="circle"
style="top: 60%"
></zero-loading>
</z-paging>
</view>
<!-- 已上架箱号-->
<u-modal :show="xhlistshow" title="已收箱号" @confirm="xhlistshow =false">
<view style="display: flex;flex-direction: column;overflow-y: auto;max-height: 60vh;overflow-y: auto;">
<view v-for="(item,index) in boxstrList" style="margin-bottom: 5px;">{{item}}</view>
<u-modal
:show="xhlistshow"
title="已收箱号"
@confirm="xhlistshow = false"
>
<view
style="
display: flex;
flex-direction: column;
overflow-y: auto;
max-height: 60vh;
overflow-y: auto;
"
>
<view
v-for="(item, index) in boxstrList"
style="margin-bottom: 5px"
>{{ item }}</view
>
</view>
</u-modal>
<!-- 底部按钮固定-->
@@ -97,46 +169,60 @@
<view class="bt bt2" @click="completefn()">完成/下一单</view>
</view>
<!--清空二次确认弹框-->
<u-modal :show="qktkshow" :title="qktkTitle" :content='qktkContent' @confirm="qktkconfirm"
:showCancelButton='true' @cancel="qktkshow = false"></u-modal>
<u-modal
:show="qktkshow"
:title="qktkTitle"
:content="qktkContent"
@confirm="qktkconfirm"
:showCancelButton="true"
@cancel="qktkshow = false"
></u-modal>
</view>
</template>
<script>
export default {
export default {
data() {
return {
heights: {
top: 0,
body: 0,
},
options:[
{value:1,text:'采购订单号'},
{value:2,text:'生产单号'},
options: [
{
value: 1,
text: '采购单号',
},
{
value: 6,
text: '生产单号',
},
],
selectValue:1,//单号选择
selectValue: 1, //单号选择
listloading: false,
xhlistshow: false, // 箱号查看弹框
focusInput: 'cgdd', // 自动聚焦
mxid: '', //采购订单下拉选中明细id
focusTag: "", // 判斷聚焦
focusTag: '', // 判斷聚焦
warehouseName: '', //仓库名称
warehouseCode: '', // 仓库编码
xhNo: "", //箱号
xhNo: '', //箱号
boxstrList: [], // 缓存的箱号信息(多个)
filterable: true, // 采购订单是否开启模糊下拉搜索
boxNum: 0, //数量(扫码箱子的数量)
boxs: [], // 已经扫描的箱子和对应id集合
cgOrderWLnum: 0, // 订单数量(采购订单物料数量)
cgOrderVal: "", //输入的采购订单号
cgOrderVal: '', //输入的采购订单号
cgOrderValClone: '', //采购订单号克隆
cgselectList: [], //采购下拉数据
krkNum: 0, //可入库数量
yshNum: 0, // 已收货数量
dataList: [], // 列表数据
qktkshow: false, //清空二次确认弹框
qktkTitle: '确定清空已收货数量?',
qktkContent: "清空后页面数据将不保存",
qktkContent: '清空后页面数据将不保存',
timer: null,
isQKMS: false,
availableQty: 0, // 第一次订单的可入库数量
erpDetailId: null, // erp明细id
dqboxNO: '', //用来是否保存当前输入箱号的值
@@ -145,316 +231,428 @@
materialNumber: null, //选中采购单的时候物料编码
scanTracker: {
lastScanTime: 0,
lastScanCode: null
lastScanCode: null,
}, // 源头处理扫码段时间内重复扫
};
},
computed: {
list() {
let ls = [];
if (this.cgselectList.length) {
ls = this.cgselectList.filter((item) => {
return item.availableQty > 0;
});
return ls;
} else {
return [];
}
},
},
watch: {
boxNo(n) {
if (!n) {
this.dqboxNO = ''
this.dqboxNO = '';
}
},
// 采购订单号实时输入监听
cgOrderVal(n, o) {
if (!n) {
this.qktkconfirm()
this.dataList = []
this.cgOrderWLnum = 0
this.krkNum = 0
this.yshNum = 0
this.yshNum = 0
this.dqboxNO = ''
this.cgselectList = []
this.warehouseName = ''
this.warehouseCode = ''
this.qktkconfirm();
this.dataList = [];
this.cgOrderWLnum = 0;
this.krkNum = 0;
this.yshNum = 0;
this.yshNum = 0;
this.dqboxNO = '';
this.cgselectList = [];
this.warehouseName = '';
this.warehouseCode = '';
} else {
this.getcgOrderSelectData(n)
}
this.getcgOrderSelectData(n);
}
},
//监听订单号数据过滤为0
// cgselectList(n) {
// if (!n.length) {
// this.cgOrderVal = ""
// this.$refs.wselectcgdd.inputData = ""
// return
// }
// },
},
onReady() {
setTimeout(() => {
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts')
console.log("设备信息", this.heights)
}, 500)
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts');
console.log('设备信息', this.heights);
}, 500);
},
mounted() {
//获取广播扫码监听
this.$broadcastScan.init(this.getScancode)
this.$broadcastScan.init(this.getScancode);
this.$broadcastScan.start();
this.stopScanCode()
this.startScanCode()
this.stopScanCode();
this.startScanCode();
},
onHide() {
this.$broadcastScan.stop();
this.stopScanCode()
this.stopScanCode();
},
onShow() {
this.$broadcastScan.start();
this.startScanCode()
this.startScanCode();
},
onBackPress(e) {
this.$util.appgoBack(e,'warehousIndex')
return true
this.$util.appgoBack(e, 'warehousIndex');
return true;
},
methods: {
// 开启广播
startScanCode(){
startScanCode() {
uni.$on('xwscan', (res) => {
const now = Date.now();
const timeSinceLastScan = now - this.scanTracker.lastScanTime;
// 如果扫描的箱码和上次相同并且时间间隔小于500ms则不作处理
if ((res.code === this.scanTracker.lastScanCode) && (timeSinceLastScan < 4000)) {
if (
res.code === this.scanTracker.lastScanCode &&
timeSinceLastScan < 4000
) {
return;
} else{
} else {
// 更新扫描跟踪信息
this.scanTracker.lastScanTime = now;
this.scanTracker.lastScanCode = res.code;
this.getScancode(res.code)
this.getScancode(res.code);
}
})
});
},
// 关闭广播
stopScanCode(){
uni.$off('xwscan')
stopScanCode() {
uni.$off('xwscan');
},
// 打开查看箱号
xhmodelOpen() {
if (this.boxstrList.length > 0) {
this.xhlistshow = true
this.xhlistshow = true;
}
},
// 清空二次确认
qktkconfirm() {
this.xhNo = ""
this.boxNum = 0
this.krkNum = this.$util.sumObjectArrayValues(this.dataList, 'availableQty')
this.qktkshow = false
this.yshNum = 0
this.boxs = []
this.boxstrList = []
this.xhNo = '';
this.boxNum = 0;
this.krkNum = this.$util.sumObjectArrayValues(
this.dataList,
'availableQty'
);
this.qktkshow = false;
this.yshNum = 0;
this.boxs = [];
this.boxstrList = [];
},
// //select-change
// hanldeSelectChange() {
// this.cgOrderVal = ""
// this.$refs.wselectcgdd.inputData=""
// this.focusInput= ""
// setTimeout(()=>{
// this.focusInput='cgdd'
// },200)
// },
//select-change
hanldeSelectChange() {
this.cgOrderVal = '';
this.cgselectList = [];
this.$nextTick(() => {
this.$refs.wselectcgdd.inputData = '';
this.$refs.wselectcgdd.filterList = [];
});
this.focusInput = '';
setTimeout(() => {
this.focusInput = 'cgdd';
}, 200);
console.log(this.selectValue, '==========selectValue=========');
},
// this.focusInput = ""
// setTimeout(() => {
// this.focusInput = 'cgdd'
// this.cgOrderVal = this.cgOrderValClone
// this.$refs.wselectcgdd.inputData=this.cgOrderValClone
// }, 200)
// 获取采购订单下拉数据
getcgOrderSelectData(val) {
if (!val) return
clearTimeout(this.timer)
if (!val) return;
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.$api.get('/InStockTask/GetSourceOrder/' + val).then(res => {
this.$api
.get(
'/InStockTask/GetSourceOrder/' +
`${val + '&' + this.selectValue}`
)
.then((res) => {
if (res.status == 200) {
this.cgselectList = []
this.cgselectList = res.data
console.log(this.focusInput)
if (this.cgselectList && this.cgselectList.length == 1) {
this.cgOrderVal = this.cgselectList[0].sourceBillNo
this.$refs.wselectcgdd.filterList = res.data
this.$refs.wselectcgdd.inputData = this.cgselectList[0].sourceBillNo
this.setItemdata(this.cgselectList[0])
this.cgchange(this.cgselectList[0])
this.$refs.wselectcgdd.optionsShow = false
this.$refs.wselectcgdd.isShow = false
this.cgselectList = [];
this.cgselectList = res.data;
//如果所有的数量为0就不需要显示了
let isAvailableQty = res?.data?.some((item) => {
return item?.availableQty;
});
//this.isQKMS是用戶點擊了完成了一下的標記(并且只有生产订单才这样操作)
if (
this.isQKMS &&
this.selectValue === 6 &&
(!isAvailableQty || !res?.data?.length)
) {
this.qktkconfirm();
this.cgOrderVal = '';
this.dataList = [];
this.cgOrderWLnum = 0;
this.krkNum = 0;
this.yshNum = 0;
this.yshNum = 0;
this.dqboxNO = '';
this.cgselectList = [];
this.warehouseName = '';
this.warehouseCode = '';
this.focusInput = '';
this.$nextTick(() => {
setTimeout(() => {
this.$refs.wselectcgdd.inputData = '';
this.$refs.wselectcgdd.filterList = [];
this.focusInput = 'cgdd';
this.$refs.wselectcgdd.optionsShow = true;
this.$refs.wselectcgdd.isShow = true;
}, 200);
});
}
// }
// console.log(this.cgselectList,'=this.cgselectList=')
if (
this.cgselectList &&
this.cgselectList.length == 1
) {
this.cgOrderVal =
this.cgselectList[0].sourceBillNo;
this.$refs.wselectcgdd.filterList = res.data;
this.$refs.wselectcgdd.inputData =
this.cgselectList[0].sourceBillNo;
this.setItemdata(this.cgselectList[0]);
this.cgchange(this.cgselectList[0]);
this.$refs.wselectcgdd.optionsShow = false;
this.$refs.wselectcgdd.isShow = false;
} else {
this.$refs.wselectcgdd.optionsShow = true
this.$refs.wselectcgdd.isShow = true
console.log('走到了這裏!');
this.$refs.wselectcgdd.optionsShow = true;
this.$refs.wselectcgdd.isShow = true;
}
if(this.focusInput !== 'cgdd'){
this.$refs.wselectcgdd.optionsShow = false
this.$refs.wselectcgdd.isShow = false
if (this.focusInput !== 'cgdd') {
this.$refs.wselectcgdd.optionsShow = false;
this.$refs.wselectcgdd.isShow = false;
}
this.isQKMS = false;
}
})
}, 1000)
.catch(() => {
this.isQKMS = false;
});
}, 1000);
},
// 采购订单下拉框分页加载
onBottomPage(val) {},
// 选中的采购订单号相关物料 如果数据校验失败就取明细带来的信息,不是就去明细信息的
setItemdata(e) {
this.availableQty = e.availableQty
this.cgOrderWLnum = this.$util.sumObjectArrayValues(this.dataList, 'qty')
this.mxid = e.detailsId
this.fid = e.id
this.materialNumber = e.materialNumber
this.availableQty = e.availableQty;
this.cgOrderWLnum = this.$util.sumObjectArrayValues(
this.dataList,
'qty'
);
this.mxid = e.detailsId;
this.fid = e.id;
this.materialNumber = e.materialNumber;
// 仓库名称
this.warehouseName = e.stockName
this.warehouseCode = e.stockCode
this.erpDetailId = e.erpDetailId
this.krkNum = e.availableQty
this.focusInput = 'box'
this.warehouseName = e.stockName;
this.warehouseCode = e.stockCode;
this.erpDetailId = e.erpDetailId;
this.krkNum = e.availableQty;
this.focusInput = 'box';
},
// 采购订单下拉选中
cgchange(e) {
if (!this.cgOrderVal) {
return
return;
}
this.dataList = [e]
console.log(e, '=============>');
this.dataList = [e];
// 以前已收货数量
this.setItemdata(e)
this.setItemdata(e);
},
// 扫描框数据重置,光标聚焦
setSMinputbox() {
this.focusInput = ''
this.focusInput = '';
setTimeout(() => {
this.xhNo = ''
this.focusInput = 'box'
this.boxNum = ''
}, 200)
this.xhNo = '';
this.focusInput = 'box';
this.boxNum = '';
}, 200);
},
// 根据箱号查相关信息
getboxinfo() {
if (this.timer) {
clearTimeout(this.timer)
clearTimeout(this.timer);
}
this.timer = setTimeout(() => {
if (!this.xhNo) {
this.setSMinputbox()
this.setSMinputbox();
uni.showToast({
title: '请扫描需要上架的箱号',
icon: 'none',
duration: 1500
})
return
duration: 1500,
});
return;
}
if (this.boxstrList.includes(this.xhNo)) {
this.setSMinputbox()
this.setSMinputbox();
uni.showToast({
title: '该箱号已扫描,请重新输入',
icon: 'none',
duration: 1500
})
return
duration: 1500,
});
return;
}
this.focusInput = ''
this.focusInput = '';
//采购订单物料明细和箱物料明细-对比接口,
this.$api.post('/InStockTask/Contrast', {
this.$api
.post('/InStockTask/Contrast', {
boxBillNos: [this.xhNo.trim()],
stockCode: this.warehouseCode,
materialNumber:this.materialNumber,
materialNumber: this.materialNumber,
taskId: this.fid,
isPurchase:true,
}).then(res => {
isPurchase: true,
})
.then((res) => {
if (res.status == 200) {
if(res.data.boxs[0].details.length>1){
this.dqboxNO = ''
this.xhNo = ''
if (res.data.boxs[0].details.length > 1) {
this.dqboxNO = '';
this.xhNo = '';
uni.showToast({
title: '箱内产品和采购单不一致!',
icon: 'none',
duration: 1000
})
return
duration: 1000,
});
return;
}
// 需要带出相关已收货数和已收箱数(这个数量应该是箱子对应单据选择物料的数量)
// let boxbymaterialQtyobj = res.data.boxs[0].details.find(item => item.materialNumber === this.materialNumber)
// console.log('物料数量',boxbymaterialQtyobj.qty)
let totalCount = res.data.boxs[0].totalCount
let totalCount = res.data.boxs[0].totalCount;
// 可入库数量=订单数量-(当前箱子的数量+累计)-以前收货数量-已交
// let dqkrkNUM = this.cgOrderWLnum - (this.yshNum + totalCount) - this.$util
// .sumObjectArrayValues(this.dataList, 'receiveQty') - this.$util.sumObjectArrayValues(
// this.dataList, 'deliveredQty')
// 12.5 界面可入库数量=接口第一次返回的可入库数量-已收货数量
let dqkrkNum = this.$util.sumObjectArrayValues(this.dataList, 'availableQty')
console.log('可入', parseInt(this.yshNum + totalCount), this.krkNum, )
let dqkrkNum = this.$util.sumObjectArrayValues(
this.dataList,
'availableQty'
);
console.log(
'可入',
parseInt(this.yshNum + totalCount),
this.krkNum
);
if (res.data.boxs.length > 0) {
if (parseInt(this.yshNum + totalCount) > dqkrkNum) {
this.setSMinputbox()
if (
parseInt(this.yshNum + totalCount) >
dqkrkNum
) {
this.setSMinputbox();
uni.showToast({
title: '箱内产品数量超过可入库数量',
icon: 'none',
duration: 1000
})
return
duration: 1000,
});
return;
}
// 当前箱号里面物料的数量
this.boxNum = totalCount
this.boxNum = totalCount;
// 已收货数量 累加
this.krkNum = dqkrkNum - (this.yshNum + totalCount)
this.yshNum = this.yshNum + totalCount
this.krkNum =
dqkrkNum - (this.yshNum + totalCount);
this.yshNum = this.yshNum + totalCount;
this.boxs.push({
id: 0,
erpDetailId: this.erpDetailId,
boxId: res.data.boxs[0].boxId,
boxBillNo: res.data.boxs[0].boxBillNo
})
boxBillNo: res.data.boxs[0].boxBillNo,
});
// 如果查询的箱号正常返回数据,就缓存改箱号信息
this.boxstrList.push(res.data.boxs[0].boxBillNo)
this.boxstrList.push(
res.data.boxs[0].boxBillNo
);
//保留当前输入的数据
this.dqboxNO = res.data.boxs[0].boxBillNo
this.xhNo = res.data.boxs[0].boxBillNo
this.dqboxNO = res.data.boxs[0].boxBillNo;
this.xhNo = res.data.boxs[0].boxBillNo;
uni.showToast({
title: '获取成功',
icon: 'none',
duration: 1500
})
duration: 1500,
});
}
} else {
this.dqboxNO = ''
this.xhNo = ''
this.dqboxNO = '';
this.xhNo = '';
}
this.focusInput = 'box'
})
}, 1000)
this.focusInput = 'box';
});
}, 1000);
},
// 输入确认
inputConfirm(val, type) {
if (val) {
this.setSMstr(val.target.value)
this.setSMstr(val.target.value);
if (this.focusTag == 'box') {
// this.xhNo = val.target.value
this.getboxinfo()
this.getboxinfo();
//this.isQKMS = false
}
}
},
// 区分不同的扫描数据、输入数据做处理显示
setSMstr(str) {
let lth = str.length - this.dqboxNO.length
let lth = str.length - this.dqboxNO.length;
if (lth > 1) {
// 扫描的值
this.xhNo = str.substring(this.dqboxNO.length)
this.xhNo = str.substring(this.dqboxNO.length);
} else {
this.dqboxNO = str
this.xhNo = str
this.dqboxNO = str;
this.xhNo = str;
}
},
// 普通安卓设备碘酒扫描图标扫描
scanImg(type) {
if (this.APPdevice == "normalAnroid") {
this.$util.doScanQrCode().then(res => {
this.focusInput = type
this.focusTag = type
this.getScancode(res.result)
})
if (this.APPdevice == 'normalAnroid') {
this.$util.doScanQrCode().then((res) => {
this.focusInput = type;
this.focusTag = type;
this.getScancode(res.result);
});
}
},
// 获取扫描的值
getScancode(code) {
// 有些PDA会自带换行符trim函数处理下、
if (this.focusTag == 'box') {
this.xhNo = ''
this.xhNo = code.trim()
this.getboxinfo()
this.xhNo = '';
this.xhNo = code.trim();
this.getboxinfo();
}
if (this.focusTag == 'cgdd') {
this.cgOrderVal = ''
this.cgOrderVal = code.trim()
this.$refs.wselectcgdd.inputData = code.trim()
this.getcgOrderSelectData(this.cgOrderVal)
this.cgOrderVal = '';
this.cgOrderVal = code.trim();
this.$refs.wselectcgdd.inputData = code.trim();
this.getcgOrderSelectData(this.cgOrderVal);
}
},
// 輸入失去焦點
inputblur(val, type) {},
// 输入聚焦
inputfocus(val, type) {
this.focusTag = type
this.focusTag = type;
},
// 完成/下一单
completefn() {
@@ -462,66 +660,104 @@
uni.showToast({
title: '请先输入必填值',
icon: 'none',
duration: 1500
})
return
duration: 1500,
});
return;
}
this.cgOrderValClone = this.cgOrderVal;
// 节流
if (this.requestStatus) {
return false;
}
this.requestStatus = true;
this.$api.post('/InStockTask/Receive', {
this.$api
.post('/InStockTask/Receive', {
id: this.fid,
boxs: this.boxs,
details: [{
details: [
{
id: this.mxid, //明细id
materialNumber: this.materialNumber,
receiveQty: this.yshNum,
erpDetailId: this.erpDetailId
}]
}).then(res => {
erpDetailId: this.erpDetailId,
},
],
})
.then((res) => {
if (res.status == 200) {
uni.showToast({
title: '成功',
icon: 'none',
duration: 1500
})
duration: 1500,
});
this.qktkconfirm();
this.dataList = [];
this.cgOrderWLnum = 0;
this.krkNum = 0;
this.yshNum = 0;
this.dqboxNO = '';
// this.cgselectList = []
this.warehouseName = '';
this.warehouseCode = '';
this.cgOrderVal = '';
this.$nextTick(() => {
this.$refs.wselectcgdd.inputData = '';
this.$refs.wselectcgdd.filterList = [];
});
this.focusInput = '';
setTimeout(() => {
uni.navigateTo({
url: '/pages/warehous/takeDelivery'
})
this.focusInput = 'cgdd';
if (this.selectValue === 6) {
this.cgOrderVal = this.cgOrderValClone;
this.$refs.wselectcgdd.inputData =
this.cgOrderValClone;
}
}, 200);
this.isQKMS = true;
// setTimeout(() => {
// uni.navigateTo({
// url: '/pages/warehous/takeDelivery'
// })
// }, 200);
// this.$router.go(0)
}
})
.catch(() => {
this.isQKMS = false;
});
setTimeout(() => {
this.requestStatus = false;
}, 1500);
},
goback() {
uni.navigateTo({
url: "/pages/warehous/index"
})
url: '/pages/warehous/index',
});
},
// 列表上拉加载更多
queryList(pageNo, pageSize) {
// console.log('上拉加载', pageNo, pageSize, this.dataList.length)
// this.$refs.paging.complete(this.dataList)
}
}
}
},
},
};
</script>
<style lang="scss">
@import "@/static/public.scss";
::v-deep .uni-select {
border:none !important;
height:24px;
<style lang="scss" scoped>
@import '@/static/public.scss';
::v-deep .uni-select {
border: none !important;
height: 24px;
width: 175rpx;
padding-right: 0;
padding-left: 3rpx;
text-align: center;
margin-left: -7rpx;
}
}
// ::v-deep uni-select__selector-item {
// width: 200rpx !important;
// }
</style>

View File

@@ -1,5 +1,5 @@
const BaseApi = 'https://api.wms.test.f2b211.com/api' //测试
//const BaseApi = 'https://wmsapi.f2b211.com/api' // 正式
//const BaseApi = 'https://api.wms.test.f2b211.com/api' //测试
const BaseApi = 'https://wmsapi.f2b211.com/api' // 正式
export {
BaseApi
}

View File

@@ -215,10 +215,14 @@ function subtractQty(mxArray, boxArray) {
return result;
}
//按照产品分配序列号
function scanAndAllocate(arr, materialNumber, serialNumber) {
function scanAndAllocate(arr, materialNumber, serialNumber,twoSerialNumber) {
console.log(twoSerialNumber,'=twoSerialNumber=')
// 遍历数组,按顺序分配序列号
for (const item of arr) {
if (item.materialNumber === materialNumber) {
if(twoSerialNumber) {
item.twoSerialNumbers.push(twoSerialNumber)
}
if (item.xlhList.length == 0) {
item.xlhList.push(serialNumber)
item.qty = item.xlhList.length
@@ -233,6 +237,7 @@ function scanAndAllocate(arr, materialNumber, serialNumber) {
break
}
}
}
}
return arr

View File

@@ -1,3 +1,7 @@
## 1.0.102025-04-14
- 修复 清除按钮不展示问题
## 1.0.92025-03-26
- 优化 默认背景为白色与整体组件保持风格统一
## 1.0.82024-03-28
- 修复 在vue2下:style动态绑定导致编译失败的bug
## 1.0.72024-01-20

View File

@@ -6,10 +6,10 @@
<view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{textShow}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<view v-if="current && clear && !disabled" @click.stop="clearVal">
<view key="clear-button" v-if="current && clear && !disabled" @click.stop="clearVal">
<uni-icons type="clear" color="#c0c4cc" size="24" />
</view>
<view v-else>
<view key="arrow-button" v-else>
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
</view>
@@ -143,9 +143,6 @@
textShow() {
// 长文本显示
let text = this.current;
if (text.length > 10) {
return text.slice(0, 25) + '...';
}
return text;
},
getOffsetByPlacement() {
@@ -244,6 +241,7 @@
clearVal() {
this.emit('')
this.current = ''
if (this.collection) {
this.removeCache()
}
@@ -352,6 +350,7 @@
}
.uni-stat-box {
background-color: #fff;
width: 100%;
flex: 1;
}
@@ -405,6 +404,7 @@
.uni-select__input-box {
height: 35px;
width: 0px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
@@ -433,6 +433,9 @@
position: absolute;
left: 0;
width: 100%;
min-width: 200rpx;
display: flex;
flex-wrap: nowrap;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;

View File

@@ -1,7 +1,7 @@
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
"version": "1.0.8",
"version": "1.0.10",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
@@ -48,8 +48,10 @@
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "n"
"app-vue": "y",
"app-nvue": "n",
"app-harmony": "u",
"app-uvue": "u"
},
"H5-mobile": {
"Safari": "y",