Commit 24958473 authored by 黄媛媛's avatar 黄媛媛

解决修改数据 数据丢失问题

parent 7da668c4
......@@ -2287,7 +2287,10 @@ export default {
this.calcList(this.skuList, this.SpecificationList);
},
calcList(list, calist) {
let oldArr=JSON.parse(JSON.stringify(this.SpecificationPriceList))
this.SpecificationPriceList = [];
let arrList = [];
list.forEach(item => {
item.AttrList = [];
......@@ -2311,21 +2314,36 @@ export default {
});
});
list.forEach((item, i) => {
let obj = {
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GoodsNumbers: item.GoodsNumbers,
GoodsWeight: item.GoodsWeight,
InventoryNum: item.InventoryNum,
SellingPrice: item.SellingPrice
};
let obj={};
obj = {
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GoodsNumbers: item.GoodsNumbers,
GoodsWeight: item.GoodsWeight,
InventoryNum: item.InventoryNum,
SellingPrice: item.SellingPrice
};
oldArr.forEach(val=>{
if(val.SpecificationSort==item.SpecificationSort){
obj = {
AttrList: item.AttrList,
SpecificationSort: val.SpecificationSort,
GoodsNumbers: val.GoodsNumbers,
GoodsWeight: val.GoodsWeight,
InventoryNum: val.InventoryNum,
SellingPrice: val.SellingPrice
};
}
})
this.SpecificationPriceList.push(obj);
let obj1 = {
Id: i,
AttrList: item.AttrList,
SpecificationSort: item.SpecificationSort,
GradeCommissionList: []
};
this.SpecificationPriceList.push(obj);
arrList.push(obj1);
});
this.calcdis(JSON.parse(JSON.stringify(arrList)));
......
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