import { axios } from '@/utils/request' // 采购退货申请单列表 分页 export const purchaseReturnList = (params) => { const url = `/purchaseReturnApply/queryPage/${params.pageNo}/${params.pageSize}` delete params.pageNo delete params.pageSize return axios({ url: url, data: params, method: 'post', headers:{ 'module': encodeURIComponent('列表查询') } }) } // 申请单新增 export const purchaseReturnSave = (params) => { return axios({ url: '/purchaseReturnApply/create', data: params, method: 'post', headers:{ 'module': encodeURIComponent('新增') } }) } // 采购退货申请单 删除 export const purchaseReturnDel = (params) => { return axios({ url: `/purchaseReturnApply/delete`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('删除') } }) } // 生成采购退货单 export const createPurchaseReturnBill = (params) => { return axios({ url: `/purchaseReturnApply/createPurchaseReturnBill`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('生成采购退货单') } }) } // 选择产品列表 export const queryDealerScopeProductPage = (params) => { const url = `/purchaseReturnApply/queryDealerScopeProductPage/${params.pageNo}/${params.pageSize}` delete params.pageNo delete params.pageSize return axios({ url: url, data: params, method: 'post', headers:{ 'module': encodeURIComponent('可选产品列表') } }) } // 采购退货 详情 添加产品 export const purchaseReturnDetailSave = (params) => { return axios({ url: '/purchaseReturnApply/detail/create', data: params, method: 'post', headers:{ 'module': encodeURIComponent('添加') } }) } // 采购退货申请单 详情 删除 export const purchaseReturnDetailDel = (params) => { return axios({ url: `/purchaseReturnApply/detail/delete`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('删除') } }) } // 采购退货 详情 全部删除 export const purchaseReturnDetailDelAll = (params) => { return axios({ url: `/purchaseReturnApply/detail/deleteAll`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('清空列表') } }) } // 申请单详情修改数量 export const purchaseReturnModifyQty = (params) => { return axios({ url: `/purchaseReturnApply/detail/modifyQty`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('修改数量') } }) } // 申请单详情修改退货原因 // 修改备注 export const modifyReturnInfo = (params) => { return axios({ url: `/purchaseReturnApply/detail/modifyInfo`, data: params, method: 'post', headers:{ 'module': encodeURIComponent(params.returnReason ? '修改退货原因' : '修改备注') } }) } // 批量修改退货原因 export const modifyReturnReasonList = (params) => { return axios({ url: `/purchaseReturnApply/detail/modifyInfoList`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('批量设置退货原因') } }) } // 申请单详情列表 分页 export const purchaseReturnDetailList = (params) => { const url = `/purchaseReturnApply/detail/queryPage/${params.pageNo}/${params.pageSize}` delete params.pageNo delete params.pageSize return axios({ url: url, data: params, method: 'post', headers:{ 'module': encodeURIComponent('明细列表') } }) } // 获取采购退货申请单 详情 export const purchaseReturnDetail = (params) => { return axios({ url: `/purchaseReturnApply/findBySn/${params.sn}`, method: 'get', headers:{ 'module': encodeURIComponent('详情') } }) } // 采购退货申请单提交 export const purchaseReturnSubmit = (params) => { return axios({ url: `/purchaseReturnApply/submit/${params.sn}`, method: 'get', headers:{ 'module': encodeURIComponent('提交') } }) } // 采购退货申请单再次编辑 export const purchaseReturnAgainCreate = (params) => { return axios({ url: `/purchaseReturnApply/againCreate/${params.sn}`, method: 'get', headers:{ 'module': encodeURIComponent('再次编辑') } }) } // 导出删除项 export const exportDeleteExcel = (params) => { return axios({ url: `/purchaseReturnApply/detail/downloadDeleteFailExcel/${params.sn}`, data: params, method: 'post', responseType: 'blob', headers:{ 'module': encodeURIComponent('导出删除项') } }) } // 导出错误项 export const exportErrorExcel = (params) => { return axios({ url: `/purchaseReturnApply/detail/downloadFailExcel`, data: params, method: 'post', responseType: 'blob', headers:{ 'module': encodeURIComponent('导出错误项') } }) } // 解析产品的导入模板 export const purchaseReturnApplyReadExcel = (params) => { return axios({ url: `/purchaseReturnApply/detail/readExcel`, data: params, method: 'post' }) } // 批量导入产品 export const purchaseReturnApplyCreateList = (params) => { return axios({ url: `/purchaseReturnApply/detail/createList`, data: params, method: 'post', headers:{ 'module': encodeURIComponent('导入产品') } }) } // 导出明细 export const purchaseReturnApplyExport = (params) => { return axios({ url: `/purchaseReturnApply/excel/${params.sn}`, method: 'get', responseType: 'blob', headers:{ 'module': encodeURIComponent('导出Excel') } }) } // 详情 打印 export const purchaseReturnApplyPrint = params => { const data = { url: `/purchaseReturnApply/print/${params.sn}/${params.type}`, method: 'get', headers:{ 'module': encodeURIComponent(params.type == 'INK' ? '喷墨打印' : '针式打印') } } // 喷墨打印 if (params.type == 'INK') { data.responseType = 'blob' } return axios(data) }