import request from '@/utils/request'

// 查询隐患申请列表
export function listApprovedanger(query) {
  return request({
    url: '/ehs/approvedanger/list',
    method: 'get',
    params: query
  })
}

// 查询我的申请详细
export function getMyApprovelist(query) {
  return request({
    url: '/ehs/approvedanger/myApprovelist',
    method: 'get',
  params: query
  })
}

// 查询我的待办详细
export function getPendinglist(query) {
  return request({
    url: '/ehs/approvedanger/backlogList',
    method: 'get',
    params: query
  })
}

// 查询已办任务详细
export function getTaskdonelist(query) {
  return request({
    url: '/ehs/approvedanger/doneTaskList',
    method: 'get',
    params: query
  })
}

// 查询流转列表详细
export function getHistorylist(query) {
  return request({
    url: '/ehs/approvedanger/hiTaskList',
    method: 'get',
    params: query
  })
}

// 查询隐患申请详细
export function getApprovedanger(id) {
  return request({
    url: '/ehs/approvedanger/' + id,
    method: 'get'
  })
}

//开启审批流程
export function saveApprovedanger(data) {
  return request({
    url: '/ehs/approvedanger/save',
    method: 'post',
    data: data
  })
}

//新增一般隐患开项
export function saveGeneral(data) {
  return request({
    url: '/ehs/approvedanger/savegeneral',
    method: 'post',
    data: data
  })
}

// 新增隐患申请
export function addApprovedanger(data) {
  return request({
    url: '/ehs/approvedanger',
    method: 'post',
    data: data
  })
}

// 处理隐患申请
export function handleApprovedanger(data) {
  return request({
    url: '/ehs/approvedanger/handle',
    method: 'put',
    data: data
  })
}

// 修改隐患申请
export function updateApprovedanger(data) {
  return request({
    url: '/ehs/approvedanger',
    method: 'put',
    data: data
  })
}

// 删除隐患申请
export function delApprovedanger(id) {
  return request({
    url: '/ehs/approvedanger/' + id,
    method: 'delete'
  })
}

// 导出隐患申请
export function exportApprovedanger(query) {
  return request({
    url: '/ehs/approvedanger/export',
    method: 'get',
    params: query
  })
}
