fix:修复兑换码复制时回显计划和批次

This commit is contained in:
wangsongsole 2022-09-30 11:45:07 +08:00
parent 9756c22b35
commit d46f2cf858
1 changed files with 11 additions and 5 deletions

View File

@ -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 ? (
<FormItem
labelname='归属计划'
prop='planSelect'
@ -1124,7 +1130,7 @@ export default class exchangeAdd extends React.Component {
</FormItem>
) : null}
{!this.state.isState ? (
{this.state.isState !== 2 ? (
<FormItem
labelname='归属key'
prop='keyBatchSelect'