import request from '@/utils/request'

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

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

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

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

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

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

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

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

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

