api.ts
1.6 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
import { http } from "@/typing/http";
import request from "@/utils/request";
import { CAS_HOST } from "@/utils/host";
type PromisePageResp<T> = http.PromisePageResp<T>;
// 列表参数
interface ListParam {
current?: number;
pageSize?: number;
keyword?: string;
shopId?: number;
groupId?: number;
userId?: number;
userName?: string;
teamId?: number;
}
// 列表结果
export interface ListResult {
groupId: number; // 集团id
shopId: number; // 门店id
shopName: string; // 门店名称
roleCode: string; // 角色编码
roleName: string; // 角色名称
teamId: number; // 组id
teamName: string; // 组名
userInfoVOS: Staff[]; // 组员工信息
}
// 机修组员工信息
export interface Staff {
id?: string; // 配置id
staffId: string; // 组员id
staffName: string; // 组员名称
manHoursProp: number; // 工时分成占比(以小数表示,如0.5表示50%,全部组员相加为1)
}
/** 工时分成配置列表 */
export function getListApi(params: ListParam): PromisePageResp<ListResult[]> {
return request.get(`${CAS_HOST}/erp/team/setting/list`, { params });
}
export interface SaveParams {
shopId: number; // 门店id
shopName: string; // 门店名称
teamId: number; // 小组id
teamName: string; // 小组名称
userId?: number; // 用户id
userName?: string; // 用户名称
groupId?: number; // 集团id
userInfoVOS?: Staff[]; // 各组员分成比例配置
}
/** 修改配置 */
export function saveApi(params: SaveParams) {
return request.post(`${CAS_HOST}/erp/team/setting/save`, params);
}