Commit 8489dbc0 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修复营销活动选择商品高级筛选

parent e08d8611
......@@ -4,7 +4,10 @@ import { ColumnType } from 'antd/lib/table';
import TableModal from '@/pages/transaction/components/tableModal';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { postProductCommodityGetCommoditySkuListByShopId } from '@/services/ProductV2Api';
import { getProductSelectGetSelectBrand, getProductSelectGetSelectCustomerCategory, postProductCommodityGetCommoditySkuListByShopId } from '@/services/ProductV2Api';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
const { onFormMount$ } = FormEffectHooks
export interface CollocationLayoutProps {
/** 活动类型 */
......@@ -122,6 +125,35 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
onConfirm(productList)
}
const useBusinessEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
getProductSelectGetSelectCustomerCategory({ }).then(res => {
const _enum = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
linkage.enum('customerCategoryId', _enum)
}).catch(error => {
console.warn(error)
})
getProductSelectGetSelectBrand({ }).then(res => {
const _enum = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
linkage.enum('brandId', _enum)
}).catch(error => {
console.warn(error)
})
})
}
return (
<TableModal
modalType="Drawer"
......@@ -139,6 +171,7 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "commodityName", FORM_FILTER_PATH)
useBusinessEffects()
}}
schema={{
type: "object",
......
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