index.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. import request from '@/utils/request';
  2. // ==================== 部门管理 ====================
  3. /**
  4. * 查询部门树
  5. */
  6. export function getDeptTree() {
  7. return request({
  8. url: '/customer/organization/dept/tree',
  9. method: 'get'
  10. });
  11. }
  12. /**
  13. * 查询部门列表
  14. */
  15. export function getDeptList(params?: any) {
  16. return request({
  17. url: '/customer/organization/dept/list',
  18. method: 'get',
  19. params: params
  20. });
  21. }
  22. /**
  23. * 查询部门详情
  24. */
  25. export function getDeptInfo(id: number) {
  26. return request({
  27. url: `/customer/organization/dept/${id}`,
  28. method: 'get'
  29. });
  30. }
  31. /**
  32. * 新增部门
  33. */
  34. export function addDept(data: any) {
  35. return request({
  36. url: '/customer/organization/dept',
  37. method: 'post',
  38. data: data
  39. });
  40. }
  41. /**
  42. * 修改部门
  43. */
  44. export function updateDept(data: any) {
  45. return request({
  46. url: '/customer/organization/dept',
  47. method: 'put',
  48. data: data
  49. });
  50. }
  51. /**
  52. * 删除部门
  53. */
  54. export function deleteDept(ids: number[]) {
  55. return request({
  56. url: `/customer/organization/dept/${ids.join(',')}`,
  57. method: 'delete'
  58. });
  59. }
  60. // ==================== 人员管理 ====================
  61. /**
  62. * 获取当前登录用户的个人信息
  63. */
  64. export function getCurrentUserInfo() {
  65. return request({
  66. url: '/customer/organization/contact/current',
  67. method: 'get'
  68. });
  69. }
  70. /**
  71. * 查询联系人列表
  72. */
  73. export function getContactList(params?: any) {
  74. return request({
  75. url: '/customer/organization/contact/list',
  76. method: 'get',
  77. params: params
  78. });
  79. }
  80. /**
  81. * 查询联系人详情
  82. */
  83. export function getContactInfo(id: number | string) {
  84. return request({
  85. url: `/customer/organization/contact/${id}`,
  86. method: 'get'
  87. });
  88. }
  89. /**
  90. * 新增联系人
  91. */
  92. export function addContact(data: any) {
  93. return request({
  94. url: '/customer/organization/contact',
  95. method: 'post',
  96. data: data
  97. });
  98. }
  99. /**
  100. * 修改联系人
  101. */
  102. export function updateContact(data: any) {
  103. return request({
  104. url: '/customer/organization/contact',
  105. method: 'put',
  106. data: data
  107. });
  108. }
  109. /**
  110. * 删除联系人
  111. */
  112. export function deleteContact(ids: number[]) {
  113. return request({
  114. url: `/customer/organization/contact/${ids.join(',')}`,
  115. method: 'delete'
  116. });
  117. }
  118. /**
  119. * 修改主联系人
  120. * @param id
  121. */
  122. export function changeIsPrimary(id: string | number, isPrimary: string) {
  123. const data = {
  124. id,
  125. isPrimary
  126. };
  127. return request({
  128. url: '/customer/organization/contact/changeIsPrimary',
  129. method: 'put',
  130. data: data
  131. });
  132. }
  133. // ==================== 角色管理 ====================
  134. /**
  135. * 查询角色列表
  136. */
  137. export function getRoleList(params?: any) {
  138. return request({
  139. url: '/system/organization/role/list',
  140. method: 'get',
  141. params: params
  142. });
  143. }
  144. /**
  145. * 查询角色详情
  146. */
  147. export function getRoleInfo(id: number) {
  148. return request({
  149. url: `/system/organization/role/${id}`,
  150. method: 'get'
  151. });
  152. }
  153. /**
  154. * 新增角色
  155. */
  156. export function addRole(data: any) {
  157. return request({
  158. url: '/system/organization/role',
  159. method: 'post',
  160. data: data
  161. });
  162. }
  163. /**
  164. * 修改角色
  165. */
  166. export function updateRole(data: any) {
  167. return request({
  168. url: '/system/organization/role',
  169. method: 'put',
  170. data: data
  171. });
  172. }
  173. /**
  174. * 删除角色
  175. */
  176. export function deleteRole(ids: number[]) {
  177. return request({
  178. url: `/system/organization/role/${ids.join(',')}`,
  179. method: 'delete'
  180. });
  181. }
  182. // ==================== 人员管理 ====================
  183. /**
  184. * 查询人员列表
  185. */
  186. export function getComStaffList(params?: any) {
  187. return request({
  188. url: '/system/organization/comStaff/list',
  189. method: 'get',
  190. params: params
  191. });
  192. }
  193. /**
  194. * 查询人员详情
  195. */
  196. export function getComStaffInfo(id: number) {
  197. return request({
  198. url: `/system/organization/comStaff/${id}`,
  199. method: 'get'
  200. });
  201. }
  202. /**
  203. * 新增人员
  204. */
  205. export function addComStaff(data: any) {
  206. return request({
  207. url: '/system/organization/comStaff',
  208. method: 'post',
  209. data: data
  210. });
  211. }
  212. /**
  213. * 修改人员
  214. */
  215. export function updateComStaff(data: any) {
  216. return request({
  217. url: '/system/organization/comStaff',
  218. method: 'put',
  219. data: data
  220. });
  221. }
  222. /**
  223. * 删除人员
  224. */
  225. export function deleteComStaff(ids: number[]) {
  226. return request({
  227. url: `/system/organization/comStaff/${ids.join(',')}`,
  228. method: 'delete'
  229. });
  230. }