employee.ts
1.65 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
import { RpcApiClient } from '../core/rpc-client';
import type { EmployeeRow, RpcListResult } from '../core/types';
/** 员工管理接口。method 与参数名逐字保留老 H5(html/employee/*.html)。 */
class EmployeeApi extends RpcApiClient {
findStaffByPage(params: Record<string, unknown> = {}) {
return this.rpc<RpcListResult<EmployeeRow>>(
'entmicro-account',
'merchants.api.staff.findStaffByPage',
params,
);
}
staffSearchRequest(id: string | number) {
return this.rpc<EmployeeRow>('entmicro-account', 'merchants.api.staff.staffSearchRequest', {
id,
});
}
saveStaff(params: Record<string, unknown>) {
return this.rpc<unknown>('entmicro-account', 'merchants.api.staff.saveStaff', params);
}
updateStaff(params: Record<string, unknown>) {
return this.rpc<unknown>('entmicro-account', 'merchants.api.staff.updateStaff', params);
}
deleteStaff(id: string | number) {
return this.rpc<unknown>('entmicro-account', 'merchants.api.staff.deleteStaff', { id });
}
updateStatus(params: Record<string, unknown>) {
return this.rpc<unknown>('entmicro-account', 'merchants.api.staff.updateStatus', params);
}
updateValPerByStaffId(params: Record<string, unknown>) {
return this.rpc<unknown>(
'entmicro-account',
'merchants.api.staff.updateValPerByStaffId',
params,
);
}
/** 返回后端给出的文件地址;页面必须交给 downloadCenter.url 登记,禁止 window.open。 */
exportData(params: Record<string, unknown>) {
return this.rpc<string>('entmicro-account', 'merchants.api.staff.exportData', params);
}
}
export const employeeApi = new EmployeeApi();