import request from '@/assets/js/utils/request'
import { createURL } from '@/assets/js/utils'
// 获取招标项目列表
export function getBuildingProjectTenderProjectList(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/getBuildingProjectTenderProjectList' + createURL(data),
    method: 'post'
  })
}
// 根据条件分页获取建设项目列表
export function getConstructionProjectByPage(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/getBuildingProjectPages',
    method: 'post',
    data
  })
}
// 初始化多级字典信息
export function initMultiStageTypeGroup(groupCode) {
  return request({
    url:
      '/bidprocurement/common-tools/tools/baseTypeGroup/typegroup/initMultiStageTypeGroup?groupCode=' +
      groupCode,
    method: 'post'
  })
}
// 获取所属机构列表
export function queryBuyersList() {
  return request({
    url:
      '/bidprocurement/bidding-biddingProject/biddingProject/queryBuyersList',
    method: 'post'
  })
}
// 根据条件分页获取建设项目列表》立项-选择建设项目
export function getBuildingProjectByPage(data) {
  return request({
    url: `/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/getBuildingProjectPages`,
    method: 'post',
    data
  })
}
// 保存建设项目
export function saveConstructionProject(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/saveBuildingProject',
    method: 'post',
    data
  })
}
// 删除建设项目
export function removeConstructionProjectById(data) {
  return request({
    url: `/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/removeBuildingProjectById/${data}`,
    method: 'post'
  })
}
// 根据id获取建设项目
export function getConstructionProjectById(data) {
  return request({
    url: `/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/getBuildingProjectById/${data}`,
    method: 'post'
  })
}
// 审核建设项目
export function checkBuildingProject(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-buildingproject/pretcloud_buildingproject/buildingproject/checkBuildingProject',
    method: 'post',
    data
  })
}
// *************************************委托合同**************************//
// 根据条件获取委托合同列表
export function getContractByPage(data) {
  return request({
    url: `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/getContractByPage`,
    method: 'post',
    data
  })
}
// 委托人按条件分页查询
export function getConsignorByPage(data) {
  return request({
    url: `/bidprocurement/pretcloud-entrustcontract/taskplan/consignor/getConsignorByPage`,
    method: 'post',
    data
  })
}

// 根据条件获取委托合同列表》立项-选择委托合同项目
export function getContractByPageSelet(data) {
  return request({
    url: `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/getContractByPage`,
    method: 'post',
    data
  })
}
// 新增委托合同
export function saveConstract(data) {
  return request({
    url: `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/saveConstract`,
    method: 'post',
    data
  })
}
// 根据ID删除委托合同
export function deleteConstractById(data) {
  return request({
    url:
      `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/deleteConstractById?contractId=` +
      data,
    method: 'post'
  })
}
// 根据ID查询单个合同信息
export function getContract(data) {
  return request({
    url:
      `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/getContract?contractId=` +
      data,
    method: 'post'
  })
}
// 根据ID审核合同并修改状态
export function auditConstractById(data) {
  const urlParams = createURL(data)
  return request({
    url:
      `/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/auditConstractById` +
      urlParams,
    method: 'post'
  })
}

// 委托合同废弃或失效
export function discardOrInvalidContract(data) {
  return request({
    url: '/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/discardOrInvalidContract' + createURL(data),
    method: 'post'
  })
}
// 根据委托合同id获取是否关联招标项目
export function getRelevanceTenderProjectStatusVo(data) {
  return request({
    url: '/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/getRelevanceTenderProjectStatusVo',
    method: 'post',
    data
  })
}

// 委托合同获取关联招标项目列表
export function getEntrustContentTenderProjectList(data) {
  return request({
    url: '/bidprocurement/pretcloud-entrustcontract/Pretendering/PretEntrustcontractPretenderingConsignContractController/getEntrustContentTenderProjectList',
    method: 'post',
    data
  })
}
