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

//  销售收款  列表  分页
export const settleReceiptList = (params) => {
  const url = `/settleReceipt/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('列表查询')
    }
  })
}
//  仅标记收款
export const settleReceiptBatch = (params) => {
  const url = `/settleReceipt/receiptBatch`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent(params.snList.length==1 ? '收款' : '批量收款')
    }
  })
}

// 关联收款单
export const settleReceiptBookBatch = (params) => {
  const url = `/settleReceipt/receiptBookBatch`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('关联收款单')
    }
  })
}

// 凭证
export const settleReceiptFindBySn = (params) => {
  const url = `/settleReceipt/findBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
      'module': encodeURIComponent('查看凭证')
    }
  })
}

// 收款打印
export const settleReceiptPrintFindBySn = (params) => {
  const url = `/settleReceipt/printFindBySn/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
      'module': encodeURIComponent('收款打印')
    }
  })
}