修复问题

This commit is contained in:
wangsongsole 2022-06-02 16:48:08 +08:00
parent ef883e58a7
commit be3e067e79
2 changed files with 13 additions and 24 deletions

View File

@ -493,7 +493,6 @@ export default class acclist extends React.Component {
this.setState({ distdata: tempdata }) this.setState({ distdata: tempdata })
} }
} }
sessionStorage.setItem('knockGoldData', '')
} }
addNewKey() { addNewKey() {
this.props.addNewkey() this.props.addNewkey()
@ -679,6 +678,7 @@ export default class acclist extends React.Component {
} }
rowItemClick(row, rowIndex) { rowItemClick(row, rowIndex) {
debugger
let codeInfo = { let codeInfo = {
//数据模型不可少 //数据模型不可少
code_name: row.title, code_name: row.title,
@ -707,6 +707,7 @@ export default class acclist extends React.Component {
o.checked = true o.checked = true
return o return o
}) })
sessionStorage.setItem('productData', JSON.stringify(row.product)) sessionStorage.setItem('productData', JSON.stringify(row.product))
this.setState({ tempdata: temp, drawerVisible: true }) this.setState({ tempdata: temp, drawerVisible: true })
} }
@ -843,14 +844,18 @@ export default class acclist extends React.Component {
sessionStorage.setItem('productsList', JSON.stringify(data)) sessionStorage.setItem('productsList', JSON.stringify(data))
/* 区分立减金 */ /* 区分立减金 */
if (rowData.type === 2) { if (rowData.type === 2) {
const temp = JSON.parse(sessionStorage.getItem('knockGoldData')) let editData = ''
const editData = temp.filter( if (sessionStorage.getItem('knockGoldData')) {
(item) => item.channel_activity_id === rowData.channel_activity_id const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
) editData = temp.filter(
(item) =>
item.channel_activity_id === rowData.channel_activity_id
)
}
this.setState({ this.setState({
product_title: '编辑立减金', product_title: '编辑立减金',
productData: editData[0], productData: editData[0] ? editData[0] : rowData.origin,
addIsType: 'addKnockGold' addIsType: 'addKnockGold'
}) })
} else { } else {

View File

@ -153,22 +153,6 @@ export default class acclist extends React.Component {
req.code_batch = req.code_batch ? req.code_batch : [] req.code_batch = req.code_batch ? req.code_batch : []
this.setState({ pagetitle: '编辑key' }) this.setState({ pagetitle: '编辑key' })
/* 转换数据结构 */
// req.code_batch.map((item) => {
// item.product?.legal?.map((item1) => {
// item1.type = 1
// item1.only = item1.product_id
// item1.upstream = '直连天下'
// })
// item.product?.reduce?.map((item1) => {
// item1.type = 2
// item1.only = item1.channel_activity_id
// item1.upstream = item.channel === '1' ? '支付宝' : '微信' //上游
// item1.origin = item1
// })
// item.product = [...item.product?.legal, ...item.product?.reduce]
// })
let temp = [] let temp = []
for (let i = 0; i < req.code_batch.length; i++) { for (let i = 0; i < req.code_batch.length; i++) {
let code_batch = req.code_batch[i] let code_batch = req.code_batch[i]
@ -184,7 +168,7 @@ export default class acclist extends React.Component {
} }
req.code_batch[i].disabled = true req.code_batch[i].disabled = true
req.code_batch[i].checked = true req.code_batch[i].checked = true
code_batch.range = range.toString() req.code_batch.range = range.toString()
temp.push(req.code_batch[i]) temp.push(req.code_batch[i])
} }
//获取审批单信息 //获取审批单信息
@ -227,6 +211,7 @@ export default class acclist extends React.Component {
code_batch.range = range.toString() code_batch.range = range.toString()
temp.push(req.code_batch[i]) temp.push(req.code_batch[i])
} }
console.log(temp)
if (req.payment_direction) { if (req.payment_direction) {
let index = this.state.payment_direction.indexOf( let index = this.state.payment_direction.indexOf(
@ -1170,7 +1155,6 @@ export default class acclist extends React.Component {
}, },
{ {
title: '兑换码范围', title: '兑换码范围',
type: 'normal', type: 'normal',
prop: 'range', prop: 'range',
width: 'auto' width: 'auto'