import request from '@/utils/request'

// 获取员工绩效列表数据
export function getStaffPerformance(params) {
  return request({
    url: 'api/Grade/getlistbypage',
    method: 'post',
    params
  })
}

// 添加员工绩效数据
export function addStaffPerformance(params) {
  return request({
    url: 'api/Grade/Add',
    method: 'post',
    params
  })
}

// 员工绩效列表数据详情
export function getStaffPerformanceDetail(id) {
  return request({
    url: 'api/Grade/getdetail',
    method: 'post',
    data: {
        id
    }
  })
}

// 编辑员工绩效数据
export function editStaffPerformance(data) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    transformRequest: [function(data) {
      data = JSON.stringify(data)
      return data
    }],
    url: 'api/Grade/update',
    method: 'post',
    params: {},
    data
  })
}

//删除员工绩效数据
export function deleteStaffPerformance(id) {
  return request({
    url: 'api/Grade/delete',
    method: 'post',
    data: {
      id
    }
  })
}

//绩效申诉/确认
export function appealStaffPerformance(data) {
  return request({
    url: 'api/Grade/updatestate',
    method: 'post',
    data
  })
}
