Commit cc8cf398 authored by 卢均锐's avatar 卢均锐

Merge branch 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2

* 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform: fix: 修复优惠券发券明细部分翻译不存在的问题 fix: 修复会员可以重复添加的问题
parents 1847d636 739c37f5
......@@ -205,11 +205,11 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
align: 'center',
},
{
title: intl.formatMessage({ id: 'merchantCoupon.suitUser' }),
title: intl.formatMessage({ id: 'merchantCoupon.suitUsers' }),
dataIndex: 'suitableMemberTypeName',
},
{
title: intl.formatMessage({ id: 'merchantCoupon.memberTypeName' }),
title: intl.formatMessage({ id: 'merchantCoupon.lfy' }),
dataIndex: 'memberTypeName',
},
{
......@@ -252,7 +252,16 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
return;
}
let newData = [...suitableMemberList];
newData = newData.concat(RowCtl.selectRow.map((item) => ({ ...item, disabled: false })));
for (let i = 0; i < RowCtl.selectRow.length; i++) {
const item = RowCtl.selectRow[i];
// 防止重复添加
if (!newData.find((current) => current.onlyId === item.onlyId)) {
newData.push({
...item,
disabled: false,
});
}
}
setSuitableMemberList(newData);
const filtered = newData.map(({ onlyId, disabled, ...rest }) => ({ ...rest }));
triggerChange(filtered);
......
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