import request from '@/assets/js/utils/request'
import { createURL } from '@/assets/js/utils'
/* -------------------------------------立项部分------------------------------------ */
/*
* 招标项目信息
* */
//  领导-招标项目列表
export function listTenderProjectOfLeaderPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectOfLeaderPages',
    method: 'post',
    data
  })
}

// 运维-招标项目列表-查看
export function listTenderProjectOfOperationPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectOfOperationPages',
    method: 'post',
    data
  })
}
// 采购人-招标项目列表-查看
export function listTenderProjectCheckOfBuyersPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectCheckOfBuyersPages',
    method: 'post',
    data
  })
}
//  项目经理/采购人-招标项目列表
export function listTenderProjectPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectPages',
    method: 'post',
    data
  })
}
// 招标项目删除
export function removeProjectPackage(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectPackage/removeProjectPackage' + createURL(data),
    method: 'post'
  })
}
// 根据规则生成项目编号
export function getTenderNoByRule() {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/getTenderNoByRule',
    method: 'post',
    data: {
      id: '123456'
    }
  })
}
// 获取项目分类所有字典信息
export function queryTenderProjectClassification() {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryTenderProjectClassification',
    method: 'post'
  })
}
// 获取项目基本信息所有字典信息
export function queryTenderProjectInitInfo() {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryTenderProjectInitInfo',
    method: 'post'
  })
}
// 查询项目基本信息
export function queryBaseTenderProjectInfo(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryBaseTenderProjectInfo?tenderId=' + tenderId,
    method: 'post'
  })
}
// 是否依法必招，是否限额以上时间规则校验
export function querytenderIsLimit(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/querytenderIsLimit',
    params: {
      tenderId: tenderId
    },
    method: 'post'
  })
}
//  保存项目基本信息
export function saveBaseTenderProjectInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/saveBaseTenderProjectInfo',
    method: 'post',
    async: false, // 同步
    data
  })
}
//  保存项目基本信息
export function saveTenderProjectTrafficInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/saveTenderProjectTrafficInfo',
    method: 'post',
    async: false, // 同步
    data
  })
}
/*
* 项目机构信息
* */
// 查询项目机构信息
export function queryTenderProjectDepartInfo(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectDepart/queryTenderProjectDepartInfo?tenderId=' + tenderId,
    method: 'post'
  })
}
// 保存项目机构信息
export function saveTenderProjectDepartInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectDepart/saveTenderProjectDepartInfo',
    method: 'post',
    async: false, // 同步
    data
  })
}
/*
* 标的清单
* */
// 项目经理/采购人-查看项目标段列表
export function listPackage(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectPackage/listPackage?tenderId=' + tenderId,
    method: 'post'
  })
}
// 项目经理/采购人-保存项目分包信息
export function savePackageInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectPackage/savePackageInfo',
    method: 'post',
    async: false, // 同步
    data
  })
}
// 保存单个物料
export function saveSingleTenderMaterielInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/saveSingleTenderMaterielInfo',
    method: 'post',
    data
  })
}
// 项目经理/采购人-删除物料信息
export function removeTenderMaterielInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/removeTenderMaterielInfo',
    method: 'post',
    data
  })
}
// 项目经理/采购人-公告页获取标段物料信息
export function listPackageMaterielInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/listPackageMaterielInfo',
    method: 'post',
    data
  })
}
export function getTotalBudgets(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/getTotalBudgets' + '?tenderId=' + tenderId,
    method: 'post'
  })
}
/*
* 标包信息
* */
// 根据规则生成标段编号
export function getPackNoListByRule(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectPackage/getPackNoListByRule',
    method: 'post',
    data
  })
}
// 查询项目是否分包不分包
export function queryTenderProjectIsPack(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryTenderProjectIsPack?tenderId=' + tenderId,
    method: 'post'
  })
}
// 保存项目是否分包不分包
export function saveTenderProjectIsPack(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/saveTenderProjectIsPack' + createURL(data),
    method: 'post'
  })
}

