From d46f2cf858123afd040f90f5f68e680d2a6f0d02 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 30 Sep 2022 11:45:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E5=A4=8D=E5=88=B6=E6=97=B6=E5=9B=9E=E6=98=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=92=8C=E6=89=B9=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/exchangecodeAdd/index.jsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index f1ba786e..60103c52 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -60,7 +60,9 @@ export default class exchangeAdd extends React.Component { /* 编辑和复制时才调用 */ if (isState) { this.getDetailFunction(isState) - } else { + } + + if (isState !== 2) { sessionStorage.setItem("productData", []) sessionStorage.setItem("knockGoldData", []) this.getPlanSelect() @@ -258,7 +260,6 @@ export default class exchangeAdd extends React.Component { handelResponse( res, (req, msg) => { - console.log("兑换码详情: =>", req) let reqCopy = _.cloneDeep(req) const resData = this.transFormData(reqCopy) reqCopy.goods = resData @@ -272,11 +273,16 @@ export default class exchangeAdd extends React.Component { range: reqCopy.goods } - /* 复制状态改变code_name */ + /* 复制状态改变code_name、回显计划、批次 */ if (this.state.isState === 1) { codeInfo.code_name = `${reqCopy.title}_${ reqCopy.copy_count + 1 }` + codeInfo.planSelect = { key: req.plan.id, text: req.plan.title } + codeInfo.keyBatchSelect = { + key: req.key_batch_id, + text: req.key_batch.batch_name + } } this.setState({ @@ -1101,7 +1107,7 @@ export default class exchangeAdd extends React.Component { rules={codeInfo} ref='code_info' className='addform'> - {!this.state.isState ? ( + {this.state.isState !== 2 ? ( ) : null} - {!this.state.isState ? ( + {this.state.isState !== 2 ? (