import request from '@/utils/request'

// 获取发票管理列表
export function getInvoicesManagementList(data) {
  return request({
    url: '/saleInvoice/do_List',
    method: 'post',
    data
  })
}

// 获取采购合同签署审核通过的项目
export function getLocalPurchCompletedProject(params) {
  return request({
    url: '/projectInfo/getLocalPurchCompletedProject',
    method: 'get',
    params
  })
}

// 获取采购合同签署审核通过的项目
export function getPurchCompleted(params) {
  return request({
    url: '/purchManagement/getPurchCompleted',
    method: 'get',
    params
  })
}

// 获取该笔业务对应的开票信息
export function getFindCustomer(params) {
  return request({
    url: '/saleInvoice/findCustomer',
    method: 'get',
    params
  })
}

// 获取销售发票金额类型为：货款的货物信息
export function getSaleSelectGoodsOfPayment(data) {
  return request({
    url: '/saleInvoice/saleSelectGoodsOfPayment',
    method: 'post',
    data
  })
}

// 提交销售发票信息
export function saleInvoiceDoAdd(data) {
  return request({
    url: '/saleInvoice/do_add',
    method: 'post',
    data
  })
}

// 申请开票详情
export function saleInvoiceGetDetails(params) {
  return request({
    url: '/saleInvoice/do_getDetails',
    method: 'get',
    params
  })
}

// 修改提交销售发票信息
export function saleInvoiceDoUpdate(data) {
  return request({
    url: '/saleInvoice/doUpdate',
    method: 'post',
    data
  })
}

// 销售发票预览
export function saleInvoicePreview(params) {
  return request({
    url: '/saleInvoice/showSaleInvoice',
    method: 'get',
    params
  })
}

// 销售发票下载
export function saleInvoiceDownload(params) {
  return request({
    url: '/saleInvoice/downLoadSaleInvoice',
    method: 'get',
    params,
    responseType: 'arraybuffer'
  })
}
