purchaseReturnApply.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. import { axios } from '@/utils/request'
  2. // 采购退货申请单列表 分页
  3. export const purchaseReturnList = (params) => {
  4. const url = `/purchaseReturnApply/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 purchaseReturnSave = (params) => {
  18. return axios({
  19. url: '/purchaseReturnApply/create',
  20. data: params,
  21. method: 'post',
  22. headers:{
  23. 'module': encodeURIComponent('新增')
  24. }
  25. })
  26. }
  27. // 采购退货申请单 删除
  28. export const purchaseReturnDel = (params) => {
  29. return axios({
  30. url: `/purchaseReturnApply/delete`,
  31. data: params,
  32. method: 'post',
  33. headers:{
  34. 'module': encodeURIComponent('删除')
  35. }
  36. })
  37. }
  38. // 生成采购退货单
  39. export const createPurchaseReturnBill = (params) => {
  40. return axios({
  41. url: `/purchaseReturnApply/createPurchaseReturnBill`,
  42. data: params,
  43. method: 'post',
  44. headers:{
  45. 'module': encodeURIComponent('生成采购退货单')
  46. }
  47. })
  48. }
  49. // 选择产品列表
  50. export const queryDealerScopeProductPage = (params) => {
  51. const url = `/purchaseReturnApply/queryDealerScopeProductPage/${params.pageNo}/${params.pageSize}`
  52. delete params.pageNo
  53. delete params.pageSize
  54. return axios({
  55. url: url,
  56. data: params,
  57. method: 'post',
  58. headers:{
  59. 'module': encodeURIComponent('可选产品列表')
  60. }
  61. })
  62. }
  63. // 采购退货 详情 添加产品
  64. export const purchaseReturnDetailSave = (params) => {
  65. return axios({
  66. url: '/purchaseReturnApply/detail/create',
  67. data: params,
  68. method: 'post',
  69. headers:{
  70. 'module': encodeURIComponent('添加')
  71. }
  72. })
  73. }
  74. // 采购退货申请单 详情 删除
  75. export const purchaseReturnDetailDel = (params) => {
  76. return axios({
  77. url: `/purchaseReturnApply/detail/delete`,
  78. data: params,
  79. method: 'post',
  80. headers:{
  81. 'module': encodeURIComponent('删除')
  82. }
  83. })
  84. }
  85. // 采购退货 详情 全部删除
  86. export const purchaseReturnDetailDelAll = (params) => {
  87. return axios({
  88. url: `/purchaseReturnApply/detail/deleteAll`,
  89. data: params,
  90. method: 'post',
  91. headers:{
  92. 'module': encodeURIComponent('清空列表')
  93. }
  94. })
  95. }
  96. // 申请单详情修改数量
  97. export const purchaseReturnModifyQty = (params) => {
  98. return axios({
  99. url: `/purchaseReturnApply/detail/modifyQty`,
  100. data: params,
  101. method: 'post',
  102. headers:{
  103. 'module': encodeURIComponent('修改数量')
  104. }
  105. })
  106. }
  107. // 申请单详情修改退货原因
  108. // 修改备注
  109. export const modifyReturnInfo = (params) => {
  110. return axios({
  111. url: `/purchaseReturnApply/detail/modifyInfo`,
  112. data: params,
  113. method: 'post',
  114. headers:{
  115. 'module': encodeURIComponent(params.returnReason ? '修改退货原因' : '修改备注')
  116. }
  117. })
  118. }
  119. // 批量修改退货原因
  120. export const modifyReturnReasonList = (params) => {
  121. return axios({
  122. url: `/purchaseReturnApply/detail/modifyInfoList`,
  123. data: params,
  124. method: 'post',
  125. headers:{
  126. 'module': encodeURIComponent('批量设置退货原因')
  127. }
  128. })
  129. }
  130. // 申请单详情列表 分页
  131. export const purchaseReturnDetailList = (params) => {
  132. const url = `/purchaseReturnApply/detail/queryPage/${params.pageNo}/${params.pageSize}`
  133. delete params.pageNo
  134. delete params.pageSize
  135. return axios({
  136. url: url,
  137. data: params,
  138. method: 'post',
  139. headers:{
  140. 'module': encodeURIComponent('明细列表')
  141. }
  142. })
  143. }
  144. // 获取采购退货申请单 详情
  145. export const purchaseReturnDetail = (params) => {
  146. return axios({
  147. url: `/purchaseReturnApply/findBySn/${params.sn}`,
  148. method: 'get',
  149. headers:{
  150. 'module': encodeURIComponent('详情')
  151. }
  152. })
  153. }
  154. // 采购退货申请单提交
  155. export const purchaseReturnSubmit = (params) => {
  156. return axios({
  157. url: `/purchaseReturnApply/submit/${params.sn}`,
  158. method: 'get',
  159. headers:{
  160. 'module': encodeURIComponent('提交')
  161. }
  162. })
  163. }
  164. // 采购退货申请单再次编辑
  165. export const purchaseReturnAgainCreate = (params) => {
  166. return axios({
  167. url: `/purchaseReturnApply/againCreate/${params.sn}`,
  168. method: 'get',
  169. headers:{
  170. 'module': encodeURIComponent('再次编辑')
  171. }
  172. })
  173. }
  174. // 导出删除项
  175. export const exportDeleteExcel = (params) => {
  176. return axios({
  177. url: `/purchaseReturnApply/detail/downloadDeleteFailExcel/${params.sn}`,
  178. data: params,
  179. method: 'post',
  180. responseType: 'blob',
  181. headers:{
  182. 'module': encodeURIComponent('导出删除项')
  183. }
  184. })
  185. }
  186. // 导出错误项
  187. export const exportErrorExcel = (params) => {
  188. return axios({
  189. url: `/purchaseReturnApply/detail/downloadFailExcel`,
  190. data: params,
  191. method: 'post',
  192. responseType: 'blob',
  193. headers:{
  194. 'module': encodeURIComponent('导出错误项')
  195. }
  196. })
  197. }
  198. // 解析产品的导入模板
  199. export const purchaseReturnApplyReadExcel = (params) => {
  200. return axios({
  201. url: `/purchaseReturnApply/detail/readExcel`,
  202. data: params,
  203. method: 'post'
  204. })
  205. }
  206. // 批量导入产品
  207. export const purchaseReturnApplyCreateList = (params) => {
  208. return axios({
  209. url: `/purchaseReturnApply/detail/createList`,
  210. data: params,
  211. method: 'post',
  212. headers:{
  213. 'module': encodeURIComponent('导入产品')
  214. }
  215. })
  216. }
  217. // 导出明细
  218. export const purchaseReturnApplyExport = (params) => {
  219. return axios({
  220. url: `/purchaseReturnApply/excel/${params.sn}`,
  221. method: 'get',
  222. responseType: 'blob',
  223. headers:{
  224. 'module': encodeURIComponent('导出Excel')
  225. }
  226. })
  227. }
  228. // 详情 打印
  229. export const purchaseReturnApplyPrint = params => {
  230. const data = {
  231. url: `/purchaseReturnApply/print/${params.sn}/${params.type}`,
  232. method: 'get',
  233. headers:{
  234. 'module': encodeURIComponent(params.type == 'INK' ? '喷墨打印' : '针式打印')
  235. }
  236. }
  237. // 喷墨打印
  238. if (params.type == 'INK') {
  239. data.responseType = 'blob'
  240. }
  241. return axios(data)
  242. }