company.js 1.9 KB

123456789101112131415161718192021222324252627282930313233
  1. import http from '@/utils/http'
  2. const baseUrl = 'basic/v4/enterprise/org'
  3. export function getOrgList(data) {
  4. // return http.get(`${baseUrl}/list`, data)
  5. return new Promise(resolove => {
  6. resolove({"data":{"results":[{"id":36,"name":"名师科技","son":[{"id":37,"name":"org1","staffs":[],"son":[{"id":49,"name":"test223","staffs":[],"son":null}]},{"id":50,"name":"dfdfdfdfdsf忒耳机飞飞机的","staffs":[],"son":null}],"staffs":[{"id":161,"name":"名师科技管理员","gender":null,"phone":"18734826752","enterpriseId":58,"tenantId":"2a7d62c4d0a04c96924146afbb7541da","idCard":null,"position":null,"deleteDate":null,"enterDate":null,"icon":null,"userId":"60d405c63aaf4ff0817dd66086fa9c32","orgId":36,"state":3,"version":0},{"id":162,"name":"test1","gender":null,"phone":"18734821111","enterpriseId":58,"tenantId":"2a7d62c4d0a04c96924146afbb7541da","idCard":null,"position":null,"deleteDate":null,"enterDate":"2021-08-09","icon":null,"userId":"83b160df787c4aa09a0f39fc28f96b6e","orgId":36,"state":3,"version":0},{"id":167,"name":"测试人员2","gender":null,"phone":"18834821742","enterpriseId":58,"tenantId":"2a7d62c4d0a04c96924146afbb7541da","idCard":null,"position":null,"deleteDate":null,"enterDate":"2021-08-13","icon":null,"userId":"3e2f29fcfd2e49bd8916bb3de0709e6f","orgId":36,"state":3,"version":0}]}],"totalCount":4,"pageNo":0},"success":true,"msg":""})
  7. })
  8. }
  9. export function addOrg(data) {
  10. return http.post(baseUrl, data)
  11. }
  12. export function editOrg(data) {
  13. return http.put(baseUrl, data)
  14. }
  15. export function delOrg(id) {
  16. return http.del(`${baseUrl}/${id}`)
  17. }
  18. export function transferAdmin(data) {
  19. return http.put('basic/v4/enterprise/admin/transfer', data)
  20. }
  21. const baseUrl1 = 'basic/v4/staff'
  22. export function addStaff(data) {
  23. return http.post(baseUrl1, data)
  24. }
  25. export function editStaff(data) {
  26. return http.put(baseUrl1, data)
  27. }
  28. export function delStaff(id) {
  29. return http.del(`${baseUrl1}/${id}`)
  30. }