From 98c71ab1710448540bca2c467fe364f9c446447d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 9 Dec 2021 18:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/product/add.js | 11 ++++++++--- src/pages/plan/product/add.js | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/exchangecode/product/add.js b/src/pages/exchangecode/product/add.js index abaa9e29..65328d64 100644 --- a/src/pages/exchangecode/product/add.js +++ b/src/pages/exchangecode/product/add.js @@ -122,21 +122,25 @@ export default class adduserinfo extends React.Component{ this.setState({cur_product:e}) let cur_product = this.state.products.find((item)=>{return item.id == e.key}) let picItem = window.goods.find((item)=>{return item.id == cur_product.product_category_id}) - + let quantity = this.state.model.quantity; + console.log(cur_product) + console.log(quantity) let model2 = { product_id:cur_product.id, product_type:cur_product.type, contract_price:this.state.model.contract_price, official_price:cur_product.official_price, cost_price:cur_product.cost_price, - quantity:this.state.model.quantity, - stock:this.state.model.quantity, + quantity:quantity, + stock:quantity, usage:0, product_name:this.state.model.product_name, show_url:picItem ? picItem.pic : "", describe_url:picItem ? picItem.pic : "", account_type:cur_product.account_type } + console.log("摩西") + console.log(model2) this.setState({model:model2}) } onTypeChange(e){ @@ -310,6 +314,7 @@ export default class adduserinfo extends React.Component{ { let model2 = this.state.model; model2.quantity = e; + model2.stock = e; this.setState({model:model2}) }} diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index f6071f40..1f2800c6 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -299,6 +299,7 @@ export default class adduserinfo extends React.Component{ { let model2 = this.state.model; model2.quantity = e; + model2.stock = e; this.setState({model:model2}) }}