import request from "@/utils/request";

export function leave(data) {
  return request({
    url: "/dzoa/leave/startLeave",
    method: "post",
    data: data,
  });
}

//获取审批信息
export function getLeave(id) {
  return request({
    url: "/dzoa/leave/sel/" + id,
    method: "get",
  });
}
//获得工作进度
export function WorkProgressBar(token, workID) {
  return request({
    url: "/jflow/restful/WorkProgressBar",
    params: {
      token: token,
      workID: workID,
    },
    method: "GET",
  });
}
//获取当前流程可退回节点
export function getReturnWorkNode(token, workid) {
  return request({
    url: "/jflow/restful/getReturnWorkNode",
    params: {
      token: token,
      workid: workid,
    },
    method: "GET",
  });
}
//退回到指定节点
export function NodeReturnWork(workid, nodeId, returnMsg) {
  return request({
    url: "/offcial/receive/NodeReturnWork",
    params: {
      workid: workid,
      returnToNodeID: nodeId,
      returnMsg: returnMsg,
    },
    method: "GET",
  });
}
//获取退回信息
export function getMsgByType(workid, actiontype) {
  return request({
    url: "/jflow/restful/getMsgByType",
    params: {
      workId: workid,
      actionType: actiontype,
    },
    method: "GET",
  });
}
//请假天数
export function getLeaveDays(query) {
  return request({
    url: "/oa/attendance/getDays",
    method: "post",
    params: query,
  });
}
