supplier.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 supplierAuthAllList = (params) => {
  35. return axios({
  36. url: '/bizuser/queryAuthSupplier',
  37. method: 'get'
  38. })
  39. }
  40. // 供应商 列表 无分页
  41. export const supplierAllList = (params) => {
  42. return axios({
  43. url: '/supplier/queryAll',
  44. method: 'get'
  45. })
  46. }
  47. // 供应商 详情
  48. export const supplierDetail = (params) => {
  49. return axios({
  50. url: `/supplier/findBySn/${params.sn}`,
  51. method: 'get'
  52. })
  53. }
  54. // 供应商 保存
  55. export const supplierSave = (params) => {
  56. return axios({
  57. url: '/supplier/save',
  58. data: params,
  59. method: 'post'
  60. })
  61. }
  62. // 启用禁用
  63. export const updateEnableStatus = (params) => {
  64. return axios({
  65. url: `/supplier/enable/${params.sn}/${params.flag}`,
  66. data: params,
  67. method: 'post'
  68. })
  69. }
  70. // 分页查询供应商产品列表
  71. export const supplierProductList = (params) => {
  72. const url = `/supplierProduct/queryPage/${params.pageNo}/${params.pageSize}`
  73. delete params.pageNo
  74. delete params.pageSize
  75. return axios({
  76. url: url,
  77. data: params,
  78. method: 'post'
  79. })
  80. }
  81. // 设置成本价
  82. export const settingCost = (params) => {
  83. return axios({
  84. url: `/supplierProduct/settingCost`,
  85. data: params,
  86. method: 'post'
  87. })
  88. }
  89. // 删除产品信息
  90. export const deleteProduct = (params) => {
  91. return axios({
  92. url: `/supplierProduct/deleteProduct/${params.sn}`,
  93. method: 'get'
  94. })
  95. }
  96. // 添加产品信息
  97. export const addProduct = (params) => {
  98. return axios({
  99. url: `/supplierProduct/addProduct`,
  100. data: params,
  101. method: 'post'
  102. })
  103. }
  104. // 查询供应商产品sn集合
  105. export const supplierProductSnList = (params) => {
  106. return axios({
  107. url: `/supplierProduct/queryProductSnList/${params.sn}`,
  108. method: 'get'
  109. })
  110. }
  111. // 供应商关联产品 下载模板
  112. export const supplierProductDownload = params => {
  113. return axios.request({
  114. url: `/supplierProduct/downloadExcel`,
  115. method: 'post',
  116. responseType: 'blob'
  117. })
  118. }
  119. // 供应商关联产品 下载模板
  120. export const supplierProductNewDownloadExcel = params => {
  121. return axios.request({
  122. url: `/supplierProduct/newDownloadExcel`,
  123. method: 'post',
  124. responseType: 'blob'
  125. })
  126. }
  127. // 设置成本导出明细
  128. export const supplierProductExportDetail = params => {
  129. return axios.request({
  130. url: `/supplierProduct/export`,
  131. method: 'post',
  132. data: params,
  133. responseType: 'blob'
  134. })
  135. }
  136. // 审核成本价
  137. export const supplierProductUpdateAuditState = params => {
  138. return axios.request({
  139. url: `/supplierProduct/updateAuditState`,
  140. method: 'post',
  141. data: params
  142. })
  143. }
  144. // 供应商关联产品 解析导入的文件
  145. export const supplierProductParseProducts = params => {
  146. return axios({
  147. url: '/supplierProduct/parseProducts',
  148. data: params,
  149. method: 'post'
  150. })
  151. }
  152. // 供应商关联产品 解析导入的文件
  153. export const supplierProductParseNewProducts = params => {
  154. return axios({
  155. url: '/supplierProduct/newParseProducts',
  156. data: params,
  157. method: 'post'
  158. })
  159. }
  160. // 供应商关联产品 批量插入
  161. export const supplierProductBatchInsert = params => {
  162. return axios({
  163. url: '/supplierProduct/batchInsert',
  164. data: params,
  165. method: 'post'
  166. })
  167. }
  168. export const supplierProductNewBatchInsert = params => {
  169. return axios({
  170. url: '/supplierProduct/newBatchInsert',
  171. data: params,
  172. method: 'post'
  173. })
  174. }
  175. // 供应商关联产品 导入产品 导出错误项
  176. export const supplierProductailExcel = (params) => {
  177. return axios({
  178. url: '/supplierProduct/downloadFailExcel',
  179. data: params,
  180. method: 'post',
  181. responseType: 'blob'
  182. })
  183. }
  184. export const supplierProductailNewExcel = (params) => {
  185. return axios({
  186. url: '/supplierProduct/newDownloadFailExcel',
  187. data: params,
  188. method: 'post',
  189. responseType: 'blob'
  190. })
  191. }