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}) }}