修复商品bug

This commit is contained in:
wangsongsole 2022-08-17 17:45:50 +08:00
parent 2dc0c664f1
commit e8d9b6312e
1 changed files with 24 additions and 23 deletions

View File

@ -131,6 +131,18 @@ export default class acclist extends React.Component {
this.setState({ this.setState({
direct_reseller_id: req.direct_reseller_id direct_reseller_id: req.direct_reseller_id
}) })
/* 请求商品数据 */
getProductInfoSelect({
reseller_id: req.direct_reseller_id
}).then((res) => {
if (res.code === 200) {
sessionStorage.setItem(
'productsList',
JSON.stringify(res.data.data)
)
}
})
}) })
}) })
@ -332,29 +344,19 @@ export default class acclist extends React.Component {
} else { } else {
this.setState({ product_title: '新增立减金', newGoldLoading: true }) this.setState({ product_title: '新增立减金', newGoldLoading: true })
} }
let param = {
reseller_id: direct_reseller_ids
}
try { try {
getProductInfoSelect(param).then((res) => { this.setState({ productData: null })
console.log('res ==>1', res) this.setState({ drawerVisible2: true })
console.log('this.state.tempdata ==>', this.state.tempdata) if (type === 'addProduct') {
if (res.code === 200) { this.setState({
sessionStorage.setItem('productsList', JSON.stringify(res.data.data)) newGoodsBtnLoading: false
console.log('res ==>2', res.data.data) })
this.setState({ productData: null }) } else {
this.setState({ drawerVisible2: true }) this.setState({
} newGoldLoading: false
if (type === 'addProduct') { })
this.setState({ }
newGoodsBtnLoading: false
})
} else {
this.setState({
newGoldLoading: false
})
}
})
} catch (err) { } catch (err) {
if (type === 'addProduct') { if (type === 'addProduct') {
this.setState({ this.setState({
@ -832,7 +834,6 @@ export default class acclist extends React.Component {
} }
keyProductClick(row, index) { keyProductClick(row, index) {
console.log('keyProductClick 13==>', row)
if (this.state.direct_reseller_id > 0) { if (this.state.direct_reseller_id > 0) {
/* 区分立减金 */ /* 区分立减金 */
if (row.type === 2) { if (row.type === 2) {