import request from '@/assets/js/utils/request'

// 获取机构信息
export function getDepartInfo(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/getDepartInfo',
    method: 'post',
    data
    // headers: {
    //   'X-AUTH-TOKEN':
    //     'eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhZ2VudCIsInN1YiI6ImFnZW50IiwiaWF0IjoxNTU2MTYxNTA3fQ.EU_DGGP2RXOxVjBhH3oEOrQHZl1gkYV0n3YxMdMnXDs'
    // }
  })
}

// 保存机构基本信息
export function saveDepartInfo(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/addOrgnization',
    method: 'post',
    data
  })
}

// 保存机构联系人信息
export function saveDepartLinker(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/saveDepartLinker',
    method: 'post',
    data
  })
}

// 保存机构财务信息
export function saveFinance(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/saveFinance',
    method: 'post',
    data
  })
}

// 上级机构
export function getDepartList(data) {
  return request({
    url: '/bidprocurement/common-user/user/depart/getDepartList',
    method: 'post',
    data
  })
}

// 获取机构列表信息
export function getOrganizationList(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/getOrganizationList',
    method: 'post',
    data
  })
}

// 删除机构
export function delDepart(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/delDepart?id=' + data,
    method: 'post'
  })
}

// 保存部门信息
export function addDepart(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/addDepart',
    method: 'post',
    data
  })
}

// 查询部门信息
export function refDepart(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/refDepart?id=' + data,
    method: 'post'
  })
}

// 组织机构-一次性加载
export function orgStructure() {
  return request({
    url: '/bidprocurement/common-user/user/organization/orgStructure',
    method: 'get'
  })
}
// 查询该机构下的用户列表
export function selectUserListByDepartId(data) {
  return request({
    url: '/bidprocurement/common-user/user/user/selectUserListByDepartId',
    method: 'post',
    data
  })
}

// 查询该机构基本信息
export function getBasicDepartInfoVo(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/getBasicDepartInfoVo',
    method: 'post',
    params: data
  })
}

// 设置机构状态
export function updateDepartInfoStatus(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/updateDepartInfoStatus',
    method: 'post',
    params: data
  })
}

// 保存机构基本信息
export function saveDepartInfoNew(data) {
  return request({
    url: '/bidprocurement/common-user/user/organization/addOrgnizationNew',
    method: 'post',
    data
  })
}
