supplier.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. headers:{
  12. 'module': encodeURIComponent('列表查询')
  13. }
  14. })
  15. }
  16. // 供应商成本变更记录
  17. export const supplierProductCostLogList = (params) => {
  18. const url = `/supplierProductCostLog/queryPage/${params.pageNo}/${params.pageSize}`
  19. delete params.pageNo
  20. delete params.pageSize
  21. return axios({
  22. url: url,
  23. data: params,
  24. method: 'post',
  25. headers:{
  26. 'module': encodeURIComponent('列表查询')
  27. }
  28. })
  29. }
  30. // 成本变更导出明细
  31. export const supplierProductCostLogExport = params => {
  32. return axios.request({
  33. url: `/supplierProductCostLog/export`,
  34. method: 'post',
  35. data: params,
  36. responseType: 'blob',
  37. headers:{
  38. 'module': encodeURIComponent('导出')
  39. }
  40. })
  41. }
  42. // 供应商 列表 有权限
  43. export const supplierAuthAllList = (params) => {
  44. return axios({
  45. url: '/bizuser/queryAuthSupplier',
  46. method: 'get'
  47. })
  48. }
  49. // 供应商 列表 无分页
  50. export const supplierAllList = (params) => {
  51. return axios({
  52. url: '/supplier/queryAll',
  53. method: 'get'
  54. })
  55. }
  56. // 供应商 详情
  57. export const supplierDetail = (params) => {
  58. return axios({
  59. url: `/supplier/findBySn/${params.sn}`,
  60. method: 'get'
  61. })
  62. }
  63. // 供应商 保存
  64. export const supplierSave = (params) => {
  65. return axios({
  66. url: '/supplier/save',
  67. data: params,
  68. method: 'post',
  69. headers:{
  70. 'module': encodeURIComponent('新增/编辑')
  71. }
  72. })
  73. }
  74. // 启用禁用
  75. export const updateEnableStatus = (params) => {
  76. return axios({
  77. url: `/supplier/enable/${params.sn}/${params.flag}`,
  78. data: params,
  79. method: 'post',
  80. headers:{
  81. 'module': encodeURIComponent('启用禁用')
  82. }
  83. })
  84. }
  85. // 分页查询供应商产品列表
  86. export const supplierProductList = (params) => {
  87. const url = `/supplierProduct/queryPage/${params.pageNo}/${params.pageSize}`
  88. delete params.pageNo
  89. delete params.pageSize
  90. return axios({
  91. url: url,
  92. data: params,
  93. method: 'post',
  94. headers:{
  95. 'module': encodeURIComponent('列表查询')
  96. }
  97. })
  98. }
  99. // 设置成本价
  100. export const settingCost = (params) => {
  101. return axios({
  102. url: `/supplierProduct/settingCost`,
  103. data: params,
  104. method: 'post',
  105. headers:{
  106. 'module': encodeURIComponent('设置成本价')
  107. }
  108. })
  109. }
  110. // 删除产品信息
  111. export const deleteProduct = (params) => {
  112. return axios({
  113. url: `/supplierProduct/deleteProduct/${params.sn}`,
  114. method: 'get',
  115. headers:{
  116. 'module': encodeURIComponent('删除产品')
  117. }
  118. })
  119. }
  120. // 添加产品信息
  121. export const addProduct = (params) => {
  122. return axios({
  123. url: `/supplierProduct/addProduct`,
  124. data: params,
  125. method: 'post',
  126. headers:{
  127. 'module': encodeURIComponent('增加产品')
  128. }
  129. })
  130. }
  131. // 查询供应商产品sn集合
  132. export const supplierProductSnList = (params) => {
  133. return axios({
  134. url: `/supplierProduct/queryProductSnList/${params.sn}`,
  135. method: 'get'
  136. })
  137. }
  138. // 供应商关联产品 下载模板
  139. export const supplierProductDownload = params => {
  140. return axios.request({
  141. url: `/supplierProduct/downloadExcel`,
  142. method: 'post',
  143. responseType: 'blob',
  144. headers:{
  145. 'module': encodeURIComponent('下载模板')
  146. }
  147. })
  148. }
  149. // 供应商关联产品 下载模板
  150. export const supplierProductNewDownloadExcel = params => {
  151. return axios.request({
  152. url: `/supplierProduct/newDownloadExcel`,
  153. method: 'post',
  154. responseType: 'blob',
  155. headers:{
  156. 'module': encodeURIComponent('下载模板')
  157. }
  158. })
  159. }
  160. // 设置成本导出明细
  161. export const supplierProductExportDetail = params => {
  162. return axios.request({
  163. url: `/supplierProduct/export`,
  164. method: 'post',
  165. data: params,
  166. responseType: 'blob',
  167. headers:{
  168. 'module': encodeURIComponent('导出明细')
  169. }
  170. })
  171. }
  172. // 审核成本价
  173. export const supplierProductUpdateAuditState = params => {
  174. return axios.request({
  175. url: `/supplierProduct/updateAuditState`,
  176. method: 'post',
  177. data: params,
  178. headers:{
  179. 'module': encodeURIComponent(params.supplierProductSnList.length==1 ? '审核' : '批量审核')
  180. }
  181. })
  182. }
  183. // 供应商关联产品 解析导入的文件
  184. export const supplierProductParseProducts = params => {
  185. return axios({
  186. url: '/supplierProduct/parseProducts',
  187. data: params,
  188. method: 'post'
  189. })
  190. }
  191. // 供应商关联产品 解析导入的文件
  192. export const supplierProductParseNewProducts = params => {
  193. return axios({
  194. url: '/supplierProduct/newParseProducts',
  195. data: params,
  196. method: 'post'
  197. })
  198. }
  199. // 供应商关联产品 批量插入
  200. export const supplierProductBatchInsert = params => {
  201. return axios({
  202. url: '/supplierProduct/batchInsert',
  203. data: params,
  204. method: 'post',
  205. headers:{
  206. 'module': encodeURIComponent('导入产品')
  207. }
  208. })
  209. }
  210. export const supplierProductNewBatchInsert = params => {
  211. return axios({
  212. url: '/supplierProduct/newBatchInsert',
  213. data: params,
  214. method: 'post',
  215. headers:{
  216. 'module': encodeURIComponent('批量导入产品')
  217. }
  218. })
  219. }
  220. // 供应商关联产品 导入产品 导出错误项
  221. export const supplierProductailExcel = (params) => {
  222. return axios({
  223. url: '/supplierProduct/downloadFailExcel',
  224. data: params,
  225. method: 'post',
  226. responseType: 'blob',
  227. headers:{
  228. 'module': encodeURIComponent('导出错误项')
  229. }
  230. })
  231. }
  232. export const supplierProductailNewExcel = (params) => {
  233. return axios({
  234. url: '/supplierProduct/newDownloadFailExcel',
  235. data: params,
  236. method: 'post',
  237. responseType: 'blob',
  238. headers:{
  239. 'module': encodeURIComponent('导出错误项')
  240. }
  241. })
  242. }