import request from "@/utils/request";

export function weeks() {
  return request({
    url: "/oa/attendance/weeks",
    method: "get",
  });
}
//该部门所有成员
export function all() {
  return request({
    url: "/oa/attendance/dept/all",
    method: "get",
  });
}
//考勤对接节假日
export function holiday(id) {
  return request({
    url: "/oa/attendance/holidaysOfWeek/" + id,
    method: "post",
  });
}
//添加考勤
export function insertList(data) {
  return request({
    url: "/oa/attendance/insertList",
    method: "post",
    data: data,
  });
}
//一周考勤
export function oneWeek(query) {
  return request({
    url: "/oa/attendance/oneWeek",
    method: "get",
    params: query,
  });
}
//上一周下一周
export function sxweek(data) {
  let f = new FormData();
  Object.keys(data).forEach((key) => {
    f.append(key, data[key]);
  });
  return request({
    url: "/oa/attendance/sxweek",
    method: "post",
    data: f,
  });
}
//查询当前登录人部门当前周数的部门内所有人考勤
export function deptList(query) {
  return request({
    url: "/oa/attendance/dept/list",
    method: "get",
    params: query,
  });
}
//1-x号
export function attendanceEditDay() {
  return request({
    url: "/system/config/configKey/attendanceEditDay",
    method: "get",
  });
}
