修复每周菜谱自动计价功能bug

This commit is contained in:
czx 2020-12-01 16:07:35 +08:00
parent d61517cf46
commit 147dbe0e15

View File

@ -248,11 +248,18 @@
},
//
changeFoods(row) {
console.log("row-->", row);
console.log("foodList-->", this.foodList)
let ret = 0;
for(let i =0 ; i < row.foods.length; i++) {
ret += this.foodList[i].price;
for (let i = 0; i < row.foods.length; i++) {
let foodPrice = row.foods[i];
this.foodList.forEach(item => {
if (item.foodId === foodPrice) {
ret += item.price;
}
this.weekMenuList[row.id -1 ].price = ret;
});
}
this.weekMenuList[row.id - 1].price = ret;
},
//