import request from '@/utils/request'
import { download } from '@/utils/request'
// 查询银行账户列表
export function listAccount(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/account/list',
    method: 'get',
    params: query
  })
}

// 查询银行账户详细
export function getAccount(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/account/' + id,
    method: 'get'
  })
}

// 新增银行账户
export function addAccount(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/account',
    method: 'post',
    data: data
  })
}

// 修改银行账户
export function updateAccount(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/account',
    method: 'put',
    data: data
  })
}

// 导出银行账户
export function exportAccount(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  download(
    "business/account/export",
    {
      ...data,
    },
    `账户导出_${new Date().getTime()}.xlsx`
  );
}


// 删除银行账户
export function delAccount(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/account/' + id,
    method: 'delete'
  })
}
