supplier.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import { axios } from '@/utils/request'
  2. // 供应商 列表 有分页
  3. export const supplierList = (params) => {
  4. const url = `/supplier/queryPage/${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. })
  12. }
  13. // 供应商成本变更记录
  14. export const supplierProductCostLogList = (params) => {
  15. const url = `/supplierProductCostLog/queryPage/${params.pageNo}/${params.pageSize}`
  16. delete params.pageNo
  17. delete params.pageSize
  18. return axios({
  19. url: url,
  20. data: params,
  21. method: 'post'
  22. })
  23. }
  24. // 成本变更导出明细
  25. export const supplierProductCostLogExport = params => {
  26. return axios.request({
  27. url: `/supplierProductCostLog/export`,
  28. method: 'post',
  29. data: params,
  30. responseType: 'blob'
  31. })
  32. }
  33. // 供应商 列表 无分页
  34. export const supplierAllList = (params) => {
  35. return axios({
  36. url: '/supplier/queryAll',
  37. method: 'get'
  38. })
  39. }
  40. // 供应商 详情
  41. export const supplierDetail = (params) => {
  42. return axios({
  43. url: `/supplier/findBySn/${params.sn}`,
  44. method: 'get'
  45. })
  46. }
  47. // 供应商 保存
  48. export const supplierSave = (params) => {
  49. return axios({
  50. url: '/supplier/save',
  51. data: params,
  52. method: 'post'
  53. })
  54. }
  55. // 启用禁用
  56. export const updateEnableStatus = (params) => {
  57. return axios({
  58. url: `/supplier/enable/${params.sn}/${params.flag}`,
  59. data: params,
  60. method: 'post'
  61. })
  62. }
  63. // 分页查询供应商产品列表
  64. export const supplierProductList = (params) => {
  65. const url = `/supplierProduct/queryPage/${params.pageNo}/${params.pageSize}`
  66. delete params.pageNo
  67. delete params.pageSize
  68. return axios({
  69. url: url,
  70. data: params,
  71. method: 'post'
  72. })
  73. }
  74. // 设置成本价
  75. export const settingCost = (params) => {
  76. return axios({
  77. url: `/supplierProduct/settingCost`,
  78. data: params,
  79. method: 'post'
  80. })
  81. }
  82. // 删除产品信息
  83. export const deleteProduct = (params) => {
  84. return axios({
  85. url: `/supplierProduct/deleteProduct/${params.sn}`,
  86. method: 'get'
  87. })
  88. }
  89. // 添加产品信息
  90. export const addProduct = (params) => {
  91. return axios({
  92. url: `/supplierProduct/addProduct`,
  93. data: params,
  94. method: 'post'
  95. })
  96. }
  97. // 查询供应商产品sn集合
  98. export const supplierProductSnList = (params) => {
  99. return axios({
  100. url: `/supplierProduct/queryProductSnList/${params.sn}`,
  101. method: 'get'
  102. })
  103. }
  104. // 供应商关联产品 下载模板
  105. export const supplierProductDownload = params => {
  106. return axios.request({
  107. url: `/supplierProduct/downloadExcel`,
  108. method: 'post',
  109. responseType: 'blob'
  110. })
  111. }
  112. // 设置成本导出明细
  113. export const supplierProductExportDetail = params => {
  114. return axios.request({
  115. url: `/supplierProduct/export`,
  116. method: 'post',
  117. data: params,
  118. responseType: 'blob'
  119. })
  120. }
  121. // 审核成本价
  122. export const supplierProductUpdateAuditState = params => {
  123. return axios.request({
  124. url: `/supplierProduct/updateAuditState`,
  125. method: 'post',
  126. data: params
  127. })
  128. }
  129. // 供应商关联产品 解析导入的文件
  130. export const supplierProductParseProducts = params => {
  131. return axios({
  132. url: '/supplierProduct/parseProducts',
  133. data: params,
  134. method: 'post'
  135. })
  136. }
  137. // 供应商关联产品 批量插入
  138. export const supplierProductBatchInsert = params => {
  139. return axios({
  140. url: '/supplierProduct/batchInsert',
  141. data: params,
  142. method: 'post'
  143. })
  144. }
  145. // 供应商关联产品 导入产品 导出错误项
  146. export const supplierProductailExcel = (params) => {
  147. return axios({
  148. url: '/supplierProduct/downloadFailExcel',
  149. data: params,
  150. method: 'post',
  151. responseType: 'blob'
  152. })
  153. }