import request from "@/util/oaRequest"

// 班次
export function listShift(query) {
  return request({
    url: '/hrm/shift/list',
    method: 'get',
    params: query
  })
}
export function addShift(data) {
  return request({
    url: '/hrm/shift',
    method: 'post',
    data
  })
}
export function updateShift(data) {
  return request({
    url: '/hrm/shift',
    method: 'put',
    data
  })
}
export function delShift(shiftIds) {
  return request({
    url: `/hrm/shift/${shiftIds}`,
    method: 'delete'
  })
}

// 排班
export function listSchedule(query) {
  return request({
    url: '/hrm/schedule/list',
    method: 'get',
    params: query
  })
}
export function addSchedule(data) {
  return request({
    url: '/hrm/schedule',
    method: 'post',
    data
  })
}
export function updateSchedule(data) {
  return request({
    url: '/hrm/schedule',
    method: 'put',
    data
  })
}
export function delSchedule(scheduleIds) {
  return request({
    url: `/hrm/schedule/${scheduleIds}`,
    method: 'delete'
  })
}

// 打卡
export function listPunch(query) {
  return request({
    url: '/hrm/punch/list',
    method: 'get',
    params: query
  })
}
export function addPunch(data) {
  return request({
    url: '/hrm/punch',
    method: 'post',
    data
  })
}
export function updatePunch(data) {
  return request({
    url: '/hrm/punch',
    method: 'put',
    data
  })
}
export function delPunch(punchIds) {
  return request({
    url: `/hrm/punch/${punchIds}`,
    method: 'delete'
  })
}

// 考勤结果
export function listAttendCalc(query) {
  return request({
    url: '/hrm/attend/list',
    method: 'get',
    params: query
  })
}

// 假期余额
export function listLeaveBalance(query) {
  return request({
    url: '/hrm/leave/balance/list',
    method: 'get',
    params: query
  })
}
export function addLeaveBalance(data) {
  return request({
    url: '/hrm/leave/balance',
    method: 'post',
    data
  })
}
export function updateLeaveBalance(data) {
  return request({
    url: '/hrm/leave/balance',
    method: 'put',
    data
  })
}
export function delLeaveBalance(balIds) {
  return request({
    url: `/hrm/leave/balance/${balIds}`,
    method: 'delete'
  })
}

