agent.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import request from '@/utils/request'
  2. // 查询代理商列表
  3. export function listAgent(query) {
  4. return request({
  5. url: '/module/agent/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 查询客户商家列表
  11. export function listMerchant(query) {
  12. return request({
  13. url: '/module/merchant/list',
  14. method: 'get',
  15. params: query
  16. })
  17. }
  18. // 查询门店列表
  19. export function listShop(query) {
  20. return request({
  21. url: '/module/agent/shopListByAgentId',
  22. method: 'get',
  23. params: query
  24. })
  25. }
  26. // 查询代理商详细
  27. export function getAgent(id) {
  28. var url = '/module/agent/info'
  29. if (id != undefined){
  30. url = '/module/agent/info?id=' + id
  31. }
  32. return request({
  33. url: url,
  34. method: 'get'
  35. })
  36. }
  37. // 新增代理商
  38. export function addAgent(data) {
  39. return request({
  40. url: '/module/agent',
  41. method: 'post',
  42. data: data
  43. })
  44. }
  45. // 修改代理商
  46. export function updateAgent(data) {
  47. return request({
  48. url: '/module/agent',
  49. method: 'put',
  50. data: data
  51. })
  52. }
  53. // 删除代理商
  54. export function delAgent(id) {
  55. return request({
  56. url: '/module/agent/' + id,
  57. method: 'delete'
  58. })
  59. }
  60. // 导出代理商
  61. export function exportAgent(query) {
  62. return request({
  63. url: '/module/agent/export',
  64. method: 'get',
  65. params: query
  66. })
  67. }
  68. export function getLoginUser() {
  69. return request({
  70. url: '/module/agent/getLoginUser',
  71. method: 'get'
  72. })
  73. }