import request from '@/utils/request'

// 检查名称是否存在
export function selectHiddenDangerType(data) {
  return request({
    url: '/project/securityCheck/selectHiddenDangerType',
    method: 'post',
    data,
  })
}

// 新增隐患类别/违章类型
export function addHiddenDangerTypeForm(data) {
  return request({
    url: '/project/securityCheck/addHiddenDangerTypeForm',
    method: 'post',
    data,
  })
}

// 修改隐患类别/违章类型
export function updateHiddenDangerTypeForm(data) {
  return request({
    url: '/project/securityCheck/updateHiddenDangerTypeForm',
    method: 'post',
    data,
  })
}

// 删除隐患类别/违章类型
export function deleteHiddenDangerTypeForm(data) {
  return request({
    url: '/project/securityCheck/deleteHiddenDangerTypeForm',
    method: 'post',
    data,
  })
}

// 获取隐患类别/违章类型列表
export function getHiddenDangerTypeList(params) {
  return request({
    url: '/project/securityCheck/getHiddenDangerTypeList',
    method: 'get',
    params,
  })
}

// 导出隐患类别/违章类型列表
export function exportHiddenDangerTypeList() {
  return '/project/securityCheck/exportHiddenDangerTypeList'
}

// 获取安全检查记录列表
export function getSecurityCheckRecordList(params) {
  return request({
    url: '/project/securityCheck/getSecurityCheckRecordList',
    method: 'get',
    params,
  })
}

// 新增安全检查记录
export function addSecurityCheckRecordForm(data) {
  return request({
    url: '/project/securityCheck/addSecurityCheckRecordForm',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 修改安全检查记录
export function updateSecurityCheckRecordForm(data) {
  return request({
    url: '/project/securityCheck/updateSecurityCheckRecordForm',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 导出安全检查记录列表
export function exportSecurityCheckRecordList() {
  return '/project/securityCheck/exportSecurityCheckRecordList'
}

// 获取业主-下拉列表
export function getOwnerSelect() {
  return request({
    url: '/project/securityCheck/getOwnerSelect',
    method: 'get',
  })
}

// 获取隐患工程-下拉列表
export function getProSelect() {
  return request({
    url: '/project//violationManagement/getUnderConstructionProSelect',
    method: 'get',
  })
}

// 获取整改责任承包商-下拉
export function getConsByProIdSelect(params) {
  return request({
    url: '/project/violationManagement/getConsByProIdSelect',
    method: 'get',
    params,
  })
}

// 隐患问题类别-下拉
export function getTypeOfViolationSelect(params) {
  return request({
    url: '/project/violationManagement/getTypeOfViolationSelect',
    method: 'get',
    params,
  })
}

// 获取部门用户-下拉
export function getDeptUserSelect(params) {
  return request({
    url: '/project/securityCheck/getDeptUserSelect',
    method: 'get',
    params,
  })
}

// 新增隐患
export function addHiddenDanger(data) {
  return request({
    url: '/project/securityCheck/addHiddenDanger',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 获取隐患整改-列表-业主
export function getHiddenDangerRectificationApprovalList(params) {
  return request({
    url: '/project/securityCheck/getHiddenDangerRectificationApprovalList',
    method: 'get',
    params,
  })
}

// 获取隐患整改-列表-承包商
export function getHiddenDangerRectificationList(params) {
  return request({
    url: '/project/securityCheck/getHiddenDangerRectificationList',
    method: 'get',
    params,
  })
}

// 导出隐患整改-列表-业主
export function exportHiddenDangerRectificationApprovalList() {
  return '/project/securityCheck/exportHiddenDangerRectificationApprovalList'
}

// 导出隐患整改-列表-承租方
export function exportHiddenDangerRectificationList() {
  return '/project/securityCheck/exportHiddenDangerRectificationList'
}

// 获取隐患整改-详情
export function getHiddenDangerRectificationForm(params) {
  return request({
    url: '/project/securityCheck/getHiddenDangerRectificationForm',
    method: 'get',
    params,
  })
}

// 整改责任承包商-下拉-责任人
export function getPersonByConsIdSelect(params) {
  return request({
    url: '/project/securityCheck/getPersonByConsIdSelect',
    method: 'get',
    params,
  })
}

// 隐患整改-整改回传-新增
export function addHiddenDangerRectification(data) {
  return request({
    url: '/project/securityCheck/addHiddenDangerRectification',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  })
}

// 隐患整改-验收-通过
export function updateHiddenDangerRectification(data) {
  return request({
    url: '/project/securityCheck/updateHiddenDangerRectification',
    method: 'post',
    data,
  })
}

// 隐患整改-验收-驳回
export function updateSuggestionsForRectification(data) {
  return request({
    url: '/project/securityCheck/updateSuggestionsForRectification',
    method: 'post',
    data,
  })
}

// 工程隐患统计-列表
export function getHiddenDangerStatisticsList(params) {
  return request({
    url: '/project/hiddenDangerStatistics/getHiddenDangerStatisticsList',
    method: 'get',
    params,
  })
}

// 工程隐患统计-导出
export function exportHiddenDangerStatisticsList() {
  return '/project/hiddenDangerStatistics/export'
}

// 工程隐患统计-详情-列表
export function getHiddenProblemsFixList(params) {
  return request({
    url: '/project/hiddenDangerStatistics/getHiddenProblemsFixList',
    method: 'get',
    params,
  })
}

// 工程隐患统计-详情-导出
export function exportHiddenProblemsFixList() {
  return '/project/hiddenDangerStatistics/exportHiddenProblemsFixList'
}

// 撤回隐患
export function revocationHiddenDanger(proId) {
  return request({
    url: '/project/securityCheck/revocationHiddenDanger',
    method: 'put',
    data: proId
  })
}

// 隐患问题类别统计-列表
export function getHiddenProblemCategoryList(params) {
  return request({
    url: '/project/hiddenDangerStatistics/getHiddenProblemCategoryList',
    method: 'get',
    params,
  })
}

// 隐患问题类别统计-导出
export function exportHiddenProblemCategoryList() {
  return '/project/hiddenDangerStatistics/exportHiddenProblemCategoryList'
}

// 隐患问题类别统计-详情-列表
export function getHiddenProblemCategoryDetailsList(params) {
  return request({
    url: '/project/hiddenDangerStatistics/getHiddenProblemCategoryDetailsList',
    method: 'get',
    params,
  })
}

// 隐患问题类别统计-详情-导出
export function exportHiddenProblemCategoryDetailsList() {
  return '/project/hiddenDangerStatistics/exportHiddenProblemCategoryDetailsList'
}


//获取延期审批查看列表数据
export function getReviewOfDeferredApprovalList(params) {
  return request({
    url: '/project/securityCheck/getReviewOfDeferredApprovalList',
    method: 'get',
    params,
  })
}

// 隐患整改-延期申请-提交
export function updateApplicationForExtension(data) {
  return request({
    url: '/project/securityCheck/updateApplicationForExtension',
    method: 'post',
    data: data
  })
}

// 延期验收-通过
export function updateDeferredAcceptancePassed(data) {
  return request({
    url: '/project/securityCheck/updateDeferredAcceptancePassed',
    method: 'post',
    data
  })
}

// 延期验收-驳回
export function updateReasonForDelay(data) {
  return request({
    url: '/project/securityCheck/updateReasonForDelay',
    method: 'post',
    data
  })
}

// 延期申请-撤回
export function withdrawalOfExtension(data) {
  return request({
    url: '/project/securityCheck/withdrawalOfExtension',
    method: 'put',
    data
  })
}