import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/member/marketTeam/pageList',
    method: 'get',
    params: query
  })
}

// 分页查询   
export const teamPageList = (query) => {
  return request({
    url: '/member/marketTeam/pageList',
    method: 'get',
    params: query
  })
}
//
export const getBindTeamList = (query) => {
  return request({
    url: '/member/marketTeam/getBindTeamList',
    method: 'get',
    params: query
  })
}


// 新增/修改
export const saveAndEdit = (data) => {
  return request({
    url: '/member/marketTeam/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除模板
export const deleteById = (id) => {
  return request({
    url: '/member/marketTeam/deleteById',
    method: 'delete',
    params: {id:id}
  })
}
// 解除绑定
export const removeBindApi = (id) => {
  return request({
    url: '/member/marketTeam/delTeamBind',
    method: 'delete',
    params: {teamId: id}
  })
}

// 修改状态
export const updateStatus = (data) => {
  return request({
    url: '/member/marketTeam/insertOrUpdate',
    method: 'post',
    data: data
  })
}

export function getSelectById(id) {
  return request({
    url: '/member/marketTeam/selectById?id=' + id,
    method: 'get'
  })
}

// 授信余额
export const creditGrantingApi = (data) => {
  return request({
    url: '/member/marketTeam/quotaUpdate',
    method: 'post',
    data: data
  })
}

// 授信欠款
export const creditGrantingBoxApi = (data) => {
  return request({
    url: '/member/marketTeam/quotaRecharge',
    method: 'post',
    data: data
  })
}

// 余额
export const rechargeBoxApi = (data) => {
  return request({
    url: '/member/marketTeam/balanceRecharge',
    method: 'post',
    data: data
  })
}

// 身份证校验
export const marketTeamAudit = (query) => {
  return request({
    url: '/member/marketTeam/audit',
    method: 'post',
    data: query
  })
}

// 授信余额
export const searchCompanysApi = (data) => {
  return request({
    url: '/member/marketTeam/searchCompanys',
    method: 'post',
    data: data
  })
}

// 预警待办分页查询   
export const waitRepaymentList = (query) => {
  return request({
    url: '/member/marketTeamCreditAccount/waitRepaymentList',
    method: 'get',
    params: query
  })
}

// 预警待办数量
export const WaitRepaymentTotal = (query) => {
  return request({
    url: '/member/marketTeamCreditAccount/waitRepaymentTotal',
    method: 'get',
    params: query
  })
}