import request from '@/utils/request'
import { download } from '@/utils/request'
// 查询存款列表
export function listDeposit(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/list',
    method: 'get',
    params: query
  })
}

// 查询委托单列表
export function listEntrustOrder(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/listEntrustOrder',
    method: 'get',
    params: query
  })
}
// 查询存款详细
export function getRemain() {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/getRemain',
    method: 'get'
  })
}


// 查询存款详细
export function getDeposit(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/' + id,
    method: 'get'
  })
}

// 新增存款
export function addDeposit(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit',
    method: 'post',
    data: data
  })
}

export function verifyDeposit(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/verify',
    method: 'post',
    data: data
  })
}

// 修改存款
export function updateDeposit(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit',
    method: 'put',
    data: data
  })
}

// 删除存款
export function delDeposit(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'
  return request({
    url: '/business/deposit/' + id,
    method: 'delete'
  })
}


export function exportDeposit(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-entrust'

  download(
    "business/deposit/export",
    {
      ...query,
    },
    `存款记录导出_${new Date().getTime()}.xlsx`
  )
}