import request from '@/utils/request'

// 查询每周安全排查列表
export function listWeekcheck(query) {
  return request({
    url: '/safecheck/weekcheck/list',
    method: 'get',
    params: query
  })
}

// 查询每周安全排查
export function getWeekcheckByWeek(query) {
  return request({
    url: '/safecheck/personweekcheck/getWeekcheckByWeek',
    method: 'get',
    params: query
  })
}

// 查询每周安全排查详细
export function getWeekcheck(id) {
  return request({
    url: '/safecheck/weekcheck/' + id,
    method: 'get'
  })
}

// 新增每周安全排查
export function addWeekcheck(data) {
  return request({
    url: '/safecheck/weekcheck',
    method: 'post',
    data: data
  })
}

// 修改每周安全排查
export function updateWeekcheck(data) {
  return request({
    url: '/safecheck/weekcheck',
    method: 'put',
    data: data
  })
}

// 删除每周安全排查
export function delWeekcheck(id) {
  return request({
    url: '/safecheck/weekcheck/' + id,
    method: 'delete'
  })
}

// 作废每周安全排查
export function cancelWeekcheck(id) {
  return request({
    url: '/safecheck/weekcheck/cancel/' + id,
    method: 'delete'
  })
}


// 导出每周安全排查
export function exportWeekcheck(query) {
  return request({
    url: '/safecheck/weekcheck/export',
    method: 'get',
    params: query
  })
}
//获取word url
export function wordView(id) {
  return request({
    url: '/safecheck/weekcheck/wordView/' + id,
    method: 'get',
  })
}

// 申请处理
export function handle(data) {
  return request({
    url: '/safecheck/weekcheck/handle',
    method: 'put',
    data: data
  })
}
// 查询安全总监
export function getSafeDirUserId() {
  return request({
    url: '/safecheck/weekcheck/getSafeDirUserId',
    method: 'get'
  })
}
