companyDept.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import request from '@/utils/request'
  2. // 查询部门列表
  3. export function listDept(query) {
  4. return request({
  5. url: '/company/companyDept/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询部门列表(排除节点)
  11. export function listDeptExcludeChild(deptId) {
  12. return request({
  13. url: '/company/companyDept/list/exclude/' + deptId,
  14. method: 'get'
  15. })
  16. }
  17. // 查询部门详细
  18. export function getDept(deptId) {
  19. return request({
  20. url: '/company/companyDept/' + deptId,
  21. method: 'get'
  22. })
  23. }
  24. // 查询部门下拉树结构
  25. export function treeselect() {
  26. return request({
  27. url: '/company/companyDept/treeselect',
  28. method: 'get'
  29. })
  30. }
  31. export function selectDeptTree(query) {
  32. return request({
  33. url: '/company/companyDept/selectDeptTree',
  34. method: 'get',
  35. params: query
  36. })
  37. }
  38. export function myDeptTreeselect() {
  39. return request({
  40. url: '/company/companyDept/myDeptTreeselect',
  41. method: 'get'
  42. })
  43. }
  44. // 根据角色ID查询部门树结构
  45. export function roleDeptTreeselect(roleId) {
  46. return request({
  47. url: '/company/companyDept/roleDeptTreeselect/' + roleId,
  48. method: 'get'
  49. })
  50. }
  51. // 新增部门
  52. export function addDept(data) {
  53. return request({
  54. url: '/company/companyDept',
  55. method: 'post',
  56. data: data
  57. })
  58. }
  59. // 修改部门
  60. export function updateDept(data) {
  61. return request({
  62. url: '/company/companyDept',
  63. method: 'put',
  64. data: data
  65. })
  66. }
  67. // 删除部门
  68. export function delDept(deptId) {
  69. return request({
  70. url: '/company/companyDept/' + deptId,
  71. method: 'delete'
  72. })
  73. }
  74. export function allTreeselect() {
  75. return request({
  76. url: '/company/companyDept/allTreeselect',
  77. method: 'get'
  78. })
  79. }