修复 【兑换码管理】编辑立减金商品页面,加款成功后,点击页面的取消按钮,充值批次金额也应该被保存

This commit is contained in:
wangsongsole 2022-06-16 14:27:45 +08:00
parent 4891721bc2
commit 7663f0d21b
1 changed files with 68 additions and 62 deletions

View File

@ -241,74 +241,79 @@ export default class exchangedit extends React.Component {
})
.catch((err) => {})
} else {
getCodesDetail(code_batch_id)
.then((res) => {
handelResponse(
res,
(req, msg) => {
let reqCopy = _.cloneDeep(req)
const resData = this.transFormData(reqCopy)
reqCopy.goods = resData
let codeInfo = {
code_name: reqCopy.title,
issued: reqCopy.quantity,
stock: reqCopy.stock,
describe: reqCopy.describe,
date_time: [reqCopy.begin_time, reqCopy.end_time],
range: reqCopy.goods
}
this.getTableList()
}
}
this.setState({ plan_time: reqCopy.plan.end_time })
//获取分销商
getReseller(reqCopy.plan.reseller_id).then((res) => {
handelResponse(res, (req1, msg) => {
console.log('req ==>1', req1)
req1.receive_email = req1.contact_email[0]
this.setState({ reseller: req1 })
this.setState({ phone_list: req1.contact_phone })
this.setState({ email_list: req1.contact_email })
this.setState({
direct_reseller_id: req1.direct_reseller_id
})
getTableList() {
let code_batch_id = sessionStorage.getItem('code_id')
getCodesDetail(code_batch_id)
.then((res) => {
handelResponse(
res,
(req, msg) => {
let reqCopy = _.cloneDeep(req)
const resData = this.transFormData(reqCopy)
reqCopy.goods = resData
let codeInfo = {
code_name: reqCopy.title,
issued: reqCopy.quantity,
stock: reqCopy.stock,
describe: reqCopy.describe,
date_time: [reqCopy.begin_time, reqCopy.end_time],
range: reqCopy.goods
}
this.setState({ plan_time: reqCopy.plan.end_time })
//获取分销商
getReseller(reqCopy.plan.reseller_id).then((res) => {
handelResponse(res, (req1, msg) => {
console.log('req ==>1', req1)
req1.receive_email = req1.contact_email[0]
this.setState({ reseller: req1 })
this.setState({ phone_list: req1.contact_phone })
this.setState({ email_list: req1.contact_email })
this.setState({
direct_reseller_id: req1.direct_reseller_id
})
})
})
this.setState({ codeInfo: codeInfo })
this.setState({ isload: true })
_.map(reqCopy.goods, (res) => {
res.checked = true
return res
})
this.setState({ tempdata: reqCopy.goods || [] })
this.setState({ codeInfo: codeInfo })
this.setState({ isload: true })
_.map(reqCopy.goods, (res) => {
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))
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))
let arr = []
_.map(reqCopy.goods, (res) => {
let obj = {}
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 })
},
(err) => {}
)
})
.catch((err) => {})
}
let arr = []
_.map(reqCopy.goods, (res) => {
let obj = {}
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 })
},
(err) => {}
)
})
.catch((err) => {})
}
/* 转换数据 */
@ -1360,6 +1365,7 @@ export default class exchangedit extends React.Component {
<Button
onClick={(e) => {
this.setState({ drawerVisible2: false })
this.getTableList()
}}>
取消
</Button>