procurement.service.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. * 集采需求数据请求
  3. */
  4. export default class ProcurementService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'ProcurementService'
  8. }
  9. /**
  10. * 所有集采
  11. * @param pageNo 页数
  12. * @param pageSize 长度
  13. */
  14. procurementAllList(data = {}) {
  15. return this.AjaxService.get({
  16. url:'/commodity/procurement/findList',
  17. data,
  18. isLoading: false,
  19. })
  20. }
  21. /**
  22. * 集采详情
  23. * @param {number} id 集采id
  24. */
  25. procurementDetail(data={}) {
  26. return this.AjaxService.get({
  27. url: '/commodity/procurement/detail',
  28. data,
  29. isLoading: false,
  30. })
  31. }
  32. /**
  33. * 集采tab 我参与的 我创建的
  34. * @param {number} userId 用户id
  35. * @param {number} procurementType = [0, 1] 0 我参与的 1 我发起的
  36. */
  37. procurementTabChange(data={}) {
  38. return this.AjaxService.get({
  39. url: '/commodity/procurement/procurement',
  40. data,
  41. isLoading: true,
  42. })
  43. }
  44. /**
  45. * 发布集采 | 修改集采
  46. * @param id id
  47. * @param userId 发布人id
  48. * @param userName 用户名
  49. * @param productImage 商品图片
  50. * @param productName 商品名称
  51. * @param price 期望单价
  52. * @param number 购买数量
  53. */
  54. procurementSave(data={}) {
  55. return this.AjaxService.post({
  56. url: '/commodity/procurement/saveProcurement',
  57. data,
  58. isLoading: true,
  59. })
  60. }
  61. /**
  62. * 参与集采
  63. * @param userId 发布人id
  64. * @param productImage 商品图片
  65. * @param productName 商品名称
  66. * @param price 期望单价
  67. * @param number 购买数量
  68. */
  69. procurementParticipate(data={}) {
  70. return this.AjaxService.post({
  71. url: '/commodity/procurement/pateProcurement',
  72. data,
  73. isLoading: true,
  74. })
  75. }
  76. /**
  77. * 删除集采 | 退出集采
  78. * @param id 集采id
  79. * @param {number} userId 用户id
  80. * @param {number} procurementType = [0, 1] 0 删除集采 1 退出集采
  81. */
  82. procurementUpdate(data={}) {
  83. return this.AjaxService.get({
  84. url: '/commodity/procurement/updateProcurement',
  85. data,
  86. isLoading: true,
  87. })
  88. }
  89. /**
  90. * 修改集采信息回显
  91. * @param id 集采id
  92. * @param {number} userId 用户id
  93. * @param {number} procurementType = [0, 1] 0 我参与的 1 我发起的
  94. */
  95. procurementEditData(data={}) {
  96. return this.AjaxService.get({
  97. url: '/commodity/procurement/editData',
  98. data,
  99. isLoading: true,
  100. })
  101. }
  102. }