修改 商品和立减金type字段

This commit is contained in:
wangsongsole 2022-05-27 11:44:16 +08:00
parent 506a7ae032
commit 9ce82c2e26
4 changed files with 31 additions and 45 deletions

View File

@ -410,7 +410,7 @@ export default class acclist extends React.Component {
/* 处理商品 */ /* 处理商品 */
if (this.state.addIsType === 'addProduct') { if (this.state.addIsType === 'addProduct') {
data = JSON.parse(sessionStorage.getItem('productData')).filter( data = JSON.parse(sessionStorage.getItem('productData')).filter(
(item) => item.type !== 'knockGold' (item) => item.type !== 2
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -420,7 +420,7 @@ export default class acclist extends React.Component {
if (index > -1) { if (index > -1) {
item.checked = this.state.tempdata[index].checked item.checked = this.state.tempdata[index].checked
} }
item.type = 'addProduct' item.type = 1
item.only = item.product_id item.only = item.product_id
item.upstream = '直连天下' item.upstream = '直连天下'
return item return item
@ -440,7 +440,7 @@ export default class acclist extends React.Component {
} else { } else {
/* 处理立减金 */ /* 处理立减金 */
data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter( data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter(
(item) => item.type !== 'addProduct' (item) => item.type !== 1
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -457,7 +457,7 @@ export default class acclist extends React.Component {
product_name: item.batch_goods_name, //名字 product_name: item.batch_goods_name, //名字
channel_activity_id: item.channel_activity_id, //批次号 channel_activity_id: item.channel_activity_id, //批次号
only: item.channel_activity_id, //批次号 only: item.channel_activity_id, //批次号
type: 'knockGold', //类型 type: 2, //类型
upstream: item.channel === '1' ? '支付宝' : '微信', //上游 upstream: item.channel === '1' ? '支付宝' : '微信', //上游
effectDate: effectDate:
item.time_limit.effect_time.start_time + item.time_limit.effect_time.start_time +
@ -556,7 +556,7 @@ export default class acclist extends React.Component {
obj.describe_url = item.describe_url obj.describe_url = item.describe_url
obj.detail_url = item.detail_url obj.detail_url = item.detail_url
obj.map_product_name = item.map_product_name obj.map_product_name = item.map_product_name
if (item.type === 'knockGold') { if (item.type === 2) {
obj.channel_activity_id = item.channel_activity_id //批次号 obj.channel_activity_id = item.channel_activity_id //批次号
obj.effectDate = item.effectDate //有效时间 obj.effectDate = item.effectDate //有效时间
} }
@ -997,7 +997,7 @@ export default class acclist extends React.Component {
console.log('keyProductClick 13==>', row) console.log('keyProductClick 13==>', row)
if (this.state.direct_reseller_id > 0) { if (this.state.direct_reseller_id > 0) {
/* 区分立减金 */ /* 区分立减金 */
if (row.type === 'knockGold') { if (row.type === 2) {
const temp = JSON.parse(sessionStorage.getItem('knockGoldData')) const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
const editData = temp.filter( const editData = temp.filter(
(item) => item.channel_activity_id === row.only (item) => item.channel_activity_id === row.only
@ -1606,11 +1606,7 @@ export default class acclist extends React.Component {
}} }}
ComponentHandler={(com, rowData, rowIndex) => { ComponentHandler={(com, rowData, rowIndex) => {
if (com == 'type') { if (com == 'type') {
return ( return <>{rowData.type === 2 ? '立减金' : '商品'}</>
<>
{rowData.type === 'knockGold' ? '立减金' : '商品'}
</>
)
} }
if (com == 'edit') { if (com == 'edit') {
return ( return (

View File

@ -586,7 +586,7 @@ export default class exchangedit extends React.Component {
/* 处理商品 */ /* 处理商品 */
if (this.state.addIsType === 'addProduct') { if (this.state.addIsType === 'addProduct') {
data = JSON.parse(sessionStorage.getItem('productData')).filter( data = JSON.parse(sessionStorage.getItem('productData')).filter(
(item) => item.type !== 'knockGold' (item) => item.type !== 2
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -596,7 +596,7 @@ export default class exchangedit extends React.Component {
if (index > -1) { if (index > -1) {
item.checked = this.state.tempdata[index].checked item.checked = this.state.tempdata[index].checked
} }
item.type = 'addProduct' item.type = 1
item.only = item.product_id item.only = item.product_id
item.upstream = '直连天下' item.upstream = '直连天下'
return item return item
@ -616,7 +616,7 @@ export default class exchangedit extends React.Component {
} else { } else {
/* 处理立减金 */ /* 处理立减金 */
data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter( data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter(
(item) => item.type !== 'addProduct' (item) => item.type !== 1
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -633,7 +633,7 @@ export default class exchangedit extends React.Component {
product_name: item.batch_goods_name, //名字 product_name: item.batch_goods_name, //名字
channel_activity_id: item.channel_activity_id, //批次号 channel_activity_id: item.channel_activity_id, //批次号
only: item.channel_activity_id, //批次号 only: item.channel_activity_id, //批次号
type: 'knockGold', //类型 type: 2, //类型
upstream: item.channel === '1' ? '支付宝' : '微信', //上游 upstream: item.channel === '1' ? '支付宝' : '微信', //上游
effectDate: effectDate:
item.time_limit.effect_time.start_time + item.time_limit.effect_time.start_time +
@ -873,7 +873,7 @@ export default class exchangedit extends React.Component {
(data) => { (data) => {
sessionStorage.setItem('productsList', JSON.stringify(data)) sessionStorage.setItem('productsList', JSON.stringify(data))
/* 区分立减金 */ /* 区分立减金 */
if (rowData.type === 'knockGold') { if (rowData.type === 2) {
const temp = JSON.parse(sessionStorage.getItem('knockGoldData')) const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
const editData = temp.filter( const editData = temp.filter(
(item) => item.channel_activity_id === rowData.only (item) => item.channel_activity_id === rowData.only
@ -1186,11 +1186,7 @@ export default class exchangedit extends React.Component {
}} }}
ComponentHandler={(com, rowData) => { ComponentHandler={(com, rowData) => {
if (com == 'type') { if (com == 'type') {
return ( return <>{rowData.type === 2 ? '立减金' : '商品'}</>
<>
{rowData.type === 'knockGold' ? '立减金' : '商品'}
</>
)
} }
if (com == 'edit') { if (com == 'edit') {
return ( return (

View File

@ -277,7 +277,9 @@ export default class acclist extends React.Component {
let temp = null let temp = null
/* 处理商品 */ /* 处理商品 */
if (this.state.addIsType === 'addProduct') { if (this.state.addIsType === 'addProduct') {
data = JSON.parse(sessionStorage.getItem('productData')) data = JSON.parse(sessionStorage.getItem('productData')).filter(
(item) => item.type !== 2
)
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
return o.product_id == item.product_id return o.product_id == item.product_id
@ -286,7 +288,7 @@ export default class acclist extends React.Component {
if (index > -1) { if (index > -1) {
item.checked = this.state.tempdata[index].checked item.checked = this.state.tempdata[index].checked
} }
item.type = 'addProduct' item.type = 1
item.only = item.product_id item.only = item.product_id
item.upstream = '直连天下' item.upstream = '直连天下'
return item return item
@ -305,7 +307,9 @@ export default class acclist extends React.Component {
this.setState({ rankoptions: arr }) this.setState({ rankoptions: arr })
} else { } else {
/* 处理立减金 */ /* 处理立减金 */
data = JSON.parse(sessionStorage.getItem('knockGoldData')) data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter(
(item) => item.type !== 1
)
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
return o.channel_activity_id === item.channel_activity_id return o.channel_activity_id === item.channel_activity_id
@ -321,7 +325,7 @@ export default class acclist extends React.Component {
product_name: item.batch_goods_name, //名字 product_name: item.batch_goods_name, //名字
channel_activity_id: item.channel_activity_id, //批次号 channel_activity_id: item.channel_activity_id, //批次号
only: item.channel_activity_id, only: item.channel_activity_id,
type: 'knockGold', //类型 type: 2, //类型
upstream: item.channel === '1' ? '支付宝' : '微信', //上游 upstream: item.channel === '1' ? '支付宝' : '微信', //上游
effectDate: effectDate:
item.time_limit.effect_time.start_time + item.time_limit.effect_time.start_time +
@ -436,7 +440,7 @@ export default class acclist extends React.Component {
obj.detail_url = item.detail_url obj.detail_url = item.detail_url
obj.account_type = item.account_type obj.account_type = item.account_type
obj.map_product_name = item.map_product_name obj.map_product_name = item.map_product_name
if (item.type === 'knockGold') { if (item.type === 2) {
obj.channel_activity_id = item.channel_activity_id //批次号 obj.channel_activity_id = item.channel_activity_id //批次号
obj.effectDate = item.effectDate //有效时间 obj.effectDate = item.effectDate //有效时间
} }
@ -806,7 +810,7 @@ export default class acclist extends React.Component {
(data) => { (data) => {
sessionStorage.setItem('productsList', JSON.stringify(data)) sessionStorage.setItem('productsList', JSON.stringify(data))
/* 区分立减金 */ /* 区分立减金 */
if (rowData.type === 'knockGold') { if (rowData.type === 2) {
const temp = JSON.parse(sessionStorage.getItem('knockGoldData')) const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
const editData = temp.filter( const editData = temp.filter(
(item) => item.channel_activity_id === rowData.channel_activity_id (item) => item.channel_activity_id === rowData.channel_activity_id
@ -1463,13 +1467,7 @@ export default class acclist extends React.Component {
) )
} }
if (com == 'type') { if (com == 'type') {
return ( return <>{rowData.type === 2 ? '立减金' : '商品'}</>
<>
{rowData.type === 'knockGold'
? '立减金'
: '商品'}
</>
)
} }
if (com == 'contract_price') { if (com == 'contract_price') {
return ( return (

View File

@ -387,7 +387,7 @@ export default class acclist extends React.Component {
/* 处理商品 */ /* 处理商品 */
if (this.state.addIsType === 'addProduct') { if (this.state.addIsType === 'addProduct') {
data = JSON.parse(sessionStorage.getItem('productData')).filter( data = JSON.parse(sessionStorage.getItem('productData')).filter(
(item) => item.type !== 'knockGold' (item) => item.type !== 2
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -397,7 +397,7 @@ export default class acclist extends React.Component {
if (index > -1) { if (index > -1) {
item.checked = this.state.tempdata[index].checked item.checked = this.state.tempdata[index].checked
} }
item.type = 'addProduct' item.type = 1
item.only = item.product_id item.only = item.product_id
item.upstream = '直连天下' item.upstream = '直连天下'
return item return item
@ -417,7 +417,7 @@ export default class acclist extends React.Component {
} else { } else {
/* 处理立减金 */ /* 处理立减金 */
data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter( data = JSON.parse(sessionStorage.getItem('knockGoldData')).filter(
(item) => item.type !== 'addProduct' (item) => item.type !== 1
) )
temp = _.map(data, (item) => { temp = _.map(data, (item) => {
let index = this.state.tempdata.findIndex((o) => { let index = this.state.tempdata.findIndex((o) => {
@ -433,7 +433,7 @@ export default class acclist extends React.Component {
return { return {
product_name: item.batch_goods_name, //名字 product_name: item.batch_goods_name, //名字
channel_activity_id: item.channel_activity_id, //批次号 channel_activity_id: item.channel_activity_id, //批次号
type: 'knockGold', //类型 type: 2, //类型
only: item.channel_activity_id, only: item.channel_activity_id,
upstream: item.channel === '1' ? '支付宝' : '微信', //上游 upstream: item.channel === '1' ? '支付宝' : '微信', //上游
effectDate: effectDate:
@ -557,7 +557,7 @@ export default class acclist extends React.Component {
obj.describe_url = item.describe_url obj.describe_url = item.describe_url
obj.detail_url = item.detail_url obj.detail_url = item.detail_url
obj.map_product_name = item.map_product_name obj.map_product_name = item.map_product_name
if (item.type === 'knockGold') { if (item.type === 2) {
obj.channel_activity_id = item.channel_activity_id //批次号 obj.channel_activity_id = item.channel_activity_id //批次号
obj.effectDate = item.effectDate //有效时间 obj.effectDate = item.effectDate //有效时间
} }
@ -1060,7 +1060,7 @@ export default class acclist extends React.Component {
console.log('keyProductClick 13==>', row) console.log('keyProductClick 13==>', row)
if (this.state.direct_reseller_id > 0) { if (this.state.direct_reseller_id > 0) {
/* 区分立减金 */ /* 区分立减金 */
if (row.type === 'knockGold') { if (row.type === 2) {
const temp = JSON.parse(sessionStorage.getItem('knockGoldData')) const temp = JSON.parse(sessionStorage.getItem('knockGoldData'))
const editData = temp.filter( const editData = temp.filter(
(item) => item.channel_activity_id === row.only (item) => item.channel_activity_id === row.only
@ -1583,11 +1583,7 @@ export default class acclist extends React.Component {
}} }}
ComponentHandler={(com, rowData, rowIndex) => { ComponentHandler={(com, rowData, rowIndex) => {
if (com == 'type') { if (com == 'type') {
return ( return <>{rowData.type === 2 ? '立减金' : '商品'}</>
<>
{rowData.type === 'knockGold' ? '立减金' : '商品'}
</>
)
} }
if (com == 'edit') { if (com == 'edit') {
return ( return (