import request from '@/utils/request'

// 查询安全检查提交列表
export function listCheckRecord(query) {
  return request({
    url: '/laboratory/checkRecord/list',
    method: 'get',
    params: query
  })
}

// 查询安全检查草稿数量
export function listCountCheckRecord(query) {
  return request({
    url: '/laboratory/checkRecord/listCount?isCg=1',
    method: 'get',
    params: query
  })
}

// 查询安全检查草稿列表
export function checkRecord(query) {
  return request({
    url: '/laboratory/checkRecord/list',
    method: 'get',
    params: query
  })
}

//查询草稿详情
export function recordDettailsList(query) {
  return request({
    url: '/laboratory/checkRecord/recordDettailsList',
    method: 'get',
    params: query
  })
}

// 查询安全检查详细
export function getCheckRecord(id) {
  return request({
    url: '/laboratory/checkRecord/' + id,
    method: 'get'
  })
}

// 新增安全检查
export function addCheckRecord(data) {
  return request({
    url: '/laboratory/checkRecord',
    method: 'post',
    data: data
  })
}

// 修改安全检查
export function updateCheckRecord(data) {
  return request({
    url: '/laboratory/checkRecord',
    method: 'put',
    data: data
  })
}

// 删除安全检查
export function delCheckRecord(id) {
  return request({
    url: '/laboratory/checkRecord/' + id,
    method: 'delete'
  })
}

//实验室懒加载
export function selectInfoByRoom(query) {
  return request({
    url: '/laboratory/checkRecord/selectInfoByRoom',
    method: 'get',
    params: query
  })
}

//保存录入检查草稿
export function checkRecordAddC(data) {
  return request({
    url: '/laboratory/checkRecord/addCg',
    method: 'post',
    data: data
  })
}

//提交录入检查
export function checkRecordAdd(data) {
  return request({
    url: '/laboratory/checkRecord/addTj',
    method: 'post',
    data: data
  })
}

// 新增临时检查项
export function addTempCheckOption(data) {
  return request({
    url: '/laboratory/checkOption/temp',
    method: 'post',
    data: data
  })
}

// 查询安全检查临时提交列表
export function tempListCheckRecord(query) {
  return request({
    url: '/laboratory/checkOption/temp/list',
    method: 'get',
    params: query
  })
}

//将草稿继续保存为草稿
export function checkRecordUpdate(data) {
  return request({
    url: '/laboratory/checkRecord/update',
    method: 'post',
    data: data
  })
}

//获取整改列表接口
export function checkRecordList(query) {
  return request({
    url: '/laboratory/checkRecord/list',
    method: 'get',
    params: query
  })
}

//获取整改列表各状态数量接口
export function selectStatusList(query) {
  return request({
    url: '/laboratory/checkRecordDetails/selectDetailsStatusList',
    method: 'get',
    params: query
  })
}

//整改提交接口
export function checkRecordDetailsEditList(data) {
  return request({
    url: '/laboratory/checkRecordDetails/editList',
    method: 'post',
    data: data
  })
}

//获取检查单位
export function treeselect(query) {
  return request({
    url: '/system/dept/treeselect',
    method: 'get',
    params: query
  })
}

//生成整改告知书-多个
export function genNotifyIds(ids) {
  return request({
    url: '/laboratory/checkOption/genNotify/'+ids,
    method: 'post'
  })
}
//生成整改告知书-单个
export function genNoticeId(id) {
  return request({
    url: '/laboratory/checkOption/genNotice/'+id,
    method: 'post'
  })
}

//生成整改报告-单个
export function genReportId(id) {
  return request({
    url: '/laboratory/checkOption/genReport/'+id,
    method: 'post'
  })
}

//根据临时检查项id查询检查记录详情
export function getCheckIdByoptionId(query) {
  return request({
    url: '/laboratory/checkRecord/getCheckIdByoptionId',
    method: 'get',
    params: query
  })
}

//检查记录-未提交草稿记录(新)
export function listJcjl(query) {
  return request({
    url: '/laboratory/checkRecord/listJcjl',
    method: 'get',
    params: query
  })
}

//整改记录
export function listWtzg(query) {
  return request({
    url: '/laboratory/checkRecordDetails/listWtzg',
    method: 'get',
    params: query
  })
}

//发布检查记录
export function release(data) {
  return request({
    url: '/laboratory/release',
    method: 'post',
    data: data
  })
}

//检查是否已发布
export function checkFabu(query) {
  return request({
    url: '/laboratory/checkRecord/checkFabu',
    method: 'get',
    params: query
  })
}

//获取当前用户检查单位列表
export function selectDeptListUserDeptId(query) {
  return request({
    url: '/laboratory/checkRecord/selectDeptListUserDeptId',
    method: 'get',
    params: query
  })
}

//某个检查项出现的隐患次数
export function hiddenDangerCount(query) {
  return request({
    url: '/laboratory/checkRecord/hiddenDangerCount',
    method: 'get',
    params: query
  })
}

//获取问题整改详情
export function getDettailsListInfo(query) {
  return request({
    url: '/laboratory/checkRecordDetails/dettailsList',
    method: 'get',
    params: query
  })
}

//审核列表接口
export function listDzgCheckRecord(query) {
  return request({
    url: '/laboratory/checkRecordDetails/listDzg',
    method: 'get',
    params: query
  })
}

//查询详情接口
export function getDettailsList(query) {
  return request({
    url: '/laboratory/checkRecordDetails/dettailsList',
    method: 'get',
    params: query
  })
}


//审批驳回-审批通过
export function editList(data) {
  return request({
    url: '/laboratory/checkRecordDetails/editList',
    method: 'post',
    data: data
  })
}

//完成整改-暂时无法整改
export function rectification(data) {
  return request({
    url: '/laboratory/checkRecordDetails/rectification',
    method: 'post',
    data: data
  })
}

//查询当前用户是否上传签名
export function getCheckSign(query) {
  return request({
    url: '/laboratory/checkRecord/checkSign',
    method: 'get',
    params: query
  })
}

//查询提交详情
export function recordDetails(query) {
  return request({
    url: '/laboratory/checkRecord/recordDetails',
    method: 'get',
    params: query
  })
}

//检查电机签章接口
export function queryDeptSignByUserId(query) {
  return request({
    url: '/system/dept/sign/queryDeptSignByUserId',
    method: 'get',
    params: query
  })
}


