import { axios } from '@/utils/request'
// 新增发货
export const sendBillInsert = params => {
  return axios({
    url: '/sendBill/insert',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('新增发货单')
    }
  })
}
// 修改发货单
export const sendBillUpdate = params => {
  return axios({
    url: '/sendBill/update',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('修改发货单')
    }
  })
}
// 修改问题反馈
export const updateIssueRemark = params => {
  return axios({
    url: '/sendBill/updateIssueRemark',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('修改问题反馈')
    }
  })
}
// 删除出库单修改发货状态
export const deleteSendBillStockOut = params => {
  return axios({
    url: '/sendBill/deleteSendBillStockOut',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('删除')
    }
  })
}
// 获取客户信息
export const getCustomerInfo = params => {
  return axios({
    url: '/sendBill/getCustomerInfo',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('获取客户信息')
    }
  })
}
// 发货前校验销售单
export const validateStockOut = params => {
  return axios({
    url: '/sendBill/validateStockOut',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('发货')
    }
  })
}
// 发货单列表分页查询
export const sendBillQueryPageList = (params) => {
  const url = `/sendBill/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('发货单列表查询')
    }
  })
}
// 导入发货单 
export const sendBillInsertBatch = (params) => {
  return axios({
    url: '/sendBill/insertBatch',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('导入')
    }
  })
}
// 导出错误项
export const exportImportError = (params) => {
  return axios({
    url: '/sendBill/exportImportError',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('导出错误项')
    }
  })
}
// 导出
export const sendBillExcel = (params) => {
  const url = `/sendBill/excel`
  return axios({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('导出')
    }
  })
}
// 更新发货单物流信息
export const updateTransportInfo = params => {
  return axios({
    url: '/sendBill/updateTransportInfo',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('更新物流信息')
    }
  })
}
// 根据sn查找详情
export const sendBillFindBySn = params => {
  return axios({
    url: `/sendBill/findBySn/${params.sn}`,
    method: 'get'
  })
}