Commit cf3fd2a0 authored by 沈翠玲's avatar 沈翠玲

发货下架

parent 186cabc4
......@@ -4,24 +4,21 @@
<NavBar title="发货下架"></NavBar>
<view class="btn">
<uni-easyinput class="boxSelect" prefixIcon="search" v-model.trim="lgort" placeholder="请扫描目标仓位"></uni-easyinput>
<uni-easyinput class="boxSelect" prefixIcon="search" v-model.trim="vbeln" placeholder="请扫描交货单"></uni-easyinput>
<uni-easyinput class="boxSelect" prefixIcon="search" v-model.trim="vbeln" placeholder="请扫描交货单" @input="handleInputvbeln"></uni-easyinput>
<uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model.trim="wxparams" :focus="isFocus"
placeholder="请扫描产品包装条码/外箱码" @input="handleInputPlnr"></uni-easyinput>
</view>
<!-- <view class="total" v-show="goodsList && goodsList.length > 0">
<view class="left">明细</view>
</view> -->
</StickyNavBar>
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.PLNR">
<view class="listItemTitle">
<view>
<view class="item">{{ item.ZCODE ? 'BL':'PL' }}号:{{ item.ZCODE || item.PLNR }}</view>
</view>
<u-button size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
<ContentLoadingMore class="contentMore" :list="goodsList">
<view class="cardbox">
<view class="cardContent" v-for="item in goodsList" :key="item.PLNR">
<scanningList :item="item" :list="item.ZPLDT" />
</view>
</view>
</view>
</ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view>
......@@ -29,6 +26,8 @@
<script>
import BottomBtn from '@/components/BottomBtn/index.vue';
import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
import scanningList from "../salesOutbound/scanningList.vue";
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import {
parseTime
......@@ -37,6 +36,8 @@
export default {
components: {
StickyNavBar,
ContentLoadingMore,
scanningList,
BottomBtn
},
data() {
......@@ -47,6 +48,7 @@
isDisabled: false,
isFocus: false,
goodsList: [],
pls: [], // 已经扫码的pl号
btnArr: [{
style: '',
type: 'warning',
......@@ -62,33 +64,109 @@
],
}
},
computed: {
/**
* 缓存的扫描过的pl条目
*/
catchPL() {
return this.vuex_sales_outbound[this.vbeln] || null
}
},
methods: {
handleInputPlnr(e) {
if (this.goodsList.some((item) => item.ZCODE === e || item.PLNR === e)) {
this.$u.toast('已经存在当前条码');
this.reset()
return
}
// bl 长度 15 pl 长度 80
const bl = e.length <= 15 && e.length >= 13;
const pl = e.length > 15
if (bl) {
this.isFocus = false;
this.isDisabled = true;
this.goodsList.push({
ZCODE: e,
PLNR: ''
})
this.reset()
} else if (pl) {
this.isFocus = false;
this.isDisabled = true;
this.goodsList.push({
PLNR: e,
ZCODE: ''
})
this.reset()
if (!e) return
this.isFocus = false;
console.log(this.pls, 'this.pls')
if (this.pls.includes(e)) {
return this.$u.toast('请勿重复扫描!')
}
this.getPlnr(e);
},
getPlnr(plnr) {
let params = {
ZCODE: plnr.includes("BL") ? plnr : "",
plnr: plnr.includes("BL") ? "" : plnr,
ztype: '005'
};
this.$u.api.sapApi.sapBlpl(params).then((res) => {
if (res && res.MSG[0].TYPE === "S") {
this.setSalesBoundPL(res.BLPL)
} else {
this.$u.toast(res.MSG[0].MESSAGE);
}
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
this.wxparams = "";
}, 1000);
this.loading = false;
});
},
setSalesBoundPL(pls) {
console.log(pls, 'pls')
// 循环BLPL合并相同的物料号和size
pls.forEach((ele) => {
if (!this.pls.includes(ele.PLNR) || !this.pls.includes(ele.ZCODE)) {
ele.PLNR && this.pls.push(ele.PLNR)
ele.ZCODE && this.pls.push(ele.ZCODE)
}
ele.TOMNG = ele.PACMG;
const item = this.goodsList.find(
(v) => v.ZSIZE == ele.ZSIZE && ele.MATNR == v.MATNR
);
if (item) {
if (Reflect.has(item, "ZPLDT")) {
item.ZPLDT.push(ele);
} else {
this.$set(item, "ZPLDT", [ele]);
}
}
});
},
initGoodsList(arr) {
// 有SIZE行就取ZINSNUM+ZLOSSC,没有SIZE行的就是取交货单行的LFIMG
arr.forEach((ele) => {
if (ele.ZSIZE.length) {
this.goodsList.push(
...ele.ZSIZE.map((item) => {
return {
KDAUF: ele.KDAUF,
KDPOS: ele.KDPOS,
LFIMG: ele.LFIMG,
MEINS: ele.MEINS,
WERKS: ele.WERKS,
...item,
KUNNR: ele.KUNNR,
NAME1: ele.NAME1,
WADAT: ele.WADAT,
XSNUM: ele.XSNUM,
MATNR: ele.MATNR,
MAKTX: ele.MAKTX,
sumNum: item.ZINSNUM + item.ZLOSSC
};
})
);
} else {
ele.ZSIZE = "";
ele.sumNum = ele.LFIMG;
// ele.ZINSNUM = ele.LFIMG;
this.goodsList.push(ele);
this.$u.toast(`物料编号:${ele.MATNR}--没有尺码信息`);
}
});
},
handleInputvbeln(VBELN) {
this.$u.api.sapApi
.sapSchDn({
VBELN
}).then(res => {
this.initGoodsList(res.BKDT)
console.log(this.catchPL, 'this.catchPL')
this.catchPL && this.setSalesBoundPL(this.catchPL)
setTimeout(() => {
this.vbeln = "";
}, 1000);
})
},
deleGonds(index) {
this.goodsList.splice(index, 1)
......@@ -167,32 +245,31 @@
}
}
.contentMore {
margin: 20rpx;
}
.cardbox {
max-height: calc(100vh - 105px - 60rpx - 140rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
background: #fff;
margin-bottom: 20rpx;
}
.listItemTitle {
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
padding: 20rpx;
border-bottom: 2px solid #f8f8f8;
.u-btn {
width: 150rpx;
margin: 0px;
margin-top: 10rpx;
}
.item {
line-height: 50rpx;
color: #333;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
font-weight: 600;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
</style>
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