import { axios } from '@/utils/request'

//  调账调账 列表  分页
export const verifyAccountChangeList = (params) => {
  const url = `/verifyAccountChange/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('列表查询')
    }
  })
}
// 调账保存
export const verifyAccountChangeSave = params => {
  return axios({
    url: '/verifyAccountChange/save',
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('创建调账')
    }
  })
}

// 调账调账  删除
export const verifyAccountChangeDel = params => {
  return axios({
    url: `/verifyAccountChange/deleteBySn/${params.sn}`,
    data: {},
    method: 'post',
    headers: {
      'module': encodeURIComponent('删除调账')
    }
  })
}
// 调账调账  详情
export const verifyAccountChangeDetail = params => {
  return axios({
    url: `/verifyAccountChange/queryBySn/${params.sn}`,
    data: {},
    method: 'post',
    headers: {
      'module': encodeURIComponent('查看调账详情')
    }
  })
}
 
// 调账调账  提交
export const verifyAcountBillSubmit = params => {
  return axios({
    url: `/verifyAccountChange/submit`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('调账提交')
    }
  })
}

// 经销商余额-分页列表
export const verifyAccountBalanceQueryPage = (params) => {
  const url = `/verifyAccountDealer/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('经销商余额列表查询')
    }
  })
}
// 分页列表-合计
export const verifyAccountBalanceQueryCount = (params) => {
  const url = `/verifyAccountDealer/queryCount`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('经销商余额列表统计')
    }
  })
}

//对账余额明细接口
export const verifyAccountBalanceQueryDetailPage = (params) => {
  const url = `/verifyAccountDealer/queryDetailPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账余额明细列表查询')
    }
  })
}

// 对账余额明细统计
export const verifyAccountBalanceQueryDetailCount = (params) => {
  const url = `/verifyAccountDealer/queryDetailCount`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('对账余额明细统计')
    }
  })
}
// 对账余额导出
export const verifyAccountBalanceExport = (params) => {
  const url = `/verifyAccountDealer/export`
  return axios({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('对账余额列表导出')
    }
  })
}
// 对账余额明细导出
export const verifyAccountBalanceDetailExport = (params) => {
  const url = `/verifyAccountDealer/detailExport`
  return axios({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
      'module': encodeURIComponent('对账余额明细列表导出')
    }
  })
}

// 人工录入单导出
export const verifyAccountChangeExport = (params) => {
  return axios({
    url: `/verifyAccountChange/export`,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers: {
      'module': encodeURIComponent('人工录入单导出')
    }
  })
}

// 查询被引用单据
export const verifyAccountChangeDeleteValid = (params) => {
  return axios({
    url: `/verifyAccountChange/deleteValid/${params.sn}`,
    data: params,
    method: 'post',
    headers: {
      'module': encodeURIComponent('人工录入单查询被引用对账单')
    }
  })
}