import { http } from "@/utils/http";
// 部门
type addDept = {
  code: number;
  msg: string;
  data: boolean;
};
type addDeptList = {
  code: number;
  msg: string;
  data: Array<any>;
};
// 添加考核信息
export const postAddAssessment = data => {
  return http.request<addDept>("post", "/assessment/addAssessment", { data });
};
// 添加考核信息
export const postAddAssessmentObject = data => {
  return http.request<addDept>("post", "/assessment/addAssessmentObject", {
    data
  });
};
// 考核信息详情(考核对象)
export const getAssessmentObjectDetails = params => {
  return http.request<addDeptList>(
    "get",
    "/assessment/getAssessmentObjectDetails",
    {
      params
    }
  );
};
// 修改考核信息详情(考核指标)
export const postUpdateAssessmentQuotaDetails = data => {
  return http.request<addDeptList>(
    "post",
    "/assessment/updateAssessmentQuotaDetails",
    {
      data
    }
  );
};
// 公式设置修改(考核指标)
export const postUpdateAssessmentFormulas = data => {
  return http.request<addDeptList>(
    "post",
    "/assessment/updateAssessmentFormulas",
    {
      data
    }
  );
};

// 考核详情
export const getAssessmentDetails = params => {
  return http.request<addDept>("get", "/assessment/getAssessmentDetails", {
    params
  });
};
// 考核详情
export const updateAssessment = data => {
  return http.request<addDept>("post", "/assessment/updateAssessment", {
    data
  });
};
// 批量删除被考核人
export const delAssessmentObject = data => {
  return http.request<addDept>("post", "/assessment/delAssessmentObject", {
    data
  });
};
// 考核指标批量删除考核指标相关信息
export const delBatchDelScoreInfoVO = data => {
  return http.request<addDept>("post", "/assessment/batchDelScoreInfoVO", {
    data
  });
};
// 考核信息详情(考核指标)
export const getAssessmentQuotaDetails = params => {
  return http.request<addDeptList>(
    "get",
    "/assessment/getAssessmentQuotaDetails",
    {
      params
    }
  );
};
// 考核指标修改
export const updateAssessmentQuotaDetails = data => {
  return http.request<addDept>(
    "post",
    "/assessment/updateAssessmentQuotaDetails",
    {
      data
    }
  );
};
// 查询考核信息详情(考核指标)前先调用此接口,插入类型是自动采集的完成值
export const alterFinishValue = params => {
  return http.request<addDept>("get", "assessment/alterFinishValue", {
    params
  });
};
// 同步自动采集的完成值
export const automaticCollection = params => {
  return http.request<addDept>("get", "/assessment/automaticCollection", {
    params
  });
};
// 考核指标管理表头设置
export const setTableHeader = data => {
  return http.request<addDept>("post", "/assessment/setTableHeader", {
    data
  });
};
