import request from '@/utils/request'

// 查询用户月度评分统计表列表
export function listUserScore(query) {
  return request({
    url: '/gxt/userscore/list',
    method: 'get',
    params: query
  })
}

// 根据条件查询用户月度评分统计表列表
export function listUserScoreByCondition(rtType, monthPeriod) {
  return request({
    url: '/gxt/userscore/listByCondition',
    method: 'get',
    params: {
      rtType: rtType,
      monthPeriod: monthPeriod
    }
  })
}

// 人员评分页面数据获取
export function getUserScoreInfo(rtType, monthPeriod) {
  return request({
    url: '/gxt/userscore/getUserScoreInfo',
    method: 'get',
    params: {
      rtType: rtType,
      monthPeriod: monthPeriod
    }
  })
}

// 查询用户月度评分统计表详细
export function getUserScore(id) {
  return request({
    url: '/gxt/userscore/' + id,
    method: 'get'
  })
}

// 新增用户月度评分统计表
export function addUserScore(data) {
  return request({
    url: '/gxt/userscore',
    method: 'post',
    data: data
  })
}

// 修改用户月度评分统计表
export function updateUserScore(data) {
  return request({
    url: '/gxt/userscore',
    method: 'put',
    data: data
  })
}

// 删除用户月度评分统计表
export function delUserScore(id) {
  return request({
    url: '/gxt/userscore/' + id,
    method: 'delete'
  })
}

// 统一提交人员评分页面的所有数据
export function submitAllScores(data) {
  return request({
    url: '/gxt/userscore/submitAllScores',
    method: 'post',
    data: data
  })
}

// 获取月度工分汇总数据
export function getScoreSummary(monthPeriod, rtType, deptParam) {
  return request({
    url: '/gxt/userscore/getScoreSummary',
    method: 'get',
    params: {
      rtType: rtType || 0,
      monthPeriod: monthPeriod,
      deptId: deptParam
    }
  })
}

export function getScoreSummaryById(rtType, summaryId) {
  return request({
    url: '/gxt/userscore/getScoreSummaryById',
    method: 'get',
    params: {
      rtType: rtType || 0,
      id: summaryId
    }
  })
}

// 获取月度工分汇总列表
export function getMonthScoreList(query) {
  return request({
    url: '/gxt/userscore/getMonthScoreList',
    method: 'get',
    params: query
  })
}

// 统一提交人员评分页面的所有数据
export function submitMonthScore(data) {
  return request({
    url: '/gxt/userscore/submitMonthScore',
    method: 'post',
    data: data
  })
}

// 获取月度工分汇总月份选项
export function getSummaryMonths(deptId) {
  return request({
    url: '/gxt/userscore/getSummaryMonths',
    method: 'get',
    params: {
      deptId: deptId
    }
  })
}

// 根据月份获取维保工单列表
export function getWorkOrderByMonth(workOrder) {
  return request({
    url: '/gxt/userscore/getWorkOrderByMonth',
    method: 'get',
    params: workOrder
  })
}

// 根据月份获取维保工单列表
export function getRepairOrderByMonth(repairOrder) {
  return request({
    url: '/gxt/userscore/getRepairOrderByMonth',
    method: 'get',
    params: repairOrder
  })
}
