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

fix: 注释下单选商品的品类树筛选

parent dfafcd69
......@@ -189,6 +189,18 @@ export const addOrderModalSchema: ISchema = {
queryParams: {},
}
},
// customerCategoryId: {
// type: 'string',
// 'x-component': 'CustomCategorySearch',
// 'x-component-props': {
// placeholder: '商品品类',
// showSearch: true,
// notFoundContent: null,
// style: { width: '174px' },
// dataoption: [],
// fieldNames: { label: 'title', value: 'id', children: 'children' },
// },
// },
brandId: {
type: 'string',
"x-component": 'SearchSelect',
......
......@@ -3,7 +3,7 @@ import ModalTable, { ModalTableProps } from '@/components/ModalTable'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { fetchOrderApi } from '../../apis'
import { useModalTable } from '../../model/useModalTable'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { FormEffectHooks, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { DELIVERY_TYPE, OrderModalType } from '@/constants'
import { PublicApi } from '@/services/api'
import { EnvironmentOutlined } from '@ant-design/icons'
......@@ -16,6 +16,8 @@ import SearchSelect from '@/components/NiceForm/components/SearchSelect';
import Submit from '@/components/NiceForm/components/Submit';
import DateSelect from '@/components/NiceForm/components/DateSelect';
import { action } from 'mobx'
import { searchCustomerCategoryOptionEffect } from '../../effects'
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch'
export interface ProductModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -216,7 +218,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
formilyProps={{
ctx: {
schema: addOrderModalSchema,
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect },
components: { ModalSearch: Search, SearchSelect, Submit, DateSelect, CustomCategorySearch },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......@@ -230,6 +232,9 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
memberRoleId: schemaAction.getFieldValue('supplyMembersRoleId')
}
})
// FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
// searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
// })
actions.setFieldState('brandId', state => {
state.props['x-component-props'].queryParams = {
memberId: schemaAction.getFieldValue('supplyMembersId'),
......
......@@ -354,3 +354,15 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
})
}
// 高级筛选schema中用于输入搜索商品品类的Effect
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
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