import request from '@/utils/request'

// 进件管理

//通讯录管理---表格---获取全部人员
export function getAllMemberList(data) {
  return request({
    url: '/admin/auth/addressbook/clerk/getAll',
    method: 'get',
    params: data
  })
}
// 获取未分组人员
export function getNoGroupMember(data) {
  return request({
    url: '/admin/auth/addressbook/clerk/getArrangeNot',
    method: 'get',
    params: data
  })
} 
//  获取柜组用户  
export function getGroupById(data) {
  return request({
    url: '/admin/auth/addressbook/orgnization/getClerkById',
    method: 'get',
    params: data
  })
}
// 根据部门id获取人员
export function getMemberById(data) {
  return request({
    url: '/admin/auth/addressbook/getUserByStallId',
    method: 'get',
    params: data
  })
}
//通讯录管理---组织架构
export function getOrgTree() {
    return request({
      url: '/admin/auth/addressbook/orgnization/getAll',
      method: 'get',
    })
  }
export function getHistoryList(data) {
    return request({
      url: 'admin/auth/addressbook/clerk/synchronization',
      method: 'get',
      params:data
    })
  }
  export function deleteCounter(inData) {
    return request({
      url: '/admin/auth/stall/delete',
      method: 'delete',
      params: inData
    })
  }

  //  获取移动分组
  export function getGroup() {
    return request({
      url: '/admin/auth/addressbook/selectGroupPage',
      method: 'get',
    })
  }

  // 修改门店名字
  export function storeNameChange(data) {
    return request({
      url: '/admin/auth/stall/update',
      method: 'put',
      data
    })
  }

  // 移动人员
  export function moveMember(data) {
    return request({
      url: 'admin/auth/addressbook/clerk/moveTo',
      method: 'put',
      params:data
    })
  }

  // 设置管理员||取消管理员
  export function changeRole(data) {
    return request({
      url: 'admin/auth/addressbook/clerk/configManagerById',
      method: 'put',
      params:data
    })
  }
   // 添加子部门
  export function addGroup(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/save',
      method: 'post',
      params
    })
  }

   // 删除子部门
  export function deleteGroup(data) {
    return request({
      url: '/admin/auth/addressbook/orgnization/deleteById',
      method: 'delete',
      params:data
    })
  }

  // 获取企业微信部门
  export function getAllPeopleList(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/getClerkByWXDeptId',
      method: 'get',
      params
    })
  }
  // 获取企业微信人员
  export function getWxAllDeptList(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/getAllInWX',
      method: 'get',
      params
    })
  }
  // 获取部门详情
  export function getDeptDetail(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/getById',
      method: 'get',
      params
    })
  }
  // 编辑部门
  export function editDept(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/update',
      method: 'put',
      params
    })
  }
  // 根据关键字查询
  export function search(params) {
    return request({
      url: '/admin/auth/addressbook/clerk/getByUserName',
      method: 'get',
      params
    })
  }
  // 把店员移到未分组 
  export function deleteNormalPerson(params) {
    return request({
      url: '/admin/auth/addressbook/clerk/delete',
      method: 'put',
      params
    })
  }
  // 获取部门 用于修改
  export function getEditOrg(params) {
    return request({
      url: '/admin/auth/addressbook/orgnization/getAllForUpdate',
      method: 'get',
      params
    })
  }