// 不分包-获取限价详情
export function queryLimitedPriceInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectLimitedPrice/queryLimitedPriceInfo',
    method: 'post',
    data
  })
}
// 不分包-保存限价
export function saveLimitedPriceInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectLimitedPrice/saveLimitedPriceInfo',
    method: 'post',
    data
  })
}
// 项目经理/采购人-删除标段
export function removePackage(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectPackage/removePackage',
    method: 'post',
    data
  })
}
// 项目经理/采购人-项目物料列表(不分页)
export function listTenderMaterie(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/listTenderMaterie',
    method: 'post',
    data
  })
}
// 项目经理/采购人-项目物料列表(分页)
export function listTenderMateriePages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/listTenderMateriePages',
    method: 'post',
    data
  })
}
// 项目经理/采购人-保存项目物料信息
export function saveTenderMaterielInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/saveTenderMaterielInfo',
    method: 'post',
    async: false, // 同步
    data
  })
}
// 校验所选物料是否同一个计划
export function judgeMaterIsSamePlan(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/judgeMaterIsSamePlan',
    method: 'post',
    data
  })
}
/*
*运维人员
* */
// 运维人员-获取审批项目列表
export function listWaitAuditTenderProjectPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectAudit/listWaitAuditTenderProjectPages',
    method: 'post',
    data
  })
}
// 运维人员-审批项目
export function auditProject(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectAudit/auditProject' + createURL(data),
    method: 'post'
  })
}
// 完成立项提交项目
export function submitTenderProjectInfo(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/submitTenderProjectInfo',
    method: 'post',
    data
  })
}
// 上传处理标的清单excel表格
export const saveMaterielByExcel = '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/saveMaterielByExcel'

/* ===========================基础数据库-项目信息库================================*/
// 项目信息库列表
export function queryInformationBaseList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryInformationBaseList',
    method: 'post',
    data
  })
}

// 获取招标人履历列表(招标人信息库)
export function queryTenderProjectListByBuyersId(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectBuysers/queryTenderProjectListByBuyersId',
    method: 'post',
    data
  })
}

// 获取机构下所有招标项目列表
export function listTenderProjectByAgentIdPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectByAgentIdPages',
    method: 'post',
    data
  })
}

/* ==============================项目查看用户关联API接口========================================*/
// 项目查看用户列表
export function listTenderProjectUserList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectUser/listTenderProjectUserList',
    method: 'post',
    data
  })
}
// 新增项目用户信息
export function saveTenderProjectUser(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectUser/saveTenderProjectUser',
    method: 'post',
    data
  })
}

// 查询项目可分配用户列表
export function listDistributionUserList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectUser/listDistributionUserList',
    method: 'post',
    data
  })
}
// 分配项目用户信息
export function distributionTenderProjectUser(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectUser/distributionTenderProjectUser',
    method: 'post',
    data
  })
}

// 删除项目用户信息
export function deleteTenderProjectUser(tenderProjectUserId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderProjectUser/deleteTenderProjectUser?tenderProjectUserId=' + tenderProjectUserId,
    method: 'post'
  })
}

// 标的清单-物料导出
export function exportMaterielList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProjectSubjectMatter/exportMaterielList',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

// 项目经理认领项目列表
export function listClaimProjectPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listClaimProjectPages',
    method: 'post',
    data
  })
}

// 项目经理确定认领项目
export function executeClaimProject(tenderId) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/executeClaimProject?tenderId=' + tenderId,
    method: 'post'
  })
}

// 清除redis模块-根据查询条件获取项目信息列表
export function listTenderProjectRedisResetPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectRedisResetPages',
    method: 'post',
    data
  })
}

// 清除redis模块-根据项目id获取标段信息列表
export function listPackageRedisResetPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listPackageRedisResetPages',
    method: 'post',
    data
  })
}

// 获取结构下项目信息列表（风险控制部使用）
export function getAllProjectListByDepartId(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/getAllProjectListByDepartId',
    method: 'post',
    data
  })
}

// 根据标段id集合获取是否两步开标-华能项目
export function listIsTwoBidOpeningByStageIds(stageIds) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/taskPlan/listIsTwoBidOpeningByStageIds?stageIds=' + stageIds,
    method: 'post'
  })
}

/* -------------------------------------招标项目归档部分------------------------------------ */

//  项目经理-招标项目归档列表
export function listTenderProjectArchivePages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectArchivePages',
    method: 'post',
    data
  })
}
//  老平台归档查询
export function listTenderProjectArchiveOldPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectArchiveOldPages',
    method: 'post',
    data
  })
}

