Commit 4a4cd802 authored by XieZhiXiong's avatar XieZhiXiong

该更 SelectSearch组件

parent 8050f861
...@@ -97,28 +97,6 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -97,28 +97,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
}, },
] ]
// 获取品牌
const fetchBrand = async () => {
const res = await PublicApi.getProductSelectGetSelectBrand({
name: '',
});
if (res.code === 1000) {
return res.data;
}
return [];
}
// 获取会员品类
const fetchCustomerCategory = async () => {
const res = await PublicApi.getProductSelectGetSelectCustomerCategory({
name: '',
});
if (res.code === 1000) {
return res.data;
}
return [];
}
// 获取单据详情 // 获取单据详情
const getBillInfo = () => { const getBillInfo = () => {
if (!id) { if (!id) {
...@@ -904,8 +882,6 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -904,8 +882,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
'name', 'name',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncSelect('brandId', fetchBrand, ['name', 'id']);
useAsyncSelect('customerCategoryId', fetchCustomerCategory, ['name', 'id']);
}, },
inline: false, inline: false,
} }
......
...@@ -18,6 +18,7 @@ import { ...@@ -18,6 +18,7 @@ import {
DEPENDENT_DOC_INTERNAL, DEPENDENT_DOC_INTERNAL,
} from '@/constants'; } from '@/constants';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
import { PublicApi } from '@/services/api';
const orderDetailSchema: ISchema = { const orderDetailSchema: ISchema = {
type: 'object', type: 'object',
...@@ -778,17 +779,24 @@ export const goodsSearchSchema: ISchema = { ...@@ -778,17 +779,24 @@ export const goodsSearchSchema: ISchema = {
}, },
customerCategoryId: { customerCategoryId: {
type: 'string', type: 'string',
'x-component': 'SearchSelect',
'x-component-props': { 'x-component-props': {
placeholder: '品类', placeholder: '品类',
allowClear: true, fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
style: {
width: '100%',
}
}, },
}, },
brandId: { brandId: {
type: 'string', type: 'string',
enum: [], 'x-component': 'SearchSelect',
'x-component-props': { 'x-component-props': {
placeholder: '品牌', placeholder: '品牌',
allowClear: true, fetchSearch: PublicApi.getProductSelectGetSelectBrand,
style: {
width: '100%',
}
}, },
}, },
submit: { submit: {
......
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