import request from '@/utils/request'

// 查询企业员工信息列表
export function listCompanyUser(query) {
  return request({
    url: '/company/companyUser/list',
    method: 'get',
    params: query
  })
}
export function getAllUserlist(query) {
  return request({
    url: '/company/companyUser/getAllUserlist',
    method: 'get',
    params: query
  })
}

export function getUserListByDeptId(query) {
  return request({
    url: '/company/companyUser/getUserListByDeptId',
    method: 'get',
    params: query
  })
}


// 查询企业员工信息详细
export function getCompanyUser(userId) {
  return request({
    url: '/company/companyUser/' + userId,
    method: 'get'
  })
}

// 新增企业员工信息
export function addCompanyUser(data) {
  return request({
    url: '/company/companyUser',
    method: 'post',
    data: data
  })
}

// 修改企业员工信息
export function updateCompanyUser(data) {
  return request({
    url: '/company/companyUser',
    method: 'put',
    data: data
  })
}

// 删除企业员工信息
export function delCompanyUser(userId) {
  return request({
    url: '/company/companyUser/' + userId,
    method: 'delete'
  })
}

// 导出企业员工信息
export function exportCompanyUser(query) {
  return request({
    url: '/company/companyUser/export',
    method: 'get',
    params: query
  })
}


export function getUserList(companyId){
  return request({
    url: '/company/companyUser/getUserList?companyId='+companyId,
    method: 'get'
  })
}

// 根据登录的用户公司获取所有的销售
export function getCompanyUserList(query) {
  return request({
    url: '/company/companyUser/getCompanyUserList',
    method: 'get',
    query: query
  })
}

//更换会员归属销售
export function changeCompanyUser(data, params) {
  return request({
    url: '/company/companyUser/changeCompanyUser',
    method: 'post',
    data: data,
    params: params
  })
}

// 获取销售选项列表
export function getCompanyUserListLikeName(query){
  return request({
    url: '/company/companyUser/getCompanyUserListLikeName',
    method: 'get',
    params: query
  })
}
