Commit 242c11aeb3ed75180069ebb29ac94f95aa75c98f

Authored by 徐欣
1 parent 0a49210d

feat(approval): 审批系统去掉门店业态预设条件:从门店预设条件值中手动提取 bizType 交集

src/pages/approval/components/ShopSelectByBizType/api.ts
1 1 import type { http } from '@/typing/http';
2 2 import request from '@/utils/request';
3   -import { OOP_HOST, } from '@/utils/host';
  3 +import { OOP_HOST } from '@/utils/host';
4 4  
5 5 type P<T> = http.PromiseResp<T>;
6 6  
7 7 export interface QueryParams {
8   - groupId?: number // 集团id
9   - keyword?: string // 查询门店
10   - bizTypes?: string // 门店业态筛选
  8 + groupId?: number; // 集团id
  9 + keyword?: string; // 查询门店
  10 + bizTypes?: string; // 门店业态筛选
  11 + allType?: boolean; // 是否为全业态
11 12 }
12 13  
13 14 export interface ShopItem {
14   - value?: number,
15   - label?: string,
16   - bizType?: number,
17   - children?: ShopItem[]
  15 + value?: number;
  16 + label?: string;
  17 + bizType?: number;
  18 + children?: ShopItem[];
18 19 }
19 20  
20 21 /**
... ... @@ -33,4 +34,4 @@ export function getShopListByBizTypeApi(params: QueryParams): P&lt;ShopItem[]&gt; {
33 34 */
34 35 export function getShopListByDealerApi(params: QueryParams): P<ShopItem[]> {
35 36 return request.get(`${OOP_HOST}/select/dealers/shops`, { params });
36   -}
37 37 \ No newline at end of file
  38 +}
... ...
src/pages/approval/components/ShopSelectByBizType/index.tsx
... ... @@ -50,7 +50,7 @@ function ShopSelectByBizType(
50 50 console.error(`(<ShopSelectByBizType>):\`showIds\` 和 \`hiddenIds\` 不能同时传入。`);
51 51 }
52 52  
53   - const { data: byBizTypeList, loading: byBizTypeLoading } = useInitail(getShopListByBizTypeApi, [], {});
  53 + const { data: byBizTypeList, loading: byBizTypeLoading } = useInitail(getShopListByBizTypeApi, [], { allType: true });
54 54 const { data: byDealerList, loading: byDealerLoading } = useInitail(getShopListByDealerApi, [], {});
55 55 const [type, setType] = useState<1 | 2>(initType);
56 56 const [values, setValues] = useState<LabeledValue[]>(value);
... ...