Commit e13b609e29be7e1105941deeec7eabd5913bf84c
1 parent
ee90b960
feat(carinsur): 新增贷款期客户保险配置功能
Showing
1 changed file
with
34 additions
and
17 deletions
src/pages/carinsur/LoanClientRequires/components/Filter/index.tsx
1 | 1 | import React from 'react'; |
2 | -import { Row } from 'antd'; | |
2 | +import { Row, Select } from 'antd'; | |
3 | 3 | import _ from 'lodash'; |
4 | 4 | import type { PageParams } from '../../api'; |
5 | +import { getBrandFilterApi, getSaleSeries, getShopApi } from '@/common/api'; | |
6 | +import useInitial from '@/hooks/useInitail'; | |
5 | 7 | |
6 | 8 | interface Props { |
7 | 9 | innerParams?: any; |
... | ... | @@ -9,37 +11,52 @@ interface Props { |
9 | 11 | } |
10 | 12 | |
11 | 13 | function Filter({ innerParams, setParams }: Props) { |
14 | + const { data: brands } = useInitial(getBrandFilterApi, [], {}); | |
15 | + const { data: series } = useInitial(getSaleSeries, [], {}); | |
16 | + const { data: shops } = useInitial<CommonApi.OptionVO[], undefined>(getShopApi, [], undefined); | |
17 | + | |
12 | 18 | const onChange = _.debounce((newParams) => { |
13 | 19 | setParams({ ...innerParams, ...newParams }, true); |
14 | 20 | }, 600); |
15 | 21 | |
16 | 22 | return ( |
17 | 23 | <Row style={{ display: 'flex', flex: 1 }}> |
18 | - {/* <Select | |
24 | + <Select | |
25 | + style={{ width: 200 }} | |
26 | + showSearch | |
27 | + allowClear | |
28 | + // optionFilterProp="children" | |
29 | + placeholder="筛选品牌" | |
30 | + options={brands} | |
31 | + fieldNames={{ label: 'name', value: 'id' }} | |
32 | + onChange={(value) => { | |
33 | + onChange({ brandId: value }); | |
34 | + }} | |
35 | + /> | |
36 | + <Select | |
37 | + style={{ width: 200, marginLeft: 20 }} | |
19 | 38 | showSearch |
20 | 39 | allowClear |
21 | - optionFilterProp="children" | |
22 | - placeholder="筛选授权角色" | |
40 | + // optionFilterProp="children" | |
41 | + placeholder="筛选车系" | |
42 | + options={series} | |
43 | + fieldNames={{ label: 'name', value: 'id' }} | |
23 | 44 | onChange={(value) => { |
24 | - onChange({ roles: value }); | |
45 | + onChange({ seriesId: value }); | |
25 | 46 | }} |
26 | - > | |
27 | - {roleList.map((i) => ( | |
28 | - <Option value={i.roleCode} key={i.roleCode}> | |
29 | - {i.roleName} | |
30 | - </Option> | |
31 | - ))} | |
32 | - </Select> | |
47 | + /> | |
33 | 48 | <Select |
49 | + style={{ width: 200, marginLeft: 20 }} | |
34 | 50 | showSearch |
35 | 51 | allowClear |
36 | - optionFilterProp="children" | |
37 | - placeholder="筛选往来对象类型" | |
38 | - options={TradeTypeOptions} | |
52 | + // optionFilterProp="children" | |
53 | + placeholder="筛选门店" | |
54 | + options={shops} | |
55 | + fieldNames={{ label: 'name', value: 'id' }} | |
39 | 56 | onChange={(value) => { |
40 | - onChange({ tradeObjType: value }); | |
57 | + onChange({ shopId: value }); | |
41 | 58 | }} |
42 | - /> */} | |
59 | + /> | |
43 | 60 | </Row> |
44 | 61 | ); |
45 | 62 | } | ... | ... |