index.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import request from '@/config/axios'
  2. export interface DeptVO {
  3. id?: number
  4. name: string
  5. parentId: number
  6. status: number
  7. sort: number
  8. leaderUserId: number
  9. phone: string
  10. email: string
  11. factoryIds: string[]
  12. costCenterIds: string[]
  13. stockLocationIds: string[]
  14. createTime: Date
  15. }
  16. // 查询部门(精简)列表
  17. export const getSimpleDeptList = async (): Promise<DeptVO[]> => {
  18. return await request.get({ url: '/system/dept/simple-list' })
  19. }
  20. // 获取指定部门精简信息列表
  21. export const specifiedSimpleDepts = async (deptId: number): Promise<DeptVO[]> => {
  22. return await request.get({ url: '/system/dept/specifiedSimpleDepts?deptId=' + deptId })
  23. }
  24. export const getTaskWellNames = async (deptId: number, wellName: string) => {
  25. return await request.get({
  26. url: `/rq/iot-project-task/taskWellNames?companyId=${deptId}&wellName=${wellName}`
  27. })
  28. }
  29. // 查询当前用户所属的公司级部门列表 项目 日报
  30. export const companyLevelDepts = async (): Promise<DeptVO[]> => {
  31. return await request.get({ url: '/system/dept/companyLevelDepts' })
  32. }
  33. // 获取公司层级的部门 及所有子部门
  34. export const companyLevelChildrenDepts = async (): Promise<DeptVO[]> => {
  35. return await request.get({ url: '/system/dept/companyLevelChildrenDepts' })
  36. }
  37. // 查询部门列表
  38. export const getDeptPage = async (params: PageParam) => {
  39. return await request.get({ url: '/system/dept/list', params })
  40. }
  41. // 查询部门详情
  42. export const getDept = async (id: number) => {
  43. return await request.get({ url: '/system/dept/get?id=' + id })
  44. }
  45. // 新增部门
  46. export const createDept = async (data: DeptVO) => {
  47. return await request.post({ url: '/system/dept/create', data: data })
  48. }
  49. // 修改部门
  50. export const updateDept = async (params: DeptVO) => {
  51. return await request.put({ url: '/system/dept/update', data: params })
  52. }
  53. // 删除部门
  54. export const deleteDept = async (id: number) => {
  55. return await request.delete({ url: '/system/dept/delete?id=' + id })
  56. }