import request from '@/utils/request'

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

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

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

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

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

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

// 新增员工工时分摊记录
export function addEmpworkhour(data) {
  return request({
    url: '/buyer/empworkhour',
    method: 'post',
    data: data
  })
}

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

// 批量更新员工工时分摊记录
export function batchUpdateEmpworkhour(data) {
  return request({
    url: '/buyer/empworkhour/batchUpdate',
    method: 'post',
    data: data
  })
}

// 修改员工工时分摊记录
export function updateEmpworkhour(data) {
  return request({
    url: '/buyer/empworkhour',
    method: 'put',
    data: data
  })
}

// 删除员工工时分摊记录
export function delEmpworkhour(id) {
  return request({
    url: '/buyer/empworkhour/' + id,
    method: 'delete'
  })
}

// 导入表
export function importTable(data) {
  return request({
    url: '/buyer/empworkhour/importTable',
    method: 'post',
    params: data
  })
}
