api.ts
2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* @Date: 2021-07-08 16:53:36
* @LastEditors: wangqiang@feewee.cn
* @LastEditTime: 2022-10-08 16:17:27
*/
import { http } from "@/typing/http";
import request from "@/utils/request";
import { OOP_HOST } from "@/utils/host";
import { LabelValueType } from "rc-tree-select/lib/interface";
export interface ShopSelectNewOptions {
bizTypes?: string; // 业态类型集合 ,分割
brands?: string; // 品牌id集合 ,分割
regions?: string; // 区域编码集合 ,分割
dealers?: string; // 商家id集合 ,分割
}
export interface QueryParams extends ShopSelectNewOptions {
type: 1 | 2; // 1 集团维度 2 自定义门店维度
shops?: string; // 门店集合 ,分割
keywords?: string; // 门店关键字搜索
}
export interface ShopItem {
shopId?: number; //门店id
shopFullName?: string; //门店全称
shopShortName?: string; //门店简称
casShopId?: number; //对应售后门店id(只有售前业态门店有)
casShopName?: string; //对应售后门店名称
bizType?: number; //业态类型
region?: Region;
dealer?: DealerOrBrand;
brandList?: DealerOrBrand[]; //只有售前业态门店有
}
export interface Value extends ShopItem, LabelValueType {}
export enum BizType {
"新车销售" = 1,
"售后",
"二手车",
"租车",
}
export interface Region {
bh?: string; // 区域编码
name?: string; // 区域名称
fullName?: string; // 区域全称
}
export interface DealerOrBrand {
id?: number;
name?: string;
}
/**
* @description: 门店选择列表
* @param {QueryParams} params
* @return {http.PromiseResp<ShopItem[]>}
*/
export function getShopListApi(
params: QueryParams
): http.PromiseResp<ShopItem[]> {
return request.get(`${OOP_HOST}/select/shop/classify`, { params });
}
export interface Option {
bizList?: Biz[];
regionList?: Region[];
brandList?: DealerOrBrand[];
dealerList?: DealerOrBrand[];
}
export interface Biz {
type?: number;
name?: string;
}
/**
* @description: 门店选择条件
* @param {QueryParams} params
* @return {http.PromiseResp<Option>}
*/
export function getShopListChooseOptionsApi(
params: QueryParams
): http.PromiseResp<Option> {
return request.get(`${OOP_HOST}/select/shop/filters`, { params });
}