diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue index bd0fe22..cbc2639 100644 --- a/pages/inventory/addinventory.vue +++ b/pages/inventory/addinventory.vue @@ -143,6 +143,7 @@ for (let i = 0; i < this.carList1.length; i++) { let obj = { purchasePrice: this.carList1[i].price, //进货价 + price:0, productCount: this.carList1[i].num, productId: this.carList1[i].id, productName: this.carList1[i].productName, @@ -175,6 +176,7 @@ }else{//商品不同 let obj = { purchasePrice: this.carList1[i].price, //进货价 + price:0, productCount: this.carList1[i].num, productId: this.carList1[i].id, productName: this.carList1[i].productName, @@ -315,10 +317,10 @@ changePrice(val) { let that = this; that.shouldPay = 0 - console.log(that.carList.get(that.index)) - that.carList.get(that.index).purchasePrice = val * that.carList.get(that.index).productCount; + that.carList.get(that.index).purchasePrice = val + that.carList.get(that.index).price = val * that.carList.get(that.index).productCount; that.carList.forEach(function(value, key) { - that.shouldPay += value.purchasePrice + that.shouldPay += value.price }) // this.carList.get(this.index) // this.shouldPay = 0