import request from '@/utils/request'

// 查询项目池列表
export function listPool(query) {
  return request({
    url: '/invest/pool/list',
    method: 'get',
    params: query
  })
}
// 查询阶段列表
export function listStagePool(query) {
  return request({
    url: '/invest/pool/listStage',
    method: 'get',
    params: query
  })
}

// 查询项目池详细
export function getPool(id) {
  return request({
    url: '/invest/pool/' + id,
    method: 'get'
  })
}

// 新增项目池
export function addPool(data) {
  return request({
    url: '/invest/pool',
    method: 'post',
    data: data
  })
}

// 修改项目池
export function updatePool(data) {
  return request({
    url: '/invest/pool',
    method: 'put',
    data: data
  })
}

// 删除项目池
export function delPool(id) {
  return request({
    url: '/invest/pool/' + id,
    method: 'delete'
  })
}
// 修改项目池状态
export function editStage(data) {
  return request({
    url: '/invest/pool/editStage',
    method: 'put',
    data: data
  })
}

// 根据项目ID获取项目流转记录
export function listProjectPoolId(id) {
  return request({
    url: '/system/circulation/listProjectPoolId',
    method: 'get',
    params: { projectPoolId: id }
  })
}

//  查询评估考察列表
export function listReviewList() {
  return request({
    url: '/invest/pool/listReview',
    method: 'get'
  })
}

//  查询项目立项列表 ​/dev-api​/invest​/pool​/listApproval
export function listApprovalList() {
  return request({
    url: '/invest/pool/listApproval',
    method: 'get'
  })
}

//  查询尽职背调列表 ​/dev-api​/invest​/pool​/listInvestigate
export function listInvestigateList() {
  return request({
    url: '/invest/pool/listInvestigate',
    method: 'get'
  })
}

//  查询项目投决列表 ​/dev-api​/invest​/pool​/listDecision
export function listDecisionList() {
  return request({
    url: '/invest/pool/listDecision',
    method: 'get'
  })
}


// 新增评审记录 /dev-api/invest/review
export function addInvestReview(data) {
  return request({
    url: '/invest/review',
    method: 'post',
    data: data
  })
}
//修改评审记录 /dev-api/invest/review
export function updateInvestReview(data) {
  return request({
    url: '/invest/review',
    method: 'put',
    data: data
  })
}
// 删除评审记录
export function delInvestReview(id) {
  return request({
    url: '/invest/review/' + id,
    method: 'delete'
  })
}
//查询评审记录列表
export function getInvestReviewList(id) {
  return request({
    url: '/invest/review/list',
    method: 'get',
    params: { projectPoolId: id }
  })
}




// 尽调
// 根据项目ID获取尽调数据
export function getlistProjectPoolId(id) {
  return request({
    url: '/invest/investigate/listProjectPoolId',
    method: 'get',
    params: { projectPoolId: id }

  })
}

// 新增尽调关联
export function addInvestigate(data) {
  return request({
    url: '/invest/investigate',
    method: 'post',
    data: data
  })
}

// 修改尽调关联
export function updateInvestigate(data) {
  return request({
    url: '/invest/investigate',
    method: 'put',
    data: data
  })
}

//  获取尽调人员关联表详细信息
export function getDueAllPeportList(id) {
  return request({
    url: '/invest/person/list',
    method: 'get',
    params: { projectInvestigateId: id }

  })
}

// 新增尽调人员关联表
export function addInvestigatePerson(data) {
  return request({
    url: '/invest/person',
    method: 'post',
    data: data
  })
}

//尽调列表  /dev-api/invest/investigate/list
export function getInvestigatelist(data) {
  return request({
    url: '/invest/investigate/list',
    method: 'get',
    params: data

  })
}

// 删除尽调关联
export function delInvestigate(id) {
  return request({
    url: '/invest/investigate/' + id,
    method: 'delete'
  })
}
// 根据项目ID获取最新尽调申请
export function investigateListProjectPoolIdNew(id) {
  return request({
    url: '/invest/investigate/listProjectPoolIdNew',
    method: 'get',
    params: { projectPoolId: id }
  })
}
// 根据尽调申请id查下面所有的报告
export function getProjectInvestigateId(id) {
  return request({
    url: '/invest/person/getProjectInvestigateId',
    method: 'get',
    params: { projectInvestigateId: id }
  })
}
// 获取尽调关联详细信息
// /dev-api/invest/investigate/{id}
export function getInvestigateById(id) {
  return request({
    url: '/invest/investigate/' + id,
    method: 'get'
  })
}

//修改尽调完成
export function updateStatus(data) {
  return request({
    url: '/invest/investigate/editStatus',
    method: 'put',
    data: data
  })
}

// 获取尽调关联详细信息
// /dev-api/invest/investigate/{id}
export function getInvestReviewById(id) {
  return request({
    url: '/invest/review/' + id,
    method: 'get'
  })
}

// 查询评估考察列表数量 /dev-api/invest/pool/getReviewNumber
export function getReviewNumber() {
  return request({
    url: '/invest/pool/getReviewNumber',
    method: 'get'
  })
}
// 查询项目立项列表数量 /dev-api/invest/pool/getApprovalNumber
export function getApprovalNumber() {
  return request({
    url: '/invest/pool/getApprovalNumber',
    method: 'get'
  })
}

// 查询尽职背调列表数量 /dev-api/invest/pool/getInvestigateNumber
export function getInvestigateNumber() {
  return request({
    url: '/invest/pool/getInvestigateNumber',
    method: 'get'
  })
}

// 查询项目投决列表数量 /dev-api/invest/pool/getDecisionNumber
export function getDecisionNumber() {
  return request({
    url: '/invest/pool/getDecisionNumber',
    method: 'get'
  })
}
