/*
 * @Author: your name
 * @Date: 2021-04-27 17:11:09
 * @LastEditTime: 2021-05-14 11:26:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /react-antd-admin-template/src/api/checkPointManage.js
 */


import request from '@/utils/request'

export function getCheckPointList(data) {
  return request({
    url: '/checkPoint/list',
    method: 'get',
    params:{...data}
  })
}

export function editCheckPointList(data) {
    return request({
      url: '/checkPoint/editCheckPoint',
      method: 'post',
      data
    })
}

export function delCheckPointList(data) {
    return request({
      url: '/checkPoint/delCheckPoint',
      method: 'post',
      data
    })
}

export function addCheckPoint(data) {
    return request({
      url: '/checkPoint/addCheckPoint',
      method: 'post',
      data
    })
}


//获取查核项列表
export function getCheckItem(data) {
    return request({
      url: '/checkItem/list',
      method: 'get',
      params:{...data}
    })
}


//获取查核项结果配置添加时下拉列表
export function getCheckItemCheckResultSelecterList() {
  return request({
    url: '/checkItemAttr/listCheckSelected',
    method: 'get',
  })
}

//编辑查核项时新增查核结果
export function addCheckItemCheckResult(data) {
  return request({
    url: '/checkItemAttr/editItemAttr',
    method: 'post',
    data
  })
}


//获取所有查核组列表不分页，用于中间表选择
export function getCheckGroupForBind() {
    return request({
      url: '/checkGroup/listAll',
      method: 'get'
    })
}

export function listAll() {
    return request({
      url: '/checkPoint/listAll',
      method: 'get',
      
    })
}

export function delCheckItem(data) {
    return request({
      url: '/checkItem/delCheckItem',
      method: 'post',
      data
    })
}

export function editCheckItem(data) {
    return request({
      url: '/checkItem/editCheckItem',
      method: 'post',
      data
    })
}

export function addCheckItem(data) {
    return request({
      url: '/checkItem/addCheckItem',
      method: 'post',
      data
    })
}
//以查核点为准添加单位查核点中间关系
export function bindCheckPointAndGroup(data) {
  return request({
    url: '/checkPoint/bindCheckPointAndDept',
    method: 'post',
    data
  })
}

//以查核点为准添加查核点和查核项关系
export function bindCheckPointAndCheckItem(data) {
  return request({
    url: '/checkPoint/bindCheckPointAndCheckItem',
    method: 'post',
    data
  })
}

//以查核项绑查核要点
export function bindCheckItemAndCheckPoint(data) {
  return request({
    url: '/checkItem/bindCheckPointAndCheckItem',
    method: 'post',
    data
  })
}

//取所有查核项列表不分页，用于中间表选择
export function getCheckItemForBind() {
  return request({
    url: '/checkItem/listAll',
    method: 'get'
  })
}

//单位和查核要点关系列表
export function deptAndCheckPointPage(data) {
    return request({
      url: '/sysDepartment/deptAndCheckPointPage',
      method: 'get',
      params:{...data}
    })
}
//删除单位与查核点关系
export function delDeptAndCheckPoint(data) {
    return request({
      url: '/sysDepartment/delDeptAndCheckPoint',
      method: 'post',
      data
    })
}

//查核点和查核组中间关系分页
export function checkPointAndCheckGroupPage(data) {
    return request({
      url: '/checkPoint/checkPointAndCheckGroupPage',
      method: 'get',
      params:{...data}
    })
}
//删除查核点和查核组中间关系
export function delChekPointAndGroup(data) {
    return request({
      url: '/checkPoint/delChekPointAndGroup',
      method: 'post',
      data
    })
}

//查核点和条文条款中间关系
export function checkPointAndArticlePage(data) {
    return request({
      url: '/checkPoint/checkPointAndArticlePage',
      method: 'get',
      params:{...data}
    })
}

//删除查核点和条文条款中间关系
export function delCheckPointAndArticle(data) {
    return request({
      url: '/checkPoint/delCheckPointAndArticle',
      method: 'post',
      data
    })
}

//以查核点为准添加查核点和查核组关系
export function checkPointBindCheckGroup(data) {
  return request({
    url: '/checkPoint/bindCheckPointAndCheckGroup',
    method: 'post',
    data
  })
}

//查核点和查核项中间关系分页
export function getCheckPointAndCheckItemPage(data) {
  return request({
    url: '/checkPoint/checkPointAndCheckItemPage',
    method: 'get',
    params:{...data}
  })
}

//删除查核点和查核项中间关系分页
export function delCheckPointAndCheckItemPage(data) {
  return request({
    url: '/checkPoint/delCheckPointCheckItem',
    method: 'post',
    data
  })
}

//获取查核方式下拉列表
export function getCheckItemTypeList() {
  return request({
    url: '/dictionary/getCheckItemSelector',
    method: 'get',
  })
}

