supplier.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 supplierAllList = (params) => {
  15. return axios({
  16. url: '/supplier/queryAll',
  17. method: 'get'
  18. })
  19. }
  20. // 供应商 详情
  21. export const supplierDetail = (params) => {
  22. return axios({
  23. url: `/supplier/findBySn/${params.sn}`,
  24. method: 'get'
  25. })
  26. }
  27. // 供应商 保存
  28. export const supplierSave = (params) => {
  29. return axios({
  30. url: '/supplier/save',
  31. data: params,
  32. method: 'post'
  33. })
  34. }
  35. // 启用禁用
  36. export const updateEnableStatus = (params) => {
  37. return axios({
  38. url: `/supplier/enable/${params.sn}/${params.flag}`,
  39. data: params,
  40. method: 'post'
  41. })
  42. }
  43. // 分页查询供应商产品列表
  44. export const supplierProductList = (params) => {
  45. const url = `/supplierProduct/queryPage/${params.pageNo}/${params.pageSize}`
  46. delete params.pageNo
  47. delete params.pageSize
  48. return axios({
  49. url: url,
  50. data: params,
  51. method: 'post'
  52. })
  53. }
  54. // 设置成本价
  55. export const settingCost = (params) => {
  56. return axios({
  57. url: `/supplierProduct/settingCost`,
  58. data: params,
  59. method: 'post'
  60. })
  61. }
  62. // 删除产品信息
  63. export const deleteProduct = (params) => {
  64. return axios({
  65. url: `/supplierProduct/deleteProduct/${params.sn}`,
  66. method: 'get'
  67. })
  68. }
  69. // 添加产品信息
  70. export const addProduct = (params) => {
  71. return axios({
  72. url: `/supplierProduct/addProduct`,
  73. data: params,
  74. method: 'post'
  75. })
  76. }
  77. // 查询供应商产品sn集合
  78. export const supplierProductSnList = (params) => {
  79. return axios({
  80. url: `/supplierProduct/queryProductSnList/${params.sn}`,
  81. method: 'get'
  82. })
  83. }
  84. // 供应商关联产品 下载模板
  85. export const supplierProductDownload = params => {
  86. return axios.request({
  87. url: `/supplierProduct/downloadExcel`,
  88. method: 'post',
  89. responseType: 'blob'
  90. })
  91. }
  92. // 供应商关联产品 解析导入的文件
  93. export const supplierProductParseProducts = params => {
  94. return axios({
  95. url: '/supplierProduct/parseProducts',
  96. data: params,
  97. method: 'post'
  98. })
  99. }
  100. // 供应商关联产品 批量插入
  101. export const supplierProductBatchInsert = params => {
  102. return axios({
  103. url: '/supplierProduct/batchInsert',
  104. data: params,
  105. method: 'post'
  106. })
  107. }
  108. // 供应商关联产品 导入产品 导出错误项
  109. export const supplierProductailExcel = (params) => {
  110. return axios({
  111. url: '/supplierProduct/downloadFailExcel',
  112. data: params,
  113. method: 'post',
  114. responseType: 'blob'
  115. })
  116. }