From 8589eebd3a511250d57ebc2fca2f6f32a9903e2f Mon Sep 17 00:00:00 2001 From: "tianyi@bogon" Date: Mon, 6 Nov 2023 10:54:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/inventory/addinventory.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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