index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { request } from '@/service/request';
  2. /**
  3. * 分页获取商品
  4. * @param params
  5. * @returns
  6. */
  7. export function fetchProductList(data: any) {
  8. return request({
  9. url: '/smqjh-pms/api/v1/goods/goodsList',
  10. method: 'get',
  11. params: data
  12. });
  13. }
  14. /**
  15. * 获取全部渠道商
  16. * @returns
  17. */
  18. export function fetchGetAllChannelList() {
  19. return request<Api.goods.Channel[]>({
  20. url: '/smqjh-system/api/v1/channel/listAll',
  21. method: 'get'
  22. });
  23. }
  24. /**
  25. * 获取一级渠道商
  26. * @returns
  27. */
  28. export function fetchGetChannelList() {
  29. return request<Api.goods.Channel[]>({
  30. url: '/smqjh-system/api/v1/channel/listFirstChannel',
  31. method: 'get'
  32. });
  33. }
  34. /**
  35. *
  36. * 删除商品
  37. * @returns
  38. */
  39. export function fetchDelGoods(id: string) {
  40. return request({
  41. url: `/smqjh-pms/api/v1/goods/${id}`,
  42. method: 'delete'
  43. });
  44. }
  45. /**
  46. * 保存商品
  47. * @returns
  48. */
  49. export function fetchAddGoods(data: any) {
  50. return request<Api.goods.Channel[]>({
  51. url: '/smqjh-pms/api/v1/goods/addDJKGoods',
  52. method: 'post',
  53. data
  54. });
  55. }
  56. /**
  57. * 保存商品
  58. * @returns
  59. */
  60. export function fetchEditGoods(data: any) {
  61. return request<Api.goods.Channel[]>({
  62. url: '/smqjh-pms/api/v1/goods/updateDJKGoods',
  63. method: 'put',
  64. data
  65. });
  66. }
  67. /**
  68. * 商品详情
  69. * @returns
  70. */
  71. export function fetchGoodsDetail(data: any) {
  72. return request<Api.goods.Channel[]>({
  73. url: '/smqjh-pms/api/v1/goods/info',
  74. method: 'put',
  75. data
  76. });
  77. }