import request from '@/utils/request'
// 查询实验室列表
export function getUserRoleBySub(query) {
  return request({
    url: '/laboratory/subject/getUserRoleBySub',
    method: 'get',
    params: query
  })
}
// 列表提交关联实验室校验
export function getLabRiskPlanJoinSub(data) {
  return request({
    url: '/laboratory/plan/getLabRiskPlanJoinSub',
    method: 'post',
    data: data
  })
}
// 列表提交关联实验室
export function riskPlanJoinSub(data) {
  return request({
    url: '/laboratory/plan/riskPlanJoinSub',
    method: 'post',
    data: data
  })
}
// 提交校验
export function getLabRiskPlanRepeat(data) {
  return request({
    url: '/laboratory/plan/getLabRiskPlanRepeat',
    method: 'post',
    data: data
  })
}
//查询实验室根据实验室管理员用户权限是否有操作权限
export function getUserRoleBySubOperation(query) {
  return request({
    url: '/laboratory/subject/getUserRoleBySubOperation',
    method: 'get',
    params: query
  })
}

// 查询风险预案列表
export function listPlan(query) {
  return request({
    url: '/laboratory/plan/list',
    method: 'get',
    params: query
  })
}

// 查询风险预案详细
export function getPlan(id) {
  return request({
    url: '/laboratory/plan/' + id,
    method: 'get'
  })
}

// 新增风险预案
export function addPlan(data) {
  return request({
    url: '/laboratory/plan',
    method: 'post',
    data: data
  })
}

// 修改风险预案
export function updatePlan(data) {
  return request({
    url: '/laboratory/plan',
    method: 'put',
    data: data
  })
}

// 删除风险预案
export function delPlan(id) {
  return request({
    url: '/laboratory/plan/' + id,
    method: 'delete'
  })
}

// 查询风险预案配置实验室列表
export function getUserRoleBySubBindRisk(query) {
  return request({
    url: 'laboratory/subject/getUserRoleBySubBindRisk',
    method: 'get',
    params: query
  })
}

//删除预案下的实验室
export function removeByPlanJoinSub(data) {
  return request({
    url: '/laboratory/plan/removeByPlanJoinSub',
    method: 'delete',
    data: data
  })
}

