Commit f18da48c authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 添加productType字段处理交易规则渠道商品跳转异常问题

parent 160bd7ba
......@@ -33,7 +33,9 @@ const AddRule:React.FC<{}> = () => {
name: item.name,
category: item.customerCategoryName,
priceType: item.priceType,
brand: item.brandName
brand: item.brandName,
// 标识渠道商品 1是 0否
productType: item.productType,
}))
const params = omit(values, ['status']) // 移除不需要的字段
......
......@@ -91,7 +91,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
dataIndex: 'name',
title: intl.formatMessage({ id: 'processRuleSetting.shangpinmingcheng', defaultMessage: '商品名称' }),
key: 'name',
render: (_, record) => <EyePreview url={`/memberCenter/commodityAbility/commodity/products/detail?id=${record.commodityId}`}>{_}</EyePreview>
render: (_, record) => <EyePreview url={
record.productType === 1
?
`/memberCenter/commodityAbility/commodity/products/directChannel/detail?id=${record.commodityId}`
:
`/memberCenter/commodityAbility/commodity/products/detail?id=${record.commodityId}`
}>{_}</EyePreview>
},
{
dataIndex: 'customerCategoryName',
......@@ -132,7 +138,12 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const handleOkAddProduct = async () => {
setVisibleChannelRroduct(false)
setProductsLength(productRowCtl.selectRow.length);
addSchemaAction.setFieldValue('products', productRowCtl.selectRow)
console.log(productRowCtl.selectRow)
// productType 1是 0否渠道商品
addSchemaAction.setFieldValue('products', productRowCtl.selectRow.map(item => ({
...item,
productType: item.isChannelCommodity === undefined ? item.productType : +item.isChannelCommodity
})))
clearModalParams()
}
......@@ -311,6 +322,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
commodityId: item.productId,
customerCategoryName: item.category,
brandName: item.brand,
productType: item.productType,
})))
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment