修正 复制兑换码后,被复制的兑换码数据没有回显。

This commit is contained in:
wangsongsole 2022-08-11 14:55:57 +08:00
parent a56e94825c
commit 27cb9e8518
1 changed files with 12 additions and 2 deletions

View File

@ -152,14 +152,23 @@ export default class acclist extends React.Component {
this.setState({ isEdit: true }) this.setState({ isEdit: true })
} }
req.code_batch = req.code_batch ? req.code_batch : [] req.code_batch = req.code_batch || []
this.setState({ this.setState({
pagetitle: '复制兑换码', pagetitle: '复制兑换码',
plan_id: req.plan_id, plan_id: req.plan_id,
key_status: req.status key_status: req.status
}) })
let list = _.map(req.code_batch, (item) => { const cloneData = _.cloneDeep(req.code_batch)
req.code_batch.map((item) => {
if (item.id === copy_code_id) {
const data = _.cloneDeep(item)
data.id = new Date().getTime()
cloneData.push(data)
}
})
let list = _.map(cloneData, (item) => {
item.product = item.product.map((item1) => { item.product = item.product.map((item1) => {
let obj = {} let obj = {}
if (item1.type === 1) { if (item1.type === 1) {
@ -202,6 +211,7 @@ export default class acclist extends React.Component {
return obj return obj
}) })
let pr = {} let pr = {}
pr.range = item.range pr.range = item.range
pr.restrict = item.restrict pr.restrict = item.restrict