Commit 6c9dbfee authored by xiangzj's avatar xiangzj

拣配

parent c1f4076a
...@@ -34,41 +34,7 @@ ...@@ -34,41 +34,7 @@
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="cardbox" :list="goodsList"> <ContentLoadingMore class="cardbox" :list="goodsList">
<view class="cardContent" v-for="(item, index) in goodsList"> <view class="cardContent" v-for="(item, index) in goodsList">
<scanningList :item='item' :idx="index" @deleGonds="deleGonds"/> <scanningList :item='item' :idx="index" @deleGonds="deleGonds" :list='list'/>
<!-- <view class="listItemTitle">
<view>
<view class="item">入库条码:{{ item.qrcode }}</view>
<view class="item">产品编号:{{ item.sapItemCode }}</view>
<view class="item">产品描述:{{ item.MAKTX }}</view>
<view class="item">入库数量:{{ item.quantity }}</view>
</view>
<u-button size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
<view class="listBottom">
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem">
<view class="items">尺寸:{{ item.standardSize }}</view>
<view class="items">数量:{{ item.quantity }}</view>
<view class="items">生产日期:{{ item.BLDAT }}</view>
</view>
</view>
</view> -->
</view> </view>
</ContentLoadingMore> </ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
...@@ -118,6 +84,7 @@ export default { ...@@ -118,6 +84,7 @@ export default {
LGORT: '', LGORT: '',
type: 'select', type: 'select',
border: true, border: true,
list:[]
}; };
}, },
...@@ -249,7 +216,7 @@ export default { ...@@ -249,7 +216,7 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res && res.code == 200) { if (res && res.code == 200) {
if (this.goodsList.some((item) => item.workorderNo !== res.data.workorderNo)) { if (this.goodsList.some((item) => item.workorderNo !== res.data[0].workorderNo)) {
this.$u.toast('请扫描同一个工单'); this.$u.toast('请扫描同一个工单');
this.reset() this.reset()
return return
...@@ -259,7 +226,15 @@ export default { ...@@ -259,7 +226,15 @@ export default {
this.reset() this.reset()
return return
} }
this.goodsList.push({...res.data,NLPLA: this.nlpla}) res.data.forEach(ele => {
ele.NLPLA = this.nlpla
});
this.list = this.list.concat(res.data)
const result = res.data.filter((item, index, self) => {
return self.findIndex(t => t.qrcode === item.qrcode) === index;
});
this.goodsList = this.goodsList.concat(result)
this.reset() this.reset()
} else { } else {
this.reset() this.reset()
......
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
</view> </view>
</view> </view>
<view v-if="!show" class="bottomBox"> <view v-if="!show" class="bottomBox">
<view class="bottomItem"> <view class="bottomItem" v-for="(ele, idx) in list" :key="ele.qrcode+idx" v-if="ele.qrcode === item.qrcode">
<view class="items">尺码:{{ item.standardSize }}</view> <view class="items">尺码:{{ ele.standardSize }}</view>
<view class="items">数量:{{ item.quantity }}</view> <view class="items">数量:{{ ele.quantity }}</view>
<!-- <view class="items">生产日期:{{ item.BLDAT }}</view> -->
</view> </view>
</view> </view>
</view> </view>
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
plnr: ele, plnr: ele,
...this.form, ...this.form,
zxspe: this.form.long +'*'+ this.form.wide +'*'+ this.form.high, zxspe: this.form.long +'*'+ this.form.wide +'*'+ this.form.high,
zxvolum: (this.form.long * this.form.wide*this.form.high)/1000, zxvolum: (this.form.long * this.form.wide*this.form.high)/1000000,
ntgew: (this.form.brgew-0) - (this.form.zxntgew-0), ntgew: (this.form.brgew-0) - (this.form.zxntgew-0),
zcode: this.form.ZZXFS === 'PL' ? '' : this.blNum, zcode: this.form.ZZXFS === 'PL' ? '' : this.blNum,
datum: parseTime(new Date(),'{y}{m}{d}'), datum: parseTime(new Date(),'{y}{m}{d}'),
......
...@@ -129,31 +129,14 @@ export default { ...@@ -129,31 +129,14 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res && res.code - 200 === 0) { if (res && res.code - 200 === 0) {
// list 第二层显示 也是最后提交的数据(改动最小)
// goodsList 第一层显示
// 第二层显示的数据和第一层必须属于同一个物料 itemCode一样
this.list = res.rows this.list = res.rows
const data = res.rows const data = res.rows
// let num = 0
// data.forEach((ele,index) => {
// ele.sonItemCode = []
// ele.sonItemCode.push(...data)
// ele.applyNum1 = 0
// })
const result = data.filter((item, index, self) => { const result = data.filter((item, index, self) => {
return self.findIndex(t => t.sapItemCode === item.sapItemCode) === index; return self.findIndex(t => t.sapItemCode === item.sapItemCode) === index;
}); });
// let i=null,j=null
// for(i = 0; i < result.length; i++){
// for(j = 0; j < result[i].sonItemCode.length; j++){
// if(result[i].itemCode !== result[i].sonItemCode[j].itemCode){
// result[i].sonItemCode.splice(j,1)
// j--
// }else{
// result[i].applyNum1 += result[i].sonItemCode[j].applyNum
// }
// }
// }
// result.forEach((ele,index) => {
// ele.applyNum = []
// })
this.goodsList = [...result] this.goodsList = [...result]
} else { } else {
this.$u.toast(res.msg); this.$u.toast(res.msg);
...@@ -276,9 +259,17 @@ export default { ...@@ -276,9 +259,17 @@ export default {
this.$u.toast('没有匹配到对应物料'); this.$u.toast('没有匹配到对应物料');
return return
} }
// PACMG包装数量 applyNum申请数量 vista这一个工单分配了多少数量
// 总的来说逻辑是
// 1)
// 录入一个pl接口返回的数据 里面有包装数量 size 仓位
// 如果第一个applyNum申请数量满足不到 就把当前pl数据和第一个数据整合
// 再扫第二个 检查第一个是否满足,不满足 就先满足第一个,剩余的满足第二个
// 2)
// 如果满足第一个工单applyNum申请数量 就要往下满足 直到分配完。
for (let m = 0; m < this.list.length; m++) { for (let m = 0; m < this.list.length; m++) {
if(this.list[m].sapItemCode == res.MATNR){ if(this.list[m].sapItemCode == res.MATNR){
// 递归的方法 // 递归的方法 满足下一个
if(idx){ if(idx){
if(this.list[idx]){ if(this.list[idx]){
if(num > this.list[idx].applyNum){ if(num > this.list[idx].applyNum){
...@@ -291,9 +282,6 @@ export default { ...@@ -291,9 +282,6 @@ export default {
} }
return return
} }
// if(this.list[m].grantNum){
// 发过多少货
// }else{
// 没有填入数据的 // 没有填入数据的
if(!this.list[m].vista){ if(!this.list[m].vista){
// 上一位的数据是否满足 // 上一位的数据是否满足
...@@ -305,10 +293,12 @@ export default { ...@@ -305,10 +293,12 @@ export default {
return return
} }
// 只有一个 // 只有一个
if(count === 1){ // if(count === 1){
this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res}) // this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res})
}else{ // }else{
// 包装数量大于申请数量
if( res.PACMG > this.list[m].applyNum){ if( res.PACMG > this.list[m].applyNum){
// 最后一个工单处理
if(count === m){ if(count === m){
this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res}) this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res})
return return
...@@ -318,20 +308,23 @@ export default { ...@@ -318,20 +308,23 @@ export default {
this.factorial(res,plnr,m+1,res.PACMG-this.list[m].applyNum) this.factorial(res,plnr,m+1,res.PACMG-this.list[m].applyNum)
return; return;
}else{ }else{
// 包装数量小于等于申请数量
this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res}) this.$set(this.list,m,{...this.list[m],vista : res.PACMG,... res})
return return
} }
} // }
}else{ }else{
// 当前填入的数量小于申请数量 就把当前所有工单找出来 一个个的去检查是否满足
if(this.list[m].vista < this.list[m].applyNum){ if(this.list[m].vista < this.list[m].applyNum){
let arr = [] let arr = []
this.list.forEach(ele => { this.list.forEach(ele => {
console.log(`output->`,ele.workorderCode,this.list[m].workorderCode)
if(ele.workorderCode === this.list[m].workorderCode){ if(ele.workorderCode === this.list[m].workorderCode){
arr.push(ele) arr.push(ele)
} }
}); });
// 工单申请数量
let totalApplyNum = (arr[0].applyNum-0) let totalApplyNum = (arr[0].applyNum-0)
// 当前工单已经录入了总数量 vista是每一个录入数量
let totalVista =0 let totalVista =0
arr.forEach(ele => { arr.forEach(ele => {
totalVista = totalVista + (ele.vista?(ele.vista-0):0) totalVista = totalVista + (ele.vista?(ele.vista-0):0)
...@@ -339,11 +332,14 @@ export default { ...@@ -339,11 +332,14 @@ export default {
// 最终填入的数量 // 最终填入的数量
let endVista = 0 let endVista = 0
endVista = ((this.list[m].applyNum - 0)-(this.list[m].vista-0)).toFixed(3) endVista = ((this.list[m].applyNum - 0)-(this.list[m].vista-0)).toFixed(3)
if(m===this.list.length-1){ // 处理最后一行
if(m === this.list.length - 1){
endVista = res.PACMG - 0 endVista = res.PACMG - 0
} }
// 工单录入数量总和小于总的申请数量 那就要新增一行
if(totalVista < totalApplyNum){ if(totalVista < totalApplyNum){
this.handleAddList(m,endVista,res) this.handleAddList(m,endVista,res)
// 当前包装数量 大于(总的申请数量 减 工单录入数量总)就要往下一个分配
if((res.PACMG-0)-endVista >0){ if((res.PACMG-0)-endVista >0){
this.factorial(res,plnr,m+2,(res.PACMG-0)-endVista) this.factorial(res,plnr,m+2,(res.PACMG-0)-endVista)
} }
...@@ -353,7 +349,6 @@ export default { ...@@ -353,7 +349,6 @@ export default {
this.$u.toast('暂无剩余物料'); this.$u.toast('暂无剩余物料');
} }
} }
// }
} }
} }
} }
......
...@@ -27,8 +27,14 @@ ...@@ -27,8 +27,14 @@
</view> </view>
<view v-if="!show" class="bottomBox"> <view v-if="!show" class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.workorderCode+idx" v-if="ele.itemCode === item.itemCode"> <view class="bottomItem" v-for="(ele, idx) in list" :key="ele.workorderCode+idx" v-if="ele.itemCode === item.itemCode">
<view class="proItem">
<view class="items">生产单号:{{ ele.workorderCode }}</view> <view class="items">生产单号:{{ ele.workorderCode }}</view>
<view class="items">物料批次:{{ ele.CHARG }}</view> <view class="progress">
<progress :percent="handleVista(ele)" show-info />
<!-- <u-line-progress active-color="#2979ff" :percent="handleVista(ele)"></u-line-progress> -->
</view>
</view>
<view class="items">PL:{{ ele.PLNR }}</view>
<view class="items">库位:{{ ele.NLPLA }}</view> <view class="items">库位:{{ ele.NLPLA }}</view>
<!-- <view class="items">{{ item.MATNR }}</view> --> <!-- <view class="items">{{ item.MATNR }}</view> -->
<view class="items inputItem"> <view class="items inputItem">
...@@ -124,7 +130,17 @@ export default { ...@@ -124,7 +130,17 @@ export default {
created() { created() {
}, },
methods: { methods: {
handleVista(items){
let num = 0
this.list.forEach(ele => {
if(ele.workorderCode === items.workorderCode){
console.log(`output->`,ele.vista,items.workorderCode)
num += ((ele.vista?ele.vista: 0)-0)
}
});
console.log(`output->num`,num)
return ((num/items.applyNum).toFixed(2)*100-0)>100? 100 : (num/items.applyNum).toFixed(2)*100|| 0
}
} }
}; };
</script> </script>
...@@ -220,6 +236,7 @@ page { ...@@ -220,6 +236,7 @@ page {
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
line-height: 40rpx; line-height: 40rpx;
word-break: break-all;
/deep/ .uni-easyinput{ /deep/ .uni-easyinput{
width: 200rpx; width: 200rpx;
} }
...@@ -235,4 +252,17 @@ page { ...@@ -235,4 +252,17 @@ page {
top: 0 !important; top: 0 !important;
background: #fff; background: #fff;
} }
.progress{
width: 45%;
margin-left: 20rpx;
/deep/ .uni-progress-info{
font-size: 24rpx;
}
}
/deep/ .uni-progress{
line-height: 40rpx;
}
.proItem{
display: flex;
}
</style> </style>
<template> <template>
<view> <view>
<StickyNavBar> <StickyNavBar>
<NavBar title="销售退货上架"></NavBar> <NavBar title="销售货上架"></NavBar>
<view class="btn"> <view class="btn">
<uni-easyinput <uni-easyinput
prefixIcon="search" prefixIcon="search"
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
}; };
}, },
created() { created() {
// this.getPlnr('10000001'); // this.getPlnr('80000033');
}, },
methods: { methods: {
getBtnHandle(row) { getBtnHandle(row) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> --> </view> -->
<view class="headerTitle"> <view class="headerTitle">
<view class="items">交货单号:MO2024032100001</view> <view class="items">交货单号:MO2024032100001</view>
<view class="items">600247|李XXXX宁XXX体</view> <view class="items">8|李XXXXXXX体</view>
<view class="items">计划日期:2024/03/22</view> <view class="items">计划日期:2024/03/22</view>
</view> </view>
<view class=""> <view class="">
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
nlpla: '', nlpla: '',
wxparams: '', wxparams: '',
goodsList: [], goodsList: [],
list: [],
orderItem: {}, orderItem: {},
}; };
}, },
...@@ -106,12 +107,20 @@ export default { ...@@ -106,12 +107,20 @@ export default {
}, },
onLoad(option) { onLoad(option) {
if(option && option.order){ if(option && option.order){
this.goodsList = [ const arr = [
...JSON.parse(option.order) ...JSON.parse(option.order)
] ]
this.goodsList.forEach(ele => { arr.forEach(ele => {
ele.checkedBox = false // ele.checkedBox = false
ele.ZSIZE.forEach(item => {
if(ele.POSNR === item.POSNR){
item.MATNR = ele.MATNR
item.MAKTX = ele.MAKTX
this.goodsList.push(item)
}
});
}); });
console.log(`output->this`,this.goodsList.length)
} }
}, },
computed:{ computed:{
......
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
<view> <view>
<view class="listItemTitle"> <view class="listItemTitle">
<view> <view>
<view class="item">行号:{{ item.POSNR }}</view>
<view class="item">物料编号:{{ item.MATNR }}</view> <view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view> <view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">尺码:{{ item.ZSIZE }}</view>
<view class="item">数量:{{ item.ZINSNUM }}</view>
</view> </view>
<view class="right"> <view class="right">
<checkbox-group class="checkedBox"> <!-- <checkbox-group class="checkedBox">
<checkbox value="r1" :checked="item.checkedBox" disabled/> <checkbox value="r1" :checked="item.checkedBox" disabled/>
</checkbox-group> </checkbox-group> -->
<text class="blue">{{ item.CLABS }}</text> <!-- <text class="blue">{{ item.CLABS }}</text>
<text class="line">/</text> <text class="line">/</text>
<text class="">{{item.LFIMG}}pcs</text> <text class="">{{item.LFIMG}}pcs</text> -->
</view> </view>
</view> </view>
<view class="listBottom"> <view class="listBottom">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment