import { request } from "@/utils/request";

export function getRuiHenReportDetail(params) {
  return request({
    url: "/pms/iot-rh-daily-report/get",
    method: "get",
    params,
  });
}

export function createIotRhDailyReport(data) {
  return request({
    url: `/pms/iot-rh-daily-report/create`,
    data,
    method: "post",
  });
}

export function approvalIotRhDailyReport(data) {
  return request({
    url: `/pms/iot-rh-daily-report/approval`,
    data,
    method: "put",
  });
}

export function getRuiHenReportPage(params) {
  return request({
    url: "/pms/iot-rh-daily-report/page",
    method: "get",
    params,
  });
}

// 瑞恒任务列表
export function getRuiHenTaskList(params) {
  return request({
    url: "/rq/iot-project-task/list",
    method: "get",
    params,
  });
}

// 瑞恒任务详情
export function getRuiHenTaskDetail(params) {
  return request({
    url: "/rq/iot-project-task/get",
    method: "get",
    params,
  });
}

export function getRuiHenTaskDetail1(params) {
  return request({
    url: "/rq/iot-project-task/page",
    method: "get",
    params,
  });
}

// 新增瑞恒任务
export function createRuiHenTask(data) {
  return request({
    url: "/rq/iot-project-task/create",
    method: "post",
    data,
  });
}

// 编辑瑞恒任务
export function updateRuiHenTask(data) {
  return request({
    url: "/rq/iot-project-task/update",
    method: "put",
    data,
  });
}

// 合同分页列表，当前页面只使用 deptId 过滤
export function getRuiHenProjectInfoPage(params) {
  return request({
    url: "/rq/iot-project-info/page",
    method: "get",
    params,
  });
}

// 根据施工队伍查询可选施工设备
export function getDevicesByDepts(params) {
  return request({
    url: "/rq/iot-device/getDevicesByDepts",
    method: "get",
    params,
  });
}

// 获取公司层级的部门 及所有子部门
export function companyLevelChildrenDepts() {
  // return  request.get({ url: '/system/dept/companyLevelChildrenDepts' })
  return request({
    url: "/system/dept/companyLevelChildrenDepts",
    method: "get",
  });
}

// 获取公司层级的部门包含的子部门下的所有人员
export const companyDeptsEmployee = (params) => {
  // return request.get({ url: '/system/user/companyDeptsEmployee', params })
  return request({
    url: "/system/user/companyDeptsEmployee",
    method: "get",

    params,
  });
};

export const selectedDeptsEmployee = (params) => {
  return request({
    url: "/system/user/selectedDeptsEmployee",
    method: "get",
    params,
  });
};
