Commit cbacb518 authored by 何远江's avatar 何远江

销售拣货添加新字段

parent 755f316e
......@@ -3,9 +3,10 @@
<StickyNavBar class="listTitle">
<NavBar title="销售拣货"></NavBar>
<view class="headerTitle">
<view class="items">交货单号:{{ vbeln }}</view>
<view class="items">8|李XXXXXXX体</view>
<view class="items">计划日期:9999/99/99</view>
<view class="items">交货单号:{{ vbeln }}</view>
<view class="items">{{saleInfo.KUNNR}} | {{ saleInfo.NAME1 }}</view>
<view class="items">计划日期:{{ saleInfo.WADAT }}</view>
<view class="items">装箱数:{{ catchPL && catchPL.length || 0 }} / {{ Number(saleInfo.XSNUM) }}</view>
</view>
<view class="">
<view class="btn">
......@@ -75,7 +76,7 @@
isDisabled: false,
nlpla: "",
wxparams: "",
goodsList: [],
goodsList: [],
pls: [], // 已经扫码的pl号
resFlag: false,
};
......@@ -92,13 +93,16 @@
totalNum() {
const count = this.goodsList.filter((item) => item.checkedBox).length;
return count || 0;
},
/**
* 缓存的扫描过的pl条目
*/
catchPL() {
return this.vuex_sales_outbound[this.vbeln] || null
},
/**
* 缓存的扫描过的pl条目
*/
catchPL() {
return this.vuex_sales_outbound[this.vbeln] || null
},
saleInfo() {
return this.goodsList[0] || {}
}
},
methods: {
goSubmit() {
......@@ -143,14 +147,14 @@
return f;
});
if (!flag) {
this.$u.toast("提交成功");
// 如果有缓存PL,提交成功将要清楚当前缓存
if (this.catchPL) {
const sales_outbound = {
...this.vuex_sales_outbound
}
delete sales_outbound[this.vbeln]
this.$u.vuex('vuex_sales_outbound', sales_outbound)
this.$u.toast("提交成功");
// 如果有缓存PL,提交成功将要清楚当前缓存
if (this.catchPL) {
const sales_outbound = {
...this.vuex_sales_outbound
}
delete sales_outbound[this.vbeln]
this.$u.vuex('vuex_sales_outbound', sales_outbound)
}
setTimeout(() => {
this.goBack();
......@@ -164,14 +168,14 @@
const pls = this.goodsList.reduce((acc, cur) => {
cur.ZPLDT && acc.push(...cur.ZPLDT)
return acc
}, [])
}, [])
// 如果已经扫描pl执行缓存
if (pls.length) {
const sales_outbound = {
...(this.vuex_sales_outbound || {}),
[this.vbeln]: pls
}
this.$u.vuex('vuex_sales_outbound', sales_outbound)
this.$u.vuex('vuex_sales_outbound', sales_outbound)
this.$u.toast('保存成功!')
}
},
......@@ -180,8 +184,8 @@
.sapSchDn({
VBELN
}).then(res => {
this.initGoodsList(res.BKDT)
console.log(this.catchPL, 'this.catchPL')
this.initGoodsList(res.BKDT)
console.log(this.catchPL, 'this.catchPL')
this.catchPL && this.setSalesBoundPL(this.catchPL)
})
},
......@@ -212,27 +216,27 @@
this.$u.toast(`物料编号:${ele.MATNR}--没有尺码信息`);
}
});
},
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]);
}
}
});
},
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]);
}
}
});
},
getPlnr(plnr) {
let params = {
......@@ -269,13 +273,13 @@
this.current = index;
},
handleInputNlpla(e) {},
handleInputPlnr(e) {
handleInputPlnr(e) {
if (!e) return
this.isFocus = false;
console.log(this.pls, 'this.pls')
if (this.pls.includes(e)) {
return this.$u.toast('请勿重复扫描!')
}
this.isFocus = false;
console.log(this.pls, 'this.pls')
if (this.pls.includes(e)) {
return this.$u.toast('请勿重复扫描!')
}
this.getPlnr(e);
},
},
......@@ -350,4 +354,4 @@
background: #fff;
margin-bottom: 20rpx;
}
</style>
</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