diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index 60103c52..4b199756 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -296,16 +296,17 @@ export default class exchangeAdd extends React.Component { res.checked = true return res }) + this.setState({ tempdata: reqCopy.goods || [] }) - let a1 = reqCopy.goods.map((item) => { - let obj = { - ...item, - in: true - } - return obj - }) - sessionStorage.setItem("productData", JSON.stringify(a1)) - sessionStorage.setItem("knockGoldData", JSON.stringify(a1)) + + sessionStorage.setItem( + "productData", + JSON.stringify(reqCopy.goods) + ) + sessionStorage.setItem( + "knockGoldData", + JSON.stringify(reqCopy.goods) + ) let arr = [] _.map(reqCopy.goods, (res) => { @@ -313,12 +314,10 @@ export default class exchangeAdd extends React.Component { obj.key = res.only obj.text = res.product_name obj.id = res.id - this.state.oldProduct.push(res.id) arr.push(obj) return obj }) - this.setState({ rankoptions: arr }) - this.setState({ rank: arr }) + this.setState({ rank: arr, rankoptions: arr }) }, (err) => {} )