import request from '@/utils/request'

// 查询阶段列表
export function listStage(query) {
  return request({
    url: '/ehr/pm/stage/list',
    method: 'get',
    params: query
  })
}

// 查询阶段详细
export function getStage(id) {
  return request({
    url: '/ehr/pm/stage/' + id,
    method: 'get'
  })
}

// 新增阶段控制
export function addStage(data) {
  return request({
    url: '/ehr/pm/stage',
    method: 'post',
    data: data
  })
}

// 修改阶段控制
export function updateStage(data) {
  return request({
    url: '/ehr/pm/stage',
    method: 'put',
    data: data
  })
}

// 删除阶段控制
export function delStage(id) {
  return request({
    url: '/ehr/pm/stage/' + id,
    method: 'delete'
  })
}

// 发布阶段
export function publishStage(data) {
  return request({
    url: '/ehr/pm/stage/publish',
    method: 'post',
    data: data
  })
}

// 填写结束
export function fillinFinish(data) {
  return request({
    url: '/ehr/pm/stage/fillinFinish',
    method: 'post',
    data: data
  })
}

//开始自评
export function startSelfEvaluation(data) {
  return request({
    url: '/ehr/pm/stage/startSelfEvaluation',
    method: 'post',
    data: data
  })
}

//结束自评
export function finishSelfEvaluation(data) {
  return request({
    url: '/ehr/pm/stage/finishSelfEvaluation',
    method: 'post',
    data: data
  })
}

//开启等级调整
export function openGradeAdjust(data) {
  return request({
    url: '/ehr/pm/stage/openGradeAdjust',
    method: 'post',
    data: data
  })
}

//关闭等级调整
export function closeGradeAdjust(data) {
  return request({
    url: '/ehr/pm/stage/closeGradeAdjust',
    method: 'post',
    data: data
  })
}

//计算结果
export function computeResult(data) {
  return request({
    url: '/ehr/pm/stage/computeResult',
    method: 'post',
    data: data
  })
}

//过数到薪资
export function cendToSalary(data) {
  return request({
    url: '/ehr/pm/stage/cendToSalary',
    method: 'post',
    data: data
  })
}

//生成绩效
export function createPm(data) {
  return request({
    url: '/ehr/pm/stage/createPm',
    method: 'post',
    data: data
  })
}

// 查询指定周期各阶段的绩效数量
export function stageCount(id) {
  return request({
    url: '/ehr/pm/stage/stageCount/' + id,
    method: 'get'
  })
}

//绩效结果公示
export function publishResult(data) {
  return request({
    url: '/ehr/pm/stage/publishResult',
    method: 'post',
    data: data
  })
}