customer.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import { axios } from '@/utils/request'
  2. // 客户列表 分页
  3. export const custList = (params) => {
  4. const url = `/cust/queryPage/${params.pageNo}/${params.pageSize}`
  5. delete params.pageNo
  6. delete params.pageSize
  7. return axios({
  8. url: url,
  9. data: params,
  10. method: 'post',
  11. headers: {
  12. 'module': encodeURIComponent('客户列表查询')
  13. }
  14. })
  15. }
  16. // 客户列表 不分页
  17. export const custAllList = (params) => {
  18. return axios({
  19. url: `/cust/queryList`,
  20. data: {},
  21. method: 'post',
  22. headers: {
  23. 'module': encodeURIComponent('客户列表查询')
  24. }
  25. })
  26. }
  27. // 新增/编辑客户
  28. export const custSave = params => {
  29. return axios({
  30. url: '/cust/save',
  31. data: params,
  32. method: 'post',
  33. headers: {
  34. 'module': encodeURIComponent(!params.id ? '新增' : '编辑')
  35. }
  36. })
  37. }
  38. // 根据sn修改客户信息
  39. export const updateByCustomerSn = params => {
  40. return axios({
  41. url: '/cust/updateByCustomerSn',
  42. data: params,
  43. method: 'post'
  44. })
  45. }
  46. // 客户详情
  47. export const custFindById = params => {
  48. return axios({
  49. url: `/cust/findById/${params.id}`,
  50. data: {},
  51. method: 'get',
  52. headers: {
  53. 'module': encodeURIComponent('客户详情')
  54. }
  55. })
  56. }
  57. // 删除客户
  58. export const custDel = params => {
  59. return axios({
  60. url: `/cust/delete/${params.id}`,
  61. data: {},
  62. method: 'get',
  63. headers: {
  64. 'module': encodeURIComponent('删除')
  65. }
  66. })
  67. }
  68. // 收款方式 下拉
  69. export const settleStyleFindAllList = (params) => {
  70. return axios({
  71. url: `/settleStyle/findAll`,
  72. data: {},
  73. method: 'post',
  74. headers: {
  75. 'module': encodeURIComponent('收款方式列表')
  76. }
  77. })
  78. }
  79. // 启用禁用
  80. export const updateEnableStatus = params => {
  81. return axios({
  82. url: `/cust/enable/${params.id}/${params.flag}`,
  83. data: {},
  84. method: 'get',
  85. headers: {
  86. 'module': encodeURIComponent(params.flag == 0 ? '禁用' : '启用')
  87. }
  88. })
  89. }
  90. // 客户合并
  91. export const custMerge = params => {
  92. return axios({
  93. url: '/cust/merge',
  94. data: params,
  95. method: 'post',
  96. headers: {
  97. 'module': encodeURIComponent('合并客户')
  98. }
  99. })
  100. }
  101. // 合并记录分页
  102. export const custMergeLogList = (params) => {
  103. const url = `/cust/queryMergeLogPage/${params.pageNo}/${params.pageSize}`
  104. delete params.pageNo
  105. delete params.pageSize
  106. return axios({
  107. url: url,
  108. data: params,
  109. method: 'post',
  110. headers: {
  111. 'module': encodeURIComponent('列表查询')
  112. }
  113. })
  114. }