good.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import request from '@/utils/request'
  2. // 查询模板列表
  3. export function getSpecList(query) {
  4. return request({
  5. url: '/system/template/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. // 企业列表
  11. export function getTenantList(query) {
  12. return request({
  13. url: '/common/tenant/list',
  14. method: 'get',
  15. params: query
  16. })
  17. }
  18. // 商品复制
  19. export function goodsCopy(data) {
  20. return request({
  21. url: `/goods/batch/copy/add`,
  22. method: 'post',
  23. data
  24. })
  25. }
  26. // 新增或修改模板
  27. export function changeSpec(data) {
  28. return request({
  29. url: `/system/template/${data.specTemplateId ? 'edit' : 'addSpec'}`,
  30. method: 'post',
  31. data
  32. })
  33. }
  34. // 删除规格模板
  35. export function delSpec(id) {
  36. return request({
  37. url: '/system/template/del/' + id,
  38. method: 'get',
  39. })
  40. }
  41. // 模板详情
  42. export function getSpecDetail(id) {
  43. return request({
  44. url: '/system/template/detail/' + id,
  45. method: 'get',
  46. })
  47. }
  48. // 新增规格属性关联
  49. export function relation(data, b) {
  50. return request({
  51. url: `/system/relation/${b ? 'edit' : ''}`,
  52. method: 'post',
  53. data
  54. })
  55. }
  56. // 获得商品模板列表
  57. export function getGoodsSpecList(id) {
  58. return request({
  59. url: '/goods/spec/list/' + id,
  60. method: 'get',
  61. })
  62. }
  63. // 修改商品默认规格模板
  64. export function goodsUpdateSpec(data) {
  65. return request({
  66. url: `/goods/update/spec`,
  67. method: 'post',
  68. data
  69. })
  70. }
  71. // 商品批量上下架
  72. export function goodsUpdateStatus(data) {
  73. return request({
  74. url: `/goods/batch/updateStatus`,
  75. method: 'post',
  76. data
  77. })
  78. }
  79. // 商品批量删除
  80. export function goodsDel(data) {
  81. return request({
  82. url: `/goods/batch/del`,
  83. method: 'post',
  84. data
  85. })
  86. }
  87. // 商品取消绑定规格模板
  88. export function goodCancelBind(data) {
  89. return request({
  90. url: `/goods/cancel/spec`,
  91. method: 'post',
  92. data
  93. })
  94. }
  95. // 新增每日一练试卷时间
  96. export function addExamTime(data) {
  97. return request({
  98. url: `/goods/addExamTime`,
  99. method: 'post',
  100. data
  101. })
  102. }