You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
53 lines
1.5 KiB
import request from '@/config/axios'
|
|
|
|
export interface DeptVO {
|
|
id?: number
|
|
name: string
|
|
parentId: number
|
|
status: number
|
|
sort: number
|
|
leaderUserId: number
|
|
phone: string
|
|
email: string
|
|
createTime: Date
|
|
}
|
|
|
|
// 查询部门(精简)列表
|
|
export const getSimpleDeptList = async (): Promise<DeptVO[]> => {
|
|
return await request.get({ url: '/admin-api/system/dept/list-all-simple' })
|
|
}
|
|
|
|
// 查询部门列表
|
|
export const getDeptPage = async (params) => {
|
|
return await request.get({ url: '/admin-api/system/dept/list', params })
|
|
}
|
|
|
|
// 查询部门详情
|
|
export const getDept = async (id: number) => {
|
|
return await request.get({ url: '/admin-api/system/dept/get?id=' + id })
|
|
}
|
|
|
|
// 新增部门
|
|
export const createDept = async (data: DeptVO) => {
|
|
return await request.post({ url: '/admin-api/system/dept/create', data: data })
|
|
}
|
|
|
|
// 修改部门
|
|
export const updateDept = async (params: DeptVO) => {
|
|
return await request.put({ url: '/admin-api/system/dept/update', data: params })
|
|
}
|
|
|
|
// 删除部门
|
|
export const deleteDept = async (id: number) => {
|
|
return await request.delete({ url: '/admin-api/system/dept/delete?id=' + id })
|
|
}
|
|
|
|
// 获取部门业务指标
|
|
export const getDeptTarget = async (deptId: number) => {
|
|
return await request.get({ url: '/admin-api/crm/dept-target/get', params: { deptId } })
|
|
}
|
|
|
|
// 更新部门业务指标
|
|
export const updateDeptTarget = async (data: any) => {
|
|
return await request.put({ url: '/admin-api/crm/dept-target/save', data, isSubmitForm: true })
|
|
}
|
|
|