Commit ca952db7 authored by 前端-许冠华's avatar 前端-许冠华

Merge branch 'cherry-pick' into 'v2'

fix: 修复新增营销活动新增商品搭配和不能设置两个相同门槛的优惠梯度 See merge request linkseeks-design/pro-platform!17
parents 10fbc7b0 2452f5b3
......@@ -109,7 +109,15 @@ const CouponsListLayout: React.FC<CouponsListLayoutProps> = (props: any) => {
message.warning(remind.message[2])
return
}
let limitValue: number[] = [];
couponSource.forEach(_item => {
limitValue.push(_item.limitValue)
})
if ((new Set(limitValue)).size !== limitValue.length) {
message.error( `${remind.label[1]}阶梯必须大于或小于其他${remind.label[1]}阶梯`)
} else {
onConfirm(couponSource)
}
})
}
......
......@@ -81,7 +81,6 @@ const ProductLayout: React.FC<ProductLayoutProps> = (props: any) => {
required: true, validator: (_rule, value) => {
const pattern = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/;
const pattern1 = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;
console.log(remind, 'remind')
if (!value) {
return Promise.reject(new Error(remind.message[4]));
}
......@@ -114,6 +113,7 @@ const ProductLayout: React.FC<ProductLayoutProps> = (props: any) => {
rules={[{
required: true, validator: (_rule, value) => {
const pattern = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/;
const v = form.getFieldValue(`swapPrice_${index}_${_index}`).validator()
if (!value) {
return Promise.reject(new Error(`${intl.formatMessage({ id: 'marketingAbility.qingshuruhuangoudanjia'})}`));
}
......
......@@ -143,15 +143,23 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
message.warning(remind.message[2])
return
}
let limitValue: number[] = [];
dataSource.forEach(_item => {
limitValue.push(_item.limitValue)
})
if ((new Set(limitValue)).size !== limitValue.length) {
message.error( `${remind.label[1]}阶梯必须大于或小于其他${remind.label[1]}阶梯`)
} else {
onConfirm(dataSource)
}
})
}
const renderFooter = () => {
return (
<div style={{ textAlign: 'right' }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>{ intl.formatMessage({ id: 'marketingAbility.quxiao'}) }</Button>
<Button type="primary" onClick={handleClick}>{ intl.formatMessage({ id: 'marketingAbility.tijiao'}) }</Button>
<Button onClick={onClose} style={{ marginRight: 8 }}>{intl.formatMessage({ id: 'marketingAbility.quxiao' })}</Button>
<Button type="primary" onClick={handleClick}>{intl.formatMessage({ id: 'marketingAbility.tijiao' })}</Button>
</div>
)
}
......@@ -295,7 +303,7 @@ const ListModalLayout: React.FC<ListModalLayoutProps> = (props: any) => {
))}
</Form>
{/* 添加分组 */}
{!isPreview && <Button type="dashed" block icon={<PlusOutlined />} onClick={handleAppend}>{ intl.formatMessage({ id: 'marketingAbility.tianjia'}) }</Button>}
{!isPreview && <Button type="dashed" block icon={<PlusOutlined />} onClick={handleAppend}>{intl.formatMessage({ id: 'marketingAbility.tianjia' })}</Button>}
{/* 弹框: -> 商品 */}
<CollocationLayout
isGift={isGift}
......
......@@ -198,9 +198,14 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
const fields = [...dataSource];
fields.forEach(item => {
if (item.skuId === skuId) {
console.log(params, 'params')
item.goodsSubsidiaryGroupList = [...params]
}
})
form.setFieldsValue({
'productList': fields
})
console.log(fields, 'fields')
setListModalVisible(false)
setDataSource(fields)
}
......@@ -213,6 +218,9 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
item.couponGroupList = [...params]
}
})
form.setFieldsValue({
'productList': fields
})
setListModalVisible(false)
setDataSource(fields)
}
......
......@@ -117,6 +117,7 @@ const AddedMarketing = () => {
return item
})
}
console.log(res.productList, 1086)
// if (res['activityDefined']['assembleTime']) {
// params['activityDefined'].assembleTime = Number(moment(res['activityDefined']['assembleTime']).format('x'));
// }
......
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