/*
 * @Author: 付刚
 * @Date: 2021-06-03 18:19:55
 * @LastEditors: 付刚
 * @LastEditTime: 2021-06-17 12:59:23
 * @FilePath: \MuduAPP\src\api\api2.js
 */
import { request } from '@/api/request.js'

// 获取所有区域名称
export function getareaall() {
  return request.get('area/getareaall')
}

// -----------------------------以下limit:1000

// 巡查打卡-/api/v1.0/checks/checkslist 巡查列表
export function getCheckslist(params) {
  return request.get('checks/checkslist', { params: params })
}
//巡查详情-api/v1.0/checks/checksinfo/id 根据id获取巡查信息
export function getChecksinfo(id) {
  return request.get('checks/checksinfo/' + id)
}

//巡查上报 /api/v1.0/checks/checkscreate
export function postCheckscreate(data) {
  return request({
    url: 'checks/checkscreate',
    method: 'post',
    data: data
  })
}

export function getProbing(params) {
  return request.get('enterprise/getsafepersonimproving', { params: params })
}
// 巡查详情图片合集
export function getAttachment(id) {
  // console.log('附件ID图', id)
  return request.get(
    // 'attachment/getattachment/69e450e4-c8ca-47ff-a30a-c79cae653d52'
    'attachment/getattachment/' + id
  )
}

/**
 * 查询所有公司列表
 * 企业单位选择器
 * @param {*} params
 * @returns
 */
export function getEnterpriselist(params) {
  return request.get('enterprise/enterpriselist/', { params: params })
}

// 领导
export function getEnterprisenotrightlist(params) {
  return request.get('enterprise/getenterprisenotrightlist/', {
    params: params
  })
}

/**
 * 查询所有字典列表
 * @param {}} params
 * @returns
 */
export function getDictionarydetaillist(params) {
  return request.get('dictionary/getdictionarydetaillist/', { params: params })
}

// 上传图片,返回上传成功的文件列表,需要回写RelationID值
export function postUploadimagefile(data, params) {
  return request({
    url: 'attachment/uploadimagefile',
    method: 'post',
    data: data,
    params: params
  })
}

// 风险隐患-checks/gettroublelist 隐患列表
export function getTroublelist(params) {
  return request.get('checks/gettroublelist/', { params: params })
}

// 隐患上报 /api/v1.0/checks/troublecreate
export function postTroublecreate(data) {
  return request({
    url: 'checks/troublecreate',
    method: 'post',
    data: data
  })
}

//风险详情整改工单详情-/api/v1.0/checks/troubleinfo/{id}根据id获取隐患信息
export function getTroubleinfo(id) {
  return request.get('checks/troubleinfo/' + id)
}

//整改工单-/api/v1.0/improving/improvinglist 整改列表
export function getImprovinglist(params) {
  return request.get('improving/improvinglist', { params: params })
}

//整改工单详情 /api/v1.0/improving/improvinginfo/{id} 根据id获取整改信息
export function getImprovinginfo(id) {
  return request.get('improving/improvinginfo/' + id)
}

//添加工单 /api/v1.0/improving/improvingcreate 新增整改
export function postImprovingcreate(data) {
  return request({
    url: 'improving/improvingcreate',
    method: 'post',
    data: data
  })
}

//现场复查 /api/v1.0/improving/reviewcreate 新建整改复查
export function postReviewcreate(data) {
  return request({
    url: 'improving/reviewcreate',
    method: 'post',
    data: data
  })
}

// 延期整改 /api/v1.0/improving/delaycreate 新建整改延期
export function postDelaycreate(data) {
  return request({
    url: 'improving/delaycreate',
    method: 'post',
    data: data
  })
}
// 根据归属地条件获取园区统计
export function getEnterpriseparkcount(params) {
  return request.get('enterprise/enterpriseparkcount', { params: params })
}

// 根据归属地条件获取园区列表
export function getParknotrightlist(params) {
  return request.get('enterprise/getparknotrightlist', { params: params })
}

// 园区详情 enterprise/parkinfo/
export function getParkinfo(id) {
  return request.get('enterprise/parkinfo/' + id)
}
// 复查记录
export function getReviewlist(params) {
  return request.get('improving/getreviewlist', { params: params })
}

export function getReviewinfo(id) {
  return request.get('improving/reviewinfo/' + id)
}
