import request from '@/utils/request'

// 查询客户管理列表
export function listAccount(query) {
  return request({
    url: '/business/account/list',
    method: 'get',
    params: query
  })
}

// 查询客户管理列表(不分页)
export function listAll(query) {
  return request({
    url: '/business/account/listAll',
    method: 'get',
    params: query
  })
}

export function listRemote(query) {
  return request({
    url: '/business/account/listRemote/' + query,
    method: 'get',
  })
}
export function listRemotePage(query) {
  return request({
    url: '/business/account/listRemote',
    method: 'get',
    params: query
  })
}
// 查询关联客户
export function getRelatedAccount() {
  return request({
    url: '/business/account/accountlist',
    method: 'get'
  })
}
// 查询关联客户
export function getRelatedAccountByAccountId(query) {
  return request({
    url: '/business/account/accountData',
    method: 'get',
    params: query
  })
}
// 查询关联客户
export function getRelatedAccountByQuery(query) {
  return request({
    url: '/business/account/accountDataQuery',
    method: 'get',
    params: query
  })
}
export function getRelatedAccountByQueryPage(query) {
  return request({
    url: '/business/account/accountDataQueryPage',
    method: 'get',
    params: query
  })
}


// 查询客户管理详细
export function getAccount(accountId) {
  return request({
    url: '/business/account/' + accountId,
    method: 'get'
  })
}

// 新增客户管理
export function addAccount(data) {
  return request({
    url: '/business/account',
    method: 'post',
    data: data
  })
}

// 修改客户管理
export function updateAccount(data) {
  return request({
    url: '/business/account',
    method: 'put',
    data: data
  })
}

// 删除客户管理
export function delAccount(accountId) {
  return request({
    url: '/business/account/' + accountId,
    method: 'delete'
  })
}

// 合并客户
export function mergeAccount(data) {
  return request({
    url: '/business/account/merge',
    method: 'post',
    data: data
  })
}

