shopProduct.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import { axios } from '@/utils/request'
  2. // 商城产品列表 有分页
  3. export const shopProductList = (params) => {
  4. const url = `/shopProduct/queryProductPage/${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 shopProductDel = params => {
  18. return axios({
  19. url: '/shopProduct/delete',
  20. data: params,
  21. method: 'post',
  22. headers: {
  23. 'module': encodeURIComponent('删除')
  24. }
  25. })
  26. }
  27. // 商城产品 导出模板
  28. export const shopProductDownloadExcel = params => {
  29. return axios.request({
  30. url: '/shopProduct/downloadExcel',
  31. method: 'post',
  32. data: params,
  33. responseType: 'blob',
  34. headers: {
  35. 'module': encodeURIComponent('下载导入模板')
  36. }
  37. })
  38. }
  39. // 商城产品 导入解析
  40. export const shopProductParseExcel = (params) => {
  41. return axios({
  42. url: '/shopProduct/parseExcel',
  43. data: params,
  44. method: 'post'
  45. })
  46. }
  47. // 商城产品 导出错误项
  48. export const shopProductExport = params => {
  49. return axios.request({
  50. url: '/shopProduct/exportError',
  51. method: 'post',
  52. data: params,
  53. responseType: 'blob',
  54. headers: {
  55. 'module': encodeURIComponent('导出错误项')
  56. }
  57. })
  58. }
  59. // 商城产品 详情
  60. export const shopProductDetail = params => {
  61. return axios({
  62. url: `/shopProduct/queryBySn/${params.shopProductSn}`,
  63. data: params,
  64. method: 'post',
  65. headers: {
  66. 'module': encodeURIComponent('详情')
  67. }
  68. })
  69. }
  70. // 商城产品 批量保存
  71. export const saveBatchProduct = params => {
  72. return axios({
  73. url: '/shopProduct/saveBatchProduct',
  74. data: params,
  75. method: 'post',
  76. headers: {
  77. 'module': encodeURIComponent('批量保存')
  78. }
  79. })
  80. }
  81. // 商城产品 导入产品批量保存
  82. export const saveBatchProductExcel = params => {
  83. return axios({
  84. url: '/shopProduct/saveBatchProductExcel',
  85. data: params,
  86. method: 'post',
  87. headers: {
  88. 'module': encodeURIComponent('批量保存')
  89. }
  90. })
  91. }
  92. // 商城产品 产品保存
  93. export const shopProductSaveProduct = params => {
  94. return axios({
  95. url: '/shopProduct/saveProduct',
  96. data: params,
  97. method: 'post',
  98. headers: {
  99. 'module': encodeURIComponent('保存')
  100. }
  101. })
  102. }
  103. // 商城产品 更新上架、下架状态
  104. export const shopProductUpdateStatus = params => {
  105. return axios({
  106. url: '/shopProduct/updateStatus',
  107. data: params,
  108. method: 'post',
  109. headers: {
  110. 'module': encodeURIComponent('更新状态')
  111. }
  112. })
  113. }
  114. // 获取类目中已选择的产品 列表
  115. export const queryProductSnList = (params) => {
  116. return axios({
  117. url: '/shopProduct/queryProductSnList',
  118. data: params,
  119. method: 'post'
  120. })
  121. }
  122. // 商城目录 列表 无分页
  123. export const queryExtList = (params) => {
  124. return axios({
  125. url: '/shopCategory/queryExtList',
  126. data: params,
  127. method: 'post',
  128. headers: {
  129. 'module': encodeURIComponent('商城目录列表')
  130. }
  131. })
  132. }