import request from '@/utils/request'

// 查询划款管理列表
export function listAccountAdjustment(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/list',
    method: 'get',
    params: query
  })
}

export function listCompany(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/listCompany',
    method: 'get',
    params: query
  })
}

export function getCreditTermByCompId(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/getCreditTermByCompId',
    method: 'get',
    params: query
  })
}

// 查询划款管理详细
export function getAccountAdjustment(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/' + id,
    method: 'get'
  })
}

// 新增划款管理
export function addAccountAdjustment(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment',
    method: 'post',
    data: data
  })
}

// 修改划款管理
export function updateAccountAdjustment(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment',
    method: 'put',
    data: data
  })
}

// 删除划款管理
export function delAccountAdjustment(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/' + id,
    method: 'delete'
  })
}

export function exportDeposition(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  download(
    "business/accountAdjustment/export",
    {
      ...query,
    },
    `划款导出_${new Date().getTime()}.xlsx`
  )
}

// 修改划款管理
export function saveAccountAdjustment(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-production'
  return request({
    url: '/business/accountAdjustment/save',
    method: 'post',
    data: data
  })
}

