import request from '@/utils/request'

// 查询员工列表
export function listBaseStaff(query) {
  return request({
    url: '/ccdi/baseStaff/list',
    method: 'get',
    params: query
  })
}

// 查询员工详细
export function getBaseStaff(staffId) {
  return request({
    url: '/ccdi/baseStaff/' + staffId,
    method: 'get'
  })
}

// 新增员工
export function addBaseStaff(data) {
  return request({
    url: '/ccdi/baseStaff',
    method: 'post',
    data: data
  })
}

// 修改员工
export function updateBaseStaff(data) {
  return request({
    url: '/ccdi/baseStaff',
    method: 'put',
    data: data
  })
}

// 删除员工
export function delBaseStaff(staffIds) {
  return request({
    url: '/ccdi/baseStaff/' + staffIds,
    method: 'delete'
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/ccdi/baseStaff/importTemplate',
    method: 'post'
  })
}

// 导入员工双Sheet数据
export function importData(data) {
  return request({
    url: '/ccdi/baseStaff/importData',
    method: 'post',
    data: data
  })
}

// 查询导入状态
export function getImportStatus(taskId) {
  return request({
    url: '/ccdi/baseStaff/importStatus/' + taskId,
    method: 'get'
  })
}

// 查询导入失败记录
export function getImportFailures(taskId, pageNum, pageSize) {
  return request({
    url: '/ccdi/baseStaff/importFailures/' + taskId,
    method: 'get',
    params: { pageNum, pageSize }
  })
}
