salesReturn.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. import { axios } from '@/utils/request'
  2. // 销售退货 审核
  3. export const salesReturnAudit = (params) => {
  4. return axios({
  5. url: `/salesReturn/audit/${params.sn}`,
  6. method: 'get',
  7. headers:{
  8. 'module': encodeURIComponent('审核')
  9. }
  10. })
  11. }
  12. // 销售退货 删除
  13. export const salesReturnDel = (params) => {
  14. return axios({
  15. url: `/salesReturn/delete/${params.sn}`,
  16. method: 'get',
  17. headers:{
  18. 'module': encodeURIComponent('删除')
  19. }
  20. })
  21. }
  22. // 销售退货明细 删除
  23. export const salesReturnDetailDel = (params) => {
  24. return axios({
  25. url: `/salesReturn/detail/delete/${params.id}`,
  26. method: 'get',
  27. headers:{
  28. 'module': encodeURIComponent('删除')
  29. }
  30. })
  31. }
  32. // 销售退货明细 清空列表
  33. export const salesReturnDelAll = (params) => {
  34. return axios({
  35. url: `/salesReturn/detail/deleteAll/${params.sn}`,
  36. method: 'get',
  37. headers:{
  38. 'module': encodeURIComponent('清空列表')
  39. }
  40. })
  41. }
  42. // 销售退货 列表 统计
  43. export const salesReturnCount = (params) => {
  44. const url = `/salesReturn/queryCount`
  45. return axios({
  46. url: url,
  47. data: params,
  48. method: 'post'
  49. })
  50. }
  51. // 明细列表统计,不传sn 是所有统计
  52. export const salesReturnQueryCount = (params) => {
  53. const url = `/salesReturn/detail/queryCount`
  54. return axios({
  55. url: url,
  56. data: params,
  57. method: 'post'
  58. })
  59. }
  60. // 销售退货 分页查询销售退货明细
  61. export const salesReturnDetailList = (params) => {
  62. const url = `/salesReturn/detail/queryPage/${params.pageNo}/${params.pageSize}`
  63. delete params.pageNo
  64. delete params.pageSize
  65. return axios({
  66. url: url,
  67. data: params,
  68. method: 'post',
  69. headers:{
  70. 'module': encodeURIComponent('明细列表')
  71. }
  72. })
  73. }
  74. // 销售退货 分页查询产品
  75. export const salesReturnProductList = (params) => {
  76. const url = `/salesReturn/detail/querySalesBillDetailPage/${params.pageNo}/${params.pageSize}`
  77. delete params.pageNo
  78. delete params.pageSize
  79. return axios({
  80. url: url,
  81. data: params,
  82. method: 'post',
  83. headers:{
  84. 'module': encodeURIComponent('可选产品列表')
  85. }
  86. })
  87. }
  88. // 产品添加和修改
  89. export const salesReturnSaveProduct = (params) => {
  90. return axios({
  91. url: '/salesReturn/detail/save',
  92. data: params,
  93. method: 'post',
  94. headers:{
  95. 'module': encodeURIComponent(params.id?'修改产品':'添加产品')
  96. }
  97. })
  98. }
  99. // 退货打折
  100. export const salesReturnDiscount = (params) => {
  101. return axios({
  102. url: '/salesReturn/discount',
  103. data: params,
  104. method: 'post',
  105. headers:{
  106. 'module': encodeURIComponent('打折')
  107. }
  108. })
  109. }
  110. // 销售退货 导出
  111. export const salesReturnExport = (params) => {
  112. return axios({
  113. url: '/salesReturn/export',
  114. data: params,
  115. method: 'post',
  116. headers:{
  117. 'module': encodeURIComponent('导出')
  118. }
  119. })
  120. }
  121. // 根据SN查询销售退货单
  122. export const salesReturnDetail = (params) => {
  123. return axios({
  124. url: `/salesReturn/findBySn/${params.sn}`,
  125. method: 'get',
  126. headers:{
  127. 'module': encodeURIComponent('详情信息')
  128. }
  129. })
  130. }
  131. // 销售退货 付款
  132. export const salesReturnPay = (params) => {
  133. return axios({
  134. url: '/salesReturn/pay',
  135. data: params,
  136. method: 'post',
  137. headers:{
  138. 'module': encodeURIComponent('付款')
  139. }
  140. })
  141. }
  142. // 销售退货 打印
  143. export const salesReturnPrint = (params) => {
  144. return axios({
  145. url: '/salesReturn/print',
  146. data: params,
  147. method: 'post',
  148. headers:{
  149. 'module': encodeURIComponent('打印')
  150. }
  151. })
  152. }
  153. // 销售退货 打印预览
  154. export const salesReturnprintPreview = (params) => {
  155. return axios({
  156. url: '/salesReturn/printPreview',
  157. data: params,
  158. method: 'post',
  159. headers:{
  160. 'module': encodeURIComponent('打印预览')
  161. }
  162. })
  163. }
  164. // 销售退货 列表分页
  165. export const salesReturnList = (params) => {
  166. const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
  167. delete params.pageNo
  168. delete params.pageSize
  169. return axios({
  170. url: url,
  171. data: params,
  172. method: 'post',
  173. headers:{
  174. 'module': encodeURIComponent('列表查询')
  175. }
  176. })
  177. }
  178. // 销售退货单保存
  179. export const salesReturnSave = (params) => {
  180. return axios({
  181. url: '/salesReturn/save',
  182. data: params,
  183. method: 'post',
  184. headers:{
  185. 'module': encodeURIComponent(params.id?'编辑基础信息':'新增')
  186. }
  187. })
  188. }
  189. // 销售退货 提交
  190. export const salesReturnSubmit = (params) => {
  191. return axios({
  192. url: `/salesReturn/submit/${params.sn}`,
  193. method: 'get',
  194. headers:{
  195. 'module': encodeURIComponent('提交')
  196. }
  197. })
  198. }
  199. // 销售退货 详情 打印
  200. export const salesReturnDetailPrint = params => {
  201. const data = {
  202. url: `salesReturn/print/${params.sn}/${params.type}`,
  203. method: 'get',
  204. headers:{
  205. 'module': encodeURIComponent(params.type=='INK' ? '喷墨打印':'针式打印')
  206. }
  207. }
  208. // 喷墨打印
  209. if(params.type=='INK'){
  210. data.responseType = 'blob'
  211. }
  212. return axios.request(data)
  213. }
  214. // 销售退货 详情 导出
  215. export const salesDetailExport = params => {
  216. return axios.request({
  217. url: `salesReturn/excel/${params.sn}`,
  218. method: 'get',
  219. responseType: 'blob',
  220. headers:{
  221. 'module': encodeURIComponent('导出Excel')
  222. }
  223. })
  224. }