Commit 5998174e authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修改营销活动bug

parent 3de74a52
...@@ -38,6 +38,8 @@ interface Iprops { ...@@ -38,6 +38,8 @@ interface Iprops {
useStateEffects?: () => void, useStateEffects?: () => void,
/** rowKey */ /** rowKey */
rowKey?: string, rowKey?: string,
/** 选择的keyId */
activeKey?: string,
/** 禁用 */ /** 禁用 */
getCheckboxProps?: (record: any) => void, getCheckboxProps?: (record: any) => void,
} }
...@@ -56,11 +58,12 @@ const Table: React.FC<Iprops> = (props: any) => { ...@@ -56,11 +58,12 @@ const Table: React.FC<Iprops> = (props: any) => {
interiorStatusFetch, interiorStatusFetch,
useStateEffects, useStateEffects,
rowKey, rowKey,
activeKey,
getCheckboxProps getCheckboxProps
} = props; } = props;
const tableRef = useRef<any>({}); const tableRef = useRef<any>({});
const [selectRow, selectRowFns] = useRowSelectionTable({ const [selectRow, selectRowFns] = useRowSelectionTable({
customKey: rowKey || 'id', customKey: activeKey || 'id',
extendsSelection: { extendsSelection: {
getCheckboxProps: (record) => getCheckboxProps && getCheckboxProps(record) getCheckboxProps: (record) => getCheckboxProps && getCheckboxProps(record)
} }
......
...@@ -34,10 +34,12 @@ interface ProductListProps { ...@@ -34,10 +34,12 @@ interface ProductListProps {
getActivityDefinedBO?: any, getActivityDefinedBO?: any,
/** 过滤的filterSkuId */ /** 过滤的filterSkuId */
filterSkuId?: number[], filterSkuId?: number[],
/** 是否商家自建营销活动 */
itrue?: boolean,
} }
const ProductListLayout: React.FC<ProductListProps> = (props: any) => { const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
const { activityId, form, focus$, shopIdList, fieldApi, getActivityDefinedBO, filterSkuId } = props; const { activityId, form, focus$, shopIdList, fieldApi, getActivityDefinedBO, filterSkuId, itrue } = props;
const [value, setValue] = useState<number>(1); const [value, setValue] = useState<number>(1);
const [productVisible, setProductVisible] = useState<boolean>(false); const [productVisible, setProductVisible] = useState<boolean>(false);
const [listModalVisible, setListModalVisible] = useState<boolean>(false); const [listModalVisible, setListModalVisible] = useState<boolean>(false);
...@@ -128,7 +130,27 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => { ...@@ -128,7 +130,27 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
if (value === 15) { if (value === 15) {
setRemind(remindLayout(value)); setRemind(remindLayout(value));
} }
setProductVisible(flag) if (itrue && flag) {
if (form.getFieldValue('activityDefined') && form.getFieldValue('startTime') && form.getFieldValue('endTime') && form.getFieldValue('activityType')) {
const param = {
activityType: form.getFieldValue('activityType'),
activityDefined: form.getFieldValue('activityDefined'),
startTime: Number(form.getFieldValue('startTime').format('x')),
endTime: Number(form.getFieldValue('endTime').format('x'))
}
PublicApi.postMarketingMerchantActivityGetFilterSkuId(param, { ctlType: 'none' }).then(res => {
if (res.code !== 1000) {
return
}
setIdNotInList([...res.data.filterSkuId, ...idNots]);
setProductVisible(flag)
})
} else {
message.warn('请先完善活动时间和活动规则!')
}
} else {
setProductVisible(flag)
}
} }
const handleSelectActiveProducts = (params) => { const handleSelectActiveProducts = (params) => {
......
...@@ -131,7 +131,7 @@ const ReadyExamineOne = () => { ...@@ -131,7 +131,7 @@ const ReadyExamineOne = () => {
fetchRowkeys={(e) => setRowKeys(e)} fetchRowkeys={(e) => setRowKeys(e)}
columns={columns} columns={columns}
effects="id" effects="id"
rowKey="activityId" // rowKey="activityId"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep1} fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep1}
controllerBtns={controllerBtns} controllerBtns={controllerBtns}
schema={{ schema={{
......
...@@ -131,7 +131,7 @@ const ReadyExamineTwo = () => { ...@@ -131,7 +131,7 @@ const ReadyExamineTwo = () => {
fetchRowkeys={(e) => setRowKeys(e)} fetchRowkeys={(e) => setRowKeys(e)}
columns={columns} columns={columns}
effects="id" effects="id"
rowKey="activityId" // rowKey="activityId"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep2} fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep2}
controllerBtns={controllerBtns} controllerBtns={controllerBtns}
schema={{ schema={{
......
...@@ -123,7 +123,7 @@ const ReadySubmit = () => { ...@@ -123,7 +123,7 @@ const ReadySubmit = () => {
reload={ref} reload={ref}
columns={columns} columns={columns}
effects="id" effects="id"
rowKey="activityId" // rowKey="activityId"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeSubmitSignUp} fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeSubmitSignUp}
selectedRow={true} selectedRow={true}
fetchRowkeys={(e) => setRowKeys(e)} fetchRowkeys={(e) => setRowKeys(e)}
......
...@@ -145,11 +145,16 @@ const ReadySubmitExamine = () => { ...@@ -145,11 +145,16 @@ const ReadySubmitExamine = () => {
}) })
} }
const getCheckboxProps = (record) => {
return { disabled: !record.id }
}
return ( return (
<TableLayout <TableLayout
reload={ref} reload={ref}
selectedRow selectedRow
fetchRowkeys={(e) => setRowKeys(e)} fetchRowkeys={(e) => setRowKeys(e)}
getCheckboxProps={getCheckboxProps}
columns={columns} columns={columns}
effects="id" effects="id"
rowKey="activityId" rowKey="activityId"
......
...@@ -291,7 +291,7 @@ const AddedMarketing = () => { ...@@ -291,7 +291,7 @@ const AddedMarketing = () => {
<BasicInfoLayout form={form} focus$={focus$} isEdit={path === 'edit' ? true : false} /> <BasicInfoLayout form={form} focus$={focus$} isEdit={path === 'edit' ? true : false} />
<ShopLayout onGetShopList={handleGetShopList} onSetShopList={shopList} /> <ShopLayout onGetShopList={handleGetShopList} onSetShopList={shopList} />
<RulesLayout form={form} focus$={focus$} /> <RulesLayout form={form} focus$={focus$} />
{value !== 10 && (<ProductListLayout activityId={activityId && { activityId: activityId }} form={form} focus$={value} shopIdList={shopIdList} filterSkuId={filterSkuId} fieldApi={PublicApi.getMarketingMerchantActivityDetailGoodsPage} />)} {value !== 10 && (<ProductListLayout itrue activityId={activityId && { activityId: activityId }} form={form} focus$={value} shopIdList={shopIdList} fieldApi={PublicApi.getMarketingMerchantActivityDetailGoodsPage} />)}
{value === 10 && (<PrizeListLayout form={form} prizeList={prizeList} focus$={value} />)} {value === 10 && (<PrizeListLayout form={form} prizeList={prizeList} focus$={value} />)}
<PartakeUserLayout onGetLevel={handleGetLevel} onSetLevel={memberLevelList} setMemberType={memberType} /> <PartakeUserLayout onGetLevel={handleGetLevel} onSetLevel={memberLevelList} setMemberType={memberType} />
</Form> </Form>
......
...@@ -98,35 +98,35 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => { ...@@ -98,35 +98,35 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
) )
} }
} }
/** 超限规则 */ // /** 超限规则 */
const exceedRule = (int = 1) => { // const exceedRule = (int = 1) => {
switch (int) { // switch (int) {
case 1: // case 1:
case 2: // case 2:
case 3: // case 3:
case 8: // case 8:
case 4: // case 4:
case 5: // case 5:
case 6: // case 6:
case 7: // case 7:
case 12: // case 12:
case 13: // case 13:
return ( // return (
<Form.Item // <Form.Item
name={['activityDefined', 'exceedRule']} // name={['activityDefined', 'exceedRule']}
tooltip="超限规则表示超过个人限购数量时,超出部分可以设定为原价购买,也可以设定为不可购买" // tooltip="超限规则表示超过个人限购数量时,超出部分可以设定为原价购买,也可以设定为不可购买"
label="超限规则" // label="超限规则"
rules={[{ required: true, message: '请选择超限规则' }]} // rules={[{ required: true, message: '请选择超限规则' }]}
> // >
<Radio.Group> // <Radio.Group>
{OVERRUNRULETYPE(int)?.map(item => ( // {OVERRUNRULETYPE(int)?.map(item => (
<Radio key={item.value} value={item.value}>{item.label}</Radio> // <Radio key={item.value} value={item.value}>{item.label}</Radio>
))} // ))}
</Radio.Group> // </Radio.Group>
</Form.Item> // </Form.Item>
) // )
} // }
} // }
/** 满量/满额/赠送促销类型 */ /** 满量/满额/赠送促销类型 */
const type = (int = 1) => { const type = (int = 1) => {
switch (int) { switch (int) {
...@@ -1018,7 +1018,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => { ...@@ -1018,7 +1018,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
{allowActivity(option?.value)} {allowActivity(option?.value)}
{allowCoupon(option?.value)} {allowCoupon(option?.value)}
{grouPing(option?.value)} {grouPing(option?.value)}
{exceedRule(option?.value)} {/* {exceedRule(option?.value)} */}
{probation(option?.value)} {probation(option?.value)}
{lottery(option?.value)} {lottery(option?.value)}
{advanceSale(option?.value)} {advanceSale(option?.value)}
......
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