wsj
3 days ago d4610c829833996f91704b3891a5c5845bfe0d6b
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import type { PageResult } from '@/types/api';
 
/** 组织类型。 */
export type OrgType = 'HQ' | 'BRANCH' | 'DEALER' | 'AGENT' | 'DEPT' | 'TEAM';
 
/** 组织响应体(OrgVO)。 */
export interface OrgVO {
  id: number;
  orgName: string;
  orgType?: OrgType;
  parentId?: number | null;
  orgPath?: string;
  leaderId?: number | null;
  region?: string;
  sortOrder?: number;
  status?: boolean;
  children?: OrgVO[];
}
 
/** GET /tenant/organizations/tree 请求参数。 */
export interface TenantOrgTreeRequest {
  /** 传入则返回以该节点为根的子树;不传返回所有根组织。 */
  orgId?: number;
}
 
/** GET /tenant/organizations/tree 响应数据(ResultListOrgVO 的 data)。 */
export type TenantOrgTreeResponse = OrgVO[];
 
/** POST /tenant/organizations 请求体(OrgCreateDTO)。 */
export interface TenantOrgCreateRequest {
  orgName: string;
  /** 组织类型,默认 DEPT。 */
  orgType?: OrgType;
  /** 上级组织 ID,根组织不传。 */
  parentId?: number;
  /** 负责人员工 ID。 */
  leaderId?: number;
  region?: string;
  sortOrder?: number;
}
 
/** POST /tenant/organizations 响应数据(ResultOrgVO 的 data)。 */
export type TenantOrgCreateResponse = OrgVO;
 
/** PUT /tenant/organizations/{id} 请求参数(路径参数 + OrgCreateDTO)。 */
export interface TenantOrgUpdateRequest extends TenantOrgCreateRequest {
  /** 组织 ID(路径参数)。 */
  id: number;
}
 
/** PUT /tenant/organizations/{id} 请求体。 */
export type TenantOrgUpdateBody = Omit<TenantOrgUpdateRequest, 'id'>;
 
/** PUT /tenant/organizations/{id} 响应数据(ResultOrgVO 的 data)。 */
export type TenantOrgUpdateResponse = OrgVO;
 
/** DELETE /tenant/organizations/{id} 请求参数。 */
export interface TenantOrgDeleteRequest {
  /** 组织 ID(路径参数)。 */
  id: number;
}
 
/** DELETE /tenant/organizations/{id} 响应数据(ResultVoid 的 data)。 */
export type TenantOrgDeleteResponse = void;
 
/** PUT /tenant/organizations/{id}/toggle-status 请求参数。 */
export interface TenantOrgToggleStatusRequest {
  /** 组织 ID(路径参数)。 */
  id: number;
}
 
/** PUT /tenant/organizations/{id}/toggle-status 响应数据(ResultVoid 的 data)。 */
export type TenantOrgToggleStatusResponse = void;
 
/** GET /tenant/employees 请求参数(负责人下拉远程搜索)。 */
export interface TenantEmployeeOptionListRequest {
  page?: number;
  size?: number;
  /** 姓名 / 手机号模糊搜索。 */
  keyword?: string;
}
 
/** 负责人选项(EmployeeVO 子集)。 */
export interface DepartmentLeaderOption {
  id: number;
  name: string;
  status?: string;
}
 
/** GET /tenant/employees 响应数据(ResultPageResultEmployeeVO 的 data)。 */
export type TenantEmployeeOptionListResponse = PageResult<DepartmentLeaderOption>;
 
/** GET /tenant/employees/{id} 请求参数(编辑时回填负责人姓名)。 */
export interface DepartmentLeaderDetailRequest {
  /** 员工 ID(路径参数)。 */
  id: number;
}
 
/** GET /tenant/employees/{id} 响应数据(EmployeeVO 子集)。 */
export type DepartmentLeaderDetailResponse = DepartmentLeaderOption;
 
/** ProTable 筛选参数:组织树接口没有查询参数,这些字段仅用于前端本地过滤。 */
export interface DepartmentListQuery {
  orgName?: string;
  orgType?: OrgType;
  status?: 'true' | 'false';
}
 
/** 新增 / 编辑部门表单值。 */
export interface DepartmentFormValues {
  orgName: string;
  orgType: OrgType;
  parentId?: number;
  leaderId?: number;
  region?: string;
  sortOrder?: number;
}