// 业务结算
import request from '../index'
import type { IListQuery } from '@/views/finance/businessSettlement/businessSettlement-interface'

// 业务结算列表
export function getBusinessSettlementList(data: IListQuery) {
  return request({
    url: `/finance/settlement/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 业务结算导出
export function exportBusinessSettlementList(data: IListQuery) {
  return request({
    url: '/finance/settlement/listExport',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 删除
export function delBusinessSettlementList(data: any) {
  return request({
    url: '/finance/settlement/delete',
    method: 'post',
    data,
  })
}

// 新增
export function addBusinessSettlement(data: Object) {
  return request({
    url: '/finance/settlement/add',
    method: 'post',
    data,
  })
}

// 编辑
export function updateBusinessSettlement(data: Object) {
  return request({
    url: '/finance/settlement/update',
    method: 'post',
    data,
  })
}

// 详情
export function getBusinessSettlementDetail(data: { id: string }) {
  return request({
    url: '/finance/settlement/detail',
    method: 'post',
    data,
  })
}

// 获取流
export function getStream(data: { ids?: string[] ;id?: string; settlementType: string }) {
  return request({
    url: '/finance/settlement/form/export',
    method: 'post',
    responseType: 'blob',
    data,
  })
}

