Commit bf258b9d authored by xiangzj's avatar xiangzj

拣配

parent 6c9dbfee
......@@ -74,7 +74,7 @@ export default {
};
},
created() {
// this.getPlnr('80000033');
this.getPlnr('80000033');
},
methods: {
getBtnHandle(row) {
......
......@@ -6,9 +6,9 @@
<u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
</view> -->
<view class="headerTitle">
<view class="items">交货单号:MO2024032100001</view>
<view class="items">交货单号:{{ goodsList[0].VBELN }}</view>
<view class="items">8|李XXXXXXX体</view>
<view class="items">计划日期:2024/03/22</view>
<view class="items">计划日期:9999/99/99</view>
</view>
<view class="">
<view class="btn">
......@@ -36,7 +36,7 @@
<ContentLoadingMore class="contentMore" :list='goodsList'>
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
<scanningList :item='item'/>
<scanningList :item='item' :list='list'/>
</view>
</view>
<!-- <view class="cardbox" v-else>
......@@ -69,14 +69,6 @@ export default {
value: '',
type: 'select',
border: true,
list: [
{
name: '拣货扫描'
},
{
name: '库存查询'
}
],
current: 0,
status: 'loadmore',
btnArr: [
......@@ -120,7 +112,7 @@ export default {
}
});
});
console.log(`output->this`,this.goodsList.length)
this.list = JSON.parse(JSON.stringify(this.goodsList))
}
},
computed:{
......@@ -131,19 +123,20 @@ export default {
},
methods: {
goSubmit() {
const checkboxArr = this.goodsList.filter(item => item.checkedBox)
if (checkboxArr.length === 0) {
this.$u.toast('暂无提交数据');
return;
}
const chargLength = checkboxArr.filter(item => item.CHARG).length
const chargListLength = this.goodsList.filter(item => item.CHARG).length
if (chargLength > 1 || chargListLength != chargLength) {
this.$u.toast('超过拣配数量');
return;
}
// const checkboxArr = this.goodsList.filter(item => item.checkedBox)
// if (checkboxArr.length === 0) {
// this.$u.toast('暂无提交数据');
// return;
// }
// const chargLength = checkboxArr.filter(item => item.CHARG).length
// const chargListLength = this.goodsList.filter(item => item.CHARG).length
// if (chargLength > 1 || chargListLength != chargLength) {
// this.$u.toast('超过拣配数量');
// return;
// }
const arr = this.list.filter(item => item.PLNR)
this.$u.api.sapApi
.sapPickingDn(checkboxArr)
.sapPickingDn(arr)
.then((res) => {
this.loading = false;
if(!Array.isArray(res)){
......@@ -167,17 +160,20 @@ export default {
.sapBlpl(params)
.then((res) => {
if (res && res.MSG[0].TYPE === 'S') {
const data = res.BLPL[0]
const count = this.goodsList.filter(item => item.PLNR === res.BLPL[0].PLNR).length
if(!count){
this.$u.toast('没有匹配到对应物料');
}else{
this.goodsList.forEach((ele,idx) => {
if(ele.PLNR === res.BLPL[0].PLNR){
this.$set(this.goodsList,idx,{...ele,checkedBox: true})
this.list.forEach(ele => {
res.BLPL.forEach(item => {
if(ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR ){
if((item.PACMG-0) > ele.ZINSNUM){
this.$u.toast('太多了');
}else{
this.list.push({
...ele,
...item
})
}
}
});
}
});
} else {
this.$u.toast(res.MSG[0].MESSAGE);
}
......
......@@ -6,7 +6,7 @@
<view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">尺码:{{ item.ZSIZE }}</view>
<view class="item">数量:{{ item.ZINSNUM }}</view>
<view class="item">数量:{{ handleNum() }}/{{ item.ZINSNUM }}</view>
</view>
<view class="right">
<!-- <checkbox-group class="checkedBox">
......@@ -32,18 +32,18 @@
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem">
<view class="items">装箱号:{{ item.ZCODE }}</view>
<view class="items">物料批号:{{ item.CHARG }}</view>
<view class="items">库位:{{ item.LGORT }}</view>
<!-- <view class="items">{{ item.MATNR }}</view> -->
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.PLNR+idx" v-if="ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR && ele.PLNR">
<view class="items">PL号:{{ ele.PLNR }}</view>
<view class="items">物料批号:{{ ele.CHARG }}</view>
<view class="items">库位:{{ ele.NLPLA }}</view>
<!-- <view class="items">{{ ele.MATNR }}</view> -->
<view class="items inputItem">
<!-- <u-row gutter="8"> -->
数量:
{{item.CLABS}}
<!-- <uni-easyinput v-model="item.CLABS"></uni-easyinput> -->
/
{{ item.LFIMG }}
{{ele.PACMG}}
<!-- <uni-easyinput v-model="ele.CLABS"></uni-easyinput> -->
<!-- /
{{ ele.LFIMG }} -->
<!-- </u-row> -->
</view>
</view>
......@@ -69,16 +69,14 @@ export default {
default: function () {
return {};
}
},
list: {
type: Array,
default: function () {
return [];
}
}
},
// watch: {
// goodsList: {
// handler: function(val, oldVal) {
// this.goodsList = val
// },
// immediate: true
// }
// },
data() {
return {
r1:'',
......@@ -106,6 +104,15 @@ export default {
},
methods: {
handleNum(){
let num = 0
this.list.forEach(ele => {
if(ele.ZSIZE === this.item.ZSIZE && ele.MATNR === this.item.MATNR && ele.PLNR){
num += (ele.PACMG-0)
}
});
return num
}
}
};
</script>
......
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