import request from '@/utils/request'
// 查询员工工时分摊记录列表
export function workDatelist(query) {
  return request({
    url: '/buyer/deviceworkhour/workDatelist',
    method: 'get',
    params: query
  })
}

export function listGrroupProject(query) {
  return request({
    url: '/buyer/deviceworkhour/listGrroupProject',
    method: 'get',
    params: query
  })
}

// 查询设备工时分摊记录列表
export function listDeviceworkhour(query) {
  return request({
    url: '/buyer/deviceworkhour/list',
    method: 'get',
    params: query
  })
}

// 查询设备工时分摊记录详细
export function getDeviceworkhour(id) {
  return request({
    url: '/buyer/deviceworkhour/' + id,
    method: 'get'
  })
}

// 新增设备工时分摊记录
export function addDeviceworkhour(data) {
  return request({
    url: '/buyer/deviceworkhour',
    method: 'post',
    data: data
  })
}

// 修改设备工时分摊记录
export function updateDeviceworkhour(data) {
  return request({
    url: '/buyer/deviceworkhour',
    method: 'put',
    data: data
  })
}

// 删除设备工时分摊记录
export function delDeviceworkhour(id) {
  return request({
    url: '/buyer/deviceworkhour/' + id,
    method: 'delete'
  })
}

// 批量更新工时分摊记录
export function batchUpdateDeviceworkhour(query) {
  return request({
    url: '/buyer/deviceworkhour/batchUpdate',
    method: 'get',
    params: query
  })
}

// 查询员工工时分摊记录列表
export function listForYearMonth(query) {
  return request({
    url: '/buyer/deviceworkhour/listForYearMonth',
    method: 'get',
    params: query
  })
}

// 批量新增员工工时分摊记录
export function batchAdd(params, data) {
  return request({
    url: '/buyer/deviceworkhour/batchAdd?projectId='+params.projectId
      +'&year='+params.year
      +'&month='+params.month
      +'&workDate='+params.workDate,
    method: 'post',
    data: data
  })
}

export function listByProjectId(query) {
  return request({
    url: '/buyer/deviceworkhour/listByProjectId',
    method: 'get',
    params: query
  })
}