/* =================================监标人设置相关接口========================== */
// 未设置监标人标段列表
export function listNotSetBidSupervisorPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/listNotSetBidSupervisorPages',
    method: 'post',
    data
  })
}
// 已设置监标人标段列表
export function listSetBidSupervisorPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/listSetBidSupervisorPages',
    method: 'post',
    data
  })
}
// 删除已设置监标人标段
export function removeBidSupervisor(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/removeBidSupervisor',
    method: 'post',
    data
  })
}
// 选择监标人列表
export function listSupervisorUserList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/listSupervisorUserList',
    method: 'post',
    data
  })
}
// 设置监标人
export function setBidSupervisor(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/setBidSupervisor',
    method: 'post',
    data
  })
}
// 领导查看监标人列表
export function listProjectBidSupervisorPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingproject/tenderBidSupervisor/listProjectBidSupervisorPages',
    method: 'post',
    data
  })
}

// 招标公告回退
export function backOfBulletin(data) {
  return request({
    url: '/bidprocurement/bidding-bidBulletin/bulletin/tenderBulletin/backOfBulletin',
    method: 'post',
    data
  })
}
// 招标公告回退列表
export function backOfBulletinList(data) {
  return request({
    url: '/bidprocurement/bidding-bidBulletin/bulletin/tenderBulletin/backOfBulletinList',
    method: 'post',
    data
  })
}
// 招标文件回退
export function backOfTenderDoc(data) {
  return request({
    url: '/bidprocurement/bidding-tenderdoc/tenderdoc/tenderProcfileClient/backOfTenderDoc',
    method: 'post',
    data
  })
}
// 招标文件回退列表
export function backOfTenderDocList(data) {
  return request({
    url: '/bidprocurement/bidding-tenderdoc/tenderdoc/tenderProcfileClient/backOfTenderDocList',
    method: 'post',
    data
  })
}
// 中标结果公示回退
export function backOfWinBidResult(data) {
  return request({
    url: '/bidprocurement/bidding-resultbulletin/bidding-resultbulletin/resultbulletin/backOfWinBidResult',
    method: 'post',
    data
  })
}
// 中标结果公示回退列表
export function backOfWinBidResultList(data) {
  return request({
    url: '/bidprocurement/bidding-resultbulletin/bidding-resultbulletin/resultbulletin/backOfWinBidResultList',
    method: 'post',
    data
  })
}
// 候选人公示回退
export function backOfCandiDateBulletin(data) {
  return request({
    url: '/bidprocurement/bidding-candidatebulletin/bidding-candidatebulletin/candidatebulletin/backOfCandiDateBulletin',
    method: 'post',
    data
  })
}
// 候选人公示回退列表
export function backOfCandiDateBulletinList(data) {
  return request({
    url: '/bidprocurement/bidding-candidatebulletin/bidding-candidatebulletin/candidatebulletin/backOfCandiDateBulletinList',
    method: 'post',
    data
  })
}
// 立项回退列表
export function backOfProjectList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/backOfProjectList',
    method: 'post',
    data
  })
}
// 立项回退列表
export function backOfProject(id) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/backOfProject?id=' + id,
    method: 'post'
  })
}
// 推送招标公告  推送公告服务平台
export function pubBullentin(id) {
  return request({
    url: '/bidprocurement/datacenter-cebpubserver/pubcommserver/pubBulletinController/pubBullentin?bulleninId=' + id,
    method: 'post'
  })
}
// 推送候选人公告 推送公告服务平台
export function pubCandidateBullentin(id) {
  return request({
    url: '/bidprocurement/datacenter-cebpubserver/pubcommserver/pubBulletinController/pubCandidateBullentin?bulleninId=' + id,
    method: 'post'
  })
}
// 推送中标公告 推送公告服务平台
export function pubBidWinBullentin(id) {
  return request({
    url: '/bidprocurement/datacenter-cebpubserver/pubcommserver/pubBulletinController/pubBidWinBullentin?bulleninId=' + id,
    method: 'post'
  })
}
// 重新推送评标公告
export function pushBiddingEvaluation(packId) {
  return request({
    url: '/bidprocurement/datacenter-huanengwuzids/huanengwuzids-purchase/datacHuangzidsBiddingFailHnController/pushBiddingEvaluation?packId=' + packId,
    method: 'post'
  })
}

// 业务运维数据列表
export function queryProjectList(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/queryProjectList',
    method: 'post',
    data
  })
}
// 合同签订，招标-关联项目信息
export function listTenderProjectContractPages(data) {
  return request({
    url: '/bidprocurement/bidding-biddingProject/biddingProject/listTenderProjectContractPages',
    method: 'post',
    data
  })
}
