/**
 * 年假相关
 */

import request from '@/utils/request'

/**
 * 年假余额查询列表
 * @param {*} query
 * @returns
 */
export function balanceList(query) {
  return request({
    url: '/nj/balance/manage/query',
    method: 'get',
    params: query
  })
}

/**
 * 年假规则设置查询列表
 * @param {*} query
 * @returns
 */
export function ruleList(query) {
  return request({
    url: '/nj/rule/config/queryRuleConfig',
    method: 'get',
    params: query
  })
}

/**
 * 年假规则新增
 * @param {*} data
 * @returns
 */
export function addRule(data) {
  return request({
    url: '/nj/rule/config/addRuleConfig',
    method: 'post',
    data: data
  })
}

/**
 * 年假规则删除
 * @param {*} query
 * @returns
 */
export function delRule(query) {
  return request({
    url: '/nj/rule/config/delRule',
    method: 'get',
    params: query
  })
}

/**
 * 年假休假明细
 * @param {*} query
 * @returns
 */
export function detailList(query) {
  return request({
    url: '/nj/balance/manage/detail/query',
    method: 'get',
    params: query
  })
}

/**
 * 年假新增明细
 * @param {*} data
 * @returns
 */
export function detailApply(data) {
  return request({
    url: '/nj/balance/manage/detail/apply',
    method: 'post',
    data
  })
}
/**
 * 年假删除明细
 * @param {*} id
 * @returns
 */
export function delDetail(id) {
  return request({
    url: `/nj/balance/manage/detail/${id}`,
    method: 'delete'
  })
}
/**
 * 获取日历
 * @param {*} query
 * @returns
 */
export function getCalendar() {
  return request({
    url: '/nj/balance/manage/detail/calendar_query',
    method: 'get'
  })
}
