import { axios } from '@/utils/request'

// 更新结算账户功能状态
export const updateAccountMangeState = params => {
  return axios({
    url: `/settleAccount/updateFunctionState/${params.enableFlag}`,
    method: 'get'
  })
}
// 查询结算账户功能状态
export const queryAccountMangeState = params => {
  return axios({
    url: `/settleAccount/queryFunctionState`,
    method: 'get'
  })
}
// 分页查找结算账户列表
export const settleAccountList = (params) => {
  const url = `/settleAccount/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 查询资金明细
export const findSettleFlowPage = (params) => {
  const url = `/settleAccount/findSettleFlowPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 保存结算账户信息
export const settleAccountSave = params => {
  return axios({
    url: '/settleAccount/save',
    data: params,
    method: 'post'
  })
}

// 根据sn查找结算账户信息
export const settleAccountDetail = params => {
  return axios({
    url: `/settleAccount/findBySn/${params.settleAccountSn}`,
    method: 'get'
  })
}
// 启禁用结算账户信息
export const settleAccountEnable = params => {
  return axios({
    url: `/settleAccount/enable/${params.settleAccountSn}/${params.enableFlag}`,
    method: 'get'
  })
}
// 删除结算账户信息
export const settleAccountDelete = params => {
  return axios({
    url: `/settleAccount/delete/${params.settleAccountSn}`,
    method: 'get'
  })
}
// 审核结算账户信息
export const settleAccountAudit = params => {
  return axios({
    url: `/settleAccount/audit/${params.settleAccountSn}/${params.auditState}`,
    method: 'get'
  })
}