Commit 51e81212 authored by 李驰骋's avatar 李驰骋

扫码到货数量重复计划BUG修复

parent a61fb8b4
......@@ -140,12 +140,12 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
// 接收扫码页面返回的数据
updateGoodsList(newGoodsList) {
if (newGoodsList && newGoodsList.length > 0) {
// 合并新的扫码数据到现有列表
// 智能合并数据,避免重复累加
newGoodsList.forEach(newItem => {
const existingIndex = this.goodsList.findIndex(item => item.joinlabel === newItem.joinlabel);
if (existingIndex > -1) {
// 如果已存在,更新数量
this.goodsList[existingIndex].arrivalQuantity = Number(this.goodsList[existingIndex].arrivalQuantity) + Number(newItem.arrivalQuantity);
// 如果已存在,直接替换数量(因为scanning页面已经处理了累加逻辑)
this.goodsList[existingIndex].arrivalQuantity = Number(newItem.arrivalQuantity);
} else {
// 如果不存在,添加新项
this.goodsList.push(newItem);
......
......@@ -68,6 +68,14 @@ export default {
this.isFocus = true;
});
},
onLoad(options) {
// 接收主页面传递的数据
const pages = getCurrentPages();
const prevPage = pages[pages.length - 2];
if (prevPage && prevPage.$vm && prevPage.$vm.goodsList) {
this.goodsList = [...prevPage.$vm.goodsList];
}
},
methods: {
focus(){
this.$nextTick(() => {
......@@ -81,7 +89,7 @@ export default {
this.$nextTick(() => {
setTimeout(()=>{
this.isFocus = true;
},100);
},500);
});
},
getBtnHandle(row) {
......
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