import request from '@/utils/httpRequest'

export default class FinanceInvoiceService {
  list (params) {
    return request({
      url: '/finance/invoice/list',
      method: 'get',
      params: params
    })
  }
  queryById (id) {
    return request({
      url: '/finance/invoice/queryById',
      method: 'get',
      params: {id: id}
    })
  }
  queryByNumber (number, id) {
    return request({
      url: '/finance/invoice/queryByNumber',
      method: 'get',
      params: {number: number, id: id}
    })
  }
  save (inputForm) {
    return request({
      url: `/finance/invoice/save`,
      method: 'post',
      data: inputForm
    })
  }
  delete (ids) {
    return request({
      url: '/finance/invoice/delete',
      method: 'delete',
      params: {ids: ids}
    })
  }
  updateStatusById (data) {
    return request({
      url: '/finance/invoice/updateStatusById',
      method: 'post',
      data: data
    })
  }
  isReceivables (data) {
    return request({
      url: '/finance/invoice/isReceivables',
      method: 'post',
      data: data
    })
  }
  saveForm (inputForm) {
    return request({
      url: `/finance/invoice/saveForm`,
      method: 'post',
      data: inputForm
    })
  }
  saveFormInvalid (inputForm) {
    return request({
      url: `/finance/invoice/saveFormInvalid`,
      method: 'post',
      data: inputForm
    })
  }
  queryIdByInvalidId (id) {
    return request({
      url: '/finance/invoice/queryIdByInvalidId',
      method: 'get',
      params: {id: id}
    })
  }
  importDetail (data) {
    return request({
      url: '/finance/invoice/importDetail',
      method: 'post',
      data: data
    })
  }
  exportTemplate () {
    return request({
      url: '/finance/invoice/importDetail/template',
      method: 'get',
      responseType: 'blob'
    })
  }
  exportFile (params) {
    return request({
      url: '/finance/invoice/export',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
}
