/*
 * @Description: 
 * @Author: ymz
 * @Date: 2021-12-13 10:38:59
 * @LastEditTime: 2021-12-15 17:27:55
 * @LastEditors: ymz
 * @Reference: 
 */

import request from '@/router/axios'

// 团队可选择人员
export function teamList(query) {
  return request({
    url: '/admin/team/list-selectable-user',
    method: 'get',
    params: query
  })
}

// 团队可选择人员
export function teamListSearch(query) {
  return request({
    url: '/admin/team/list-selectable-user-for-search',
    method: 'get',
    params: query
  })
}


// 查询团队可选择人员
export function selectUser(query){
  return request({
    url:"/admin/team/list-selectable-user",
    method:'get',
    query,query
  })
}

// 团队成员添加
export function addTeam(obj) {
  return request({
    url: '/admin/team',
    method: 'post',
    data: obj
  })
}

// 平台添加团队
export function addTeamByDeptId(obj) {
  return request({
    url: '/admin/team/save-by-dept',
    method: 'post',
    data: obj
  })
}

// 更新团队
export function editTeam(obj) {
  return request({
    url: '/admin/team',
    method: 'put',
    data: obj
  })
}



// 团队列表
export function getTeamList(query){
  return request({
    url: '/admin/team/list',
    method: 'get',
    params: query
  })
}

// 解散团队
export function dissolveTeam(id){
  return request({
    url: `/admin/team/${id}/dissolve`,
    method: 'post',

  })
}

// 下载模板

export function download(obj){
  return request({
    url: `/admin/template-file/download`,
    method: 'post',
    responseType: 'arraybuffer',
    data:obj
  })
}


// 查询企业代理商信息
export function queryInfo(query) {
  return request({
    url: '/admin/dept/list-ent-and-agent',
    method: 'get',
    params: query
  })
}

// 根据deptId查询团队列表

export function teamListById(query) {
  return request({
    url: '/admin/team/list-by-dept',
    method: 'get',
    params: query
  })
}