1) 增加key批次复制

This commit is contained in:
zhangds 2022-09-22 16:58:27 +08:00
parent 6d0bc162f4
commit 3e20513d93
1 changed files with 90 additions and 79 deletions

View File

@ -252,7 +252,6 @@ export default class acclist extends React.Component {
//复制
if (batch_id > 0 || copyOpearo == 2) {
// this.setState({isEdit:true})
getKeyBatchDetail(batch_id).then((res) => {
handelResponse(
res,
@ -269,7 +268,6 @@ export default class acclist extends React.Component {
this.getProductFunction(req.direct_reseller_id);
});
});
let model = {
title: req.plan_title,
style: req.style,
@ -277,14 +275,12 @@ export default class acclist extends React.Component {
allow_repetition: req.allow_repetition,
allow_loss: req.allow_loss,
merge_stock: req.merge_stock,
code_batch: req.code_batch,
batch_name: `${req.batch_name}_${++req.copy_count}`,
};
this.setState({ keyType: req.bind_object });
this.setState({ model: model });
this.setState({ endtime: req.end_time });
this.setState({ begintime: req.begin_time });
this.setState({ keyCodeId: req.id });
// 兑换码
if (req.bind_object[0] === 1) {
model.code_batch = req.code_batch;
let list = _.map(req.code_batch, (item) => {
item.product = item.product.map((item1) => {
let obj = {};
@ -360,6 +356,21 @@ export default class acclist extends React.Component {
return item;
});
this.setState({ distdata: list });
} else {
// 优惠券
let temp = _.map(req.coupon, (o) => {
o.checked = true;
return o;
});
model.coupon = temp;
this.setState({ couponData: temp });
}
this.setState({ keyType: req.bind_object[0] });
this.setState({ model: model });
this.setState({ endtime: req.end_time });
this.setState({ begintime: req.begin_time });
this.setState({ keyCodeId: req.id });
},
(err) => {}
);