Commit bf258b9d authored by xiangzj's avatar xiangzj

拣配

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