import request from "@/utils/request";

// 新增申请调班
export function addWork(data) {
  return request({
    url: "duty/dutyAdjust/startDutyAdjust",
    method: "post",
    data: data,
  });
}
//调班当天值班人
export function getConditionUsers(data) {
  return request({
    url: "/duty/duty/getConditionUsers",
    method: "post",
    data: data,
  });
}
//获取详情
export function getLastDutyAdjustByUserId(query) {
  return request({
    url: "/duty/dutyAdjust/getLastDutyAdjustByUserId",
    method: "post",
    params: query,
  });
}

// export function execAdjustDuty(data) {
//   let f = new FormData();
//   Object.keys(data).forEach((key) => {
//     f.append(key, data[key]);
//   });
//   return request({
//     url: "duty/dutyAdjust/execAdjustDuty",
//     method: "post",
//     data: f,
//   });
// }
// 更新
export function updateYwDutyAdjustAudit(query) {
  return request({
    url: "duty/dutyAdjust/updateYwDutyAdjustAudit",
    method: "post",
    params: query,
  });
}

// 最后调班
export function execAdjustDuty(query) {
  return request({
    url: "/duty/dutyAdjust/execAdjustDuty",
    method: "post",
    params: query,
  });
}
