material.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. define([ 'ngResource' ], function() {
  2. angular.module('materialServices', ['ngResource']).factory('Material', ['$resource', function ($resource) {
  3. return $resource('trade/products', {}, {
  4. // 获取全部物料信息
  5. getAll: {
  6. url: 'trade/products',
  7. method: 'GET',
  8. params: {
  9. _status : 'all'
  10. }
  11. },
  12. // 获取全部个人物料信息
  13. getAllByPerson: {
  14. url: 'trade/products/person',
  15. method: 'GET',
  16. params: {
  17. _status : 'all'
  18. }
  19. },
  20. // 删除
  21. deleteBatch: {
  22. url: 'trade/products/:ids',
  23. method: 'DELETE'
  24. },
  25. // 绑定个人物料
  26. setAllProductsByPerson: {
  27. url: 'trade/products/person',
  28. method: 'POST'
  29. },
  30. // 批量保存个人替代物料信息
  31. setProductReplacesByPerson: {
  32. url: 'trade/products/productReplace',
  33. method: 'POST'
  34. },
  35. // 删除所有非标的信息
  36. deleteUnstandardAll: {
  37. url: 'trade/products/unstandard',
  38. method: 'DELETE'
  39. },
  40. // 删除所有非标的信息
  41. deleteStandardAll: {
  42. url: 'trade/products/standard',
  43. method: 'DELETE'
  44. },
  45. // 单个匹配
  46. match: {
  47. url: 'trade/products/match/:id',
  48. method: 'GET'
  49. },
  50. // 根据标准产品进行商品上架
  51. newStockByStandardProduct: {
  52. url: 'trade/products/:id/stock',
  53. method: 'POST'
  54. },
  55. // 一键匹配
  56. matchAll : {
  57. url: 'trade/products/match',
  58. method: 'GET'
  59. },
  60. // 匹配非标产品,非标上架版本
  61. matchNonProduct : {
  62. url: 'trade/products/match/nonProduct',
  63. method: 'GET'
  64. },
  65. // 多选匹配,非标上架版本
  66. matchSelected : {
  67. url: 'trade/products/match/selected',
  68. method: 'POST'
  69. },
  70. // 根据批次获取产品列表
  71. getDataByBatch : {
  72. url: 'trade/products/match/batch',
  73. method: 'GET',
  74. isArray: true
  75. },
  76. updateProduct : {
  77. url: 'trade/products/update',
  78. method: 'POST'
  79. },
  80. // 获取物料交易信息
  81. getProductDetail : {
  82. url: 'trade/products/detail/:id',
  83. method: 'GET'
  84. },
  85. submitProduct: {
  86. url: 'trade/products/validition',
  87. method: 'POST'
  88. },
  89. saveDetail: {
  90. url: 'trade/products/savedetail/:productId',
  91. method: 'POST'
  92. },
  93. //返回标准和非标的数量
  94. getCountOfProduct : {
  95. url: 'trade/products/count',
  96. method: 'GET'
  97. },
  98. //根据物料id的信息获取产品信息
  99. getGoodsByProductId : {
  100. url: 'trade/products/goods/productid/:id',
  101. method: 'GET',
  102. isArray: true
  103. },
  104. //选择保留产品信息后更新在售相关信息
  105. updateInfoAfterChoose : {
  106. url: 'trade/products/update/goods',
  107. method: 'POST'
  108. },
  109. // 导出选择的列表
  110. exportSelectedProduct: {
  111. url: 'trade/products/template/selected/data',
  112. method: 'POST'
  113. },
  114. //批量上架信息
  115. batchPutOn: {
  116. url: 'trade/products/batch',
  117. method: 'PUT'
  118. },
  119. //根据物料id获取替换物料列表
  120. getGoodsListByProductId : {
  121. url: 'trade/products/:id/replaces',
  122. method: 'GET',
  123. isArray: true
  124. },
  125. });
  126. }]);
  127. });