import request from '@/assets/js/utils/request'
import { createURL } from '../../assets/js/utils'
// 项目经理分页获取获取自建招标计划列表
export function getPretenderingPurchasesSchemePagesManager(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemePagesManager',
    method: 'post',
    data
  })
}
// 项目经理分页获取获取招标计划已分配列表
export function getPretenderingPurchasesSchemeDistributePages(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeDistributePages',
    method: 'post',
    data
  })
}
// 项目经理-分页获取所有未关联的招标计划列表
export function getUnrelatedPurchasesSchemePages(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getUnrelatedPurchasesSchemePages',
    method: 'post',
    data
  })
}
// 项目经理-保存关联招标项目
export function savePretenderingPurchasesProject(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesProject',
    method: 'post',
    data
  })
}
// 分页获取获取招标计划分配或委托信息列表
export function getPretenderingPurchasesSchemeDistributionEntrustPages(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeDistributionEntrustPages',
    method: 'post',
    data
  })
}
// 获取招标计划编号
export function getPretenderingPurchasesSerialNumber(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSerialNumber?code=' + data,
    method: 'post'
  })
}
// 新增招标方案基本信息
export function savePretenderingPurchasesScheme(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesScheme',
    method: 'post',
    data
  })
}
// 根据id获取招标方案信息
export function getPretenderingPurchasesSchemeById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeById/' + data,
    method: 'post'
  })
}
// 保存招标计划信息
export function savePretenderingPurchasesPlan(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesPlan',
    method: 'post',
    data
  })
}
// 根据id删除招标计划信息
export function removePretenderingPurchasesPlanById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removePretenderingPurchasesPlanById/' + data,
    method: 'post'
  })
}
//  批量保存招标计划详细信息
export function saveBatchPretenderingPurchasesPlan(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/saveBatchPretenderingPurchasesPlan',
    method: 'post',
    data
  })
}
//  根据id获取招标计划信息
export function getPretenderingPurchasesPlanById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesPlanBySchemeId/' + data,
    method: 'post'
  })
}
// 保存资格预审办法信息
export function savePretenderingPurchasesPrequalification(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesPrequalification',
    method: 'post',
    data
  })
}
// 根据方案id获取资格预审办法信息
export function getPretenderingPurchasesPrequalificationBySchemeId(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesPrequalificationBySchemeId/' + data,
    method: 'post'
  })
}
//  保存评标办法信息
export function savePretenderingPurchasesEvaluation(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesEvaluation',
    method: 'post',
    data
  })
}
// 根据方案id获取评审办法信息
export function getPretenderingPurchasesEvaluationBySchemeId(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesEvaluationBySchemeId/' + data,
    method: 'post'
  })
}
//  批量保存供应商信息集合
export function saveBatchPretenderingPurchasesSupplier(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/saveBatchPretenderingPurchasesSupplier',
    method: 'post',
    data
  })
}
// 保存供应商信息集合
export function savePretenderingPurchasesSupplier(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesSupplier',
    method: 'post',
    data
  })
}
// 根据id删除供应商信息集合
export function removePretenderingPurchasesSupplierById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removePretenderingPurchasesSupplierById/' + data,
    method: 'post'
  })
}
//  根据id获取供应商信息集合
export function getPretenderingPurchasesSupplierById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSupplierBySchemeId/' + data,
    method: 'post'
  })
}
//  批量保存招标人信息集合
export function saveBatchPretenderingPurchasesBidder(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/saveBatchPretenderingPurchasesBidder',
    method: 'post',
    data
  })
}
// 保存招标人信息集合
export function savePretenderingPurchasesBidder(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesBidder',
    method: 'post',
    data
  })
}
//  根据方案id获取招标人信息集合
export function getPretenderingPurchasesBidderBySchemeId(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesBidderBySchemeId/' + data,
    method: 'post'
  })
}
// 根据id删除招标人信息集合
export function removePretenderingPurchasesBidderById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removePretenderingPurchasesBidderById/' + data,
    method: 'post'
  })
}
//  批量保存评委信息集合
export function saveBatchPretenderingPurchasesJudges(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/saveBatchPretenderingPurchasesJudges',
    method: 'post',
    data
  })
}
// 保存评委信息集合
export function savePretenderingPurchasesEvaluationCommittee(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesEvaluationCommittee',
    method: 'post',
    data
  })
}
//  根据id获取评委信息集合
export function getPretenderingPurchasesJudgesBySchemeId(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesJudgesBySchemeId/' + data,
    method: 'post'
  })
}
// 根据id删除评委信息集合
export function removePretenderingPurchasesJudgesById(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removePretenderingPurchasesJudgesById/' + data,
    method: 'post'
  })
}
// 最后一步 保存招标方案所有信息
export function savePretenderingPurchasesSchemeAll(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesSchemeAll',
    method: 'post',
    data
  })
}
// 根据方案id获取招标计划所有信息
export function getPretenderingPurchasesSchemeAllById(id) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeAllById/' + id,
    method: 'post'
  })
}
// 部门主任分页获取获取招标计划列表
export function getPretenderingPurchasesSchemePagesDeptDirector(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemePagesDeptDirector',
    method: 'post',
    data
  })
}
// 计划管理员分页获取获取招标计划列表
export function getPretenderingPurchasesSchemePagesPlanAdmin(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemePagesPlanAdmin',
    method: 'post',
    data
  })
}
// 分页获取获取招标计划分配规则列表
export function getPretenderingPurchasesRulesPages(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesRulesPages',
    method: 'post',
    data
  })
}
// 保存招标计划分配规则列表
export function savePretenderingPurchasesRules(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretenderingPurchasesRules',
    method: 'post',
    data
  })
}
// 根据id删除招标计划分配规则列表
export function removePretenderingPurchasesRulesById(id) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removePretenderingPurchasesRulesById/' + id,
    method: 'post'
  })
}
// 根据id获取招标计划分配规则列表
export function getPretenderingPurchasesRulesById(id) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesRulesById/' + id,
    method: 'post'
  })
}
// 启用/禁用招标计划分配规则
export function enableOrDisablePretenderingPurchasesRules(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/enableOrDisablePretenderingPurchasesRules',
    method: 'post',
    data
  })
}
// 根据方案id获取评标委员会
export function getPretenderingPurchasesEvaluationCommitteeBySchemeId(id) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesEvaluationCommitteeBySchemeId/' + id,
    method: 'post'
  })
}
// 批量删除招标人
export function removeBatchPretenderingPurchasesBidderByIds(data) {
  return request({
    url:
      '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removeBatchPretenderingPurchasesBidderByIds',
    method: 'post',
    data
  })
}
// 获取招标计划所有字典数据
export function queryPurchaseSchemeInitInfo() {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/queryPurchaseSchemeInitInfo',
    method: 'post'
  })
}

// 分配招标计划
export function distributePretenderingPurchasesScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/distributePretenderingPurchasesScheme',
    method: 'post',
    data
  })
}
// 委托招标计划
export function entrustPretenderingPurchasesScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/entrustPretenderingPurchasesScheme',
    method: 'post',
    data
  })
}

// 根据id集合批量删除供应商
export function removeBatchPretenderingPurchasesSupplierByIds(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/removeBatchPretenderingPurchasesSupplierByIds',
    method: 'post',
    data
  })
}
/* ======================================招标计划-招标方案规则================================================= */

// 分页获取系统级计划管理员分配规则信息
export function getPretenderingPurchasesSchemeSystemRuleVoPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeSystemRuleVoPages',
    method: 'post',
    data
  })
}
// 根据id删除系统级管理员分配规则信息
export function deletePretPurchaseschemePretenderingSystemRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/deletePretPurchaseschemePretenderingSystemRuleById/' + id,
    method: 'post'
  })
}
// 分页获取系统级计划管理员分配规则信息
export function savePretPurchaseschemePretenderingSystemRule(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretPurchaseschemePretenderingSystemRule',
    method: 'post',
    data
  })
}
// 根据id获取系统级管理员分配规则信息
export function getPretPurchaseschemePretenderingSystemRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretPurchaseschemePretenderingSystemRuleById/' + id,
    method: 'post'
  })
}
// 根据id和isUsed切换系统级管理员分配规则启动或禁用
export function isUsedSystemRuleById(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/isUsedSystemRuleById',
    method: 'post',
    data
  })
}
// 系统级计划管理员分页获取获取招标计划列表
export function getPretenderingPurchasesSchemeSystemPlanAdminPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeSystemPlanAdminPages',
    method: 'post',
    data
  })
}
// 系统级手动分配招标计划信息
export function systemManualAssignScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/systemManualAssignScheme',
    method: 'post',
    data
  })
}
// 系统级自动分配招标计划信息
export function systemAutoAssignScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/systemAutoAssignScheme',
    method: 'post',
    data
  })
}
// 根据类型(configType)获取招标计划配置信息 systemCurrentAssignedType系统级当前分配方式 companyCurrentAssignedType公司级当前分配方式 departmentCurrentAssignedType部门级当前分配方
export function getPurchaseSchemeConfigByConfigTypeAndDepartId(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPurchaseSchemeConfigByConfigTypeAndDepartId' + createURL(data),
    method: 'post'
  })
}
// 根据id和configValue更新配置信息
export function editPurchaseSchemeConfigById(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/editPurchaseSchemeConfigById' + createURL(data),
    method: 'post'
  })
}
/* ======================================招标计划-公司级分配================================================= */

// 分页获取公司级计划管理员分配规则信息
export function getPretenderingPurchasesSchemeCompanyRuleVoPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeCompanyRuleVoPages',
    method: 'post',
    data
  })
}
// 据id删除公司级管理员分配规则信息
export function deletePretPurchaseschemePretenderingCompanyRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/deletePretPurchaseschemePretenderingCompanyRuleById/' + id,
    method: 'post'
  })
}
// 保存公司级管理员分配规则信息
export function savePretPurchaseschemePretenderingCompanyRule(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretPurchaseschemePretenderingCompanyRule',
    method: 'post',
    data
  })
}
// 根据id获取公司级管理员分配规则信息
export function getPretPurchaseschemePretenderingCompanyRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretPurchaseschemePretenderingCompanyRuleById/' + id,
    method: 'post'
  })
}
// 根据id和isUsed切换公司级管理员分配规则启动或禁用
export function isUsedCompanyRuleById(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/isUsedCompanyRuleById',
    method: 'post',
    data
  })
}
// 公司级计划管理员分页获取获取招标计划列表
export function getPretenderingPurchasesSchemeCompanyPlanAdminPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeCompanyPlanAdminPages',
    method: 'post',
    data
  })
}
// 公司级自动分配招标计划信息
export function companyAutoAssignScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/companyAutoAssignScheme',
    method: 'post',
    data
  })
}
// 公司级手动分配招标计划信息
export function companyManualAssignScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/companyManualAssignScheme',
    method: 'post',
    data
  })
}

// 公司级计划管理员撤回招标计划
export function recallPurchasesSchemeByCompanyPlanAdmin(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/recallPurchasesSchemeByCompanyPlanAdmin',
    method: 'post',
    data
  })
}
/* ======================================招标计划-部门级分配================================================= */

// 分页获取部门级计划管理员分配规则信息
export function getPretenderingPurchasesSchemeDepartmentRuleVoPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeDepartmentRuleVoPages',
    method: 'post',
    data
  })
}
// 据id删除部门级级管理员分配规则信息
export function deletePretPurchaseschemePretenderingDepartmentRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/deletePretPurchaseschemePretenderingDepartmentRuleById/' + id,
    method: 'post'
  })
}
// 保存部门级管理员分配规则信息
export function savePretPurchaseschemePretenderingDepartmentRule(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/savePretPurchaseschemePretenderingDepartmentRule',
    method: 'post',
    data
  })
}
// 根据id获取部门级级管理员分配规则信息
export function getPretPurchaseschemePretenderingDepartmentRuleById(id) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretPurchaseschemePretenderingDepartmentRuleById/' + id,
    method: 'post'
  })
}
// 根据id和isUsed切换部门级级管理员分配规则启动或禁用
export function isUsedDepartmentRuleById(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/isUsedDepartmentRuleById',
    method: 'post',
    data
  })
}
// 部门级计划管理员分页获取获取招标计划列表
export function getPretenderingPurchasesSchemeDepartmentPlanAdminPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPretenderingPurchasesSchemeDepartmentPlanAdminPages',
    method: 'post',
    data
  })
}
// 部门级自动分配招标计划信息
export function departmentAutoAssignScheme() {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/departmentAutoAssignScheme',
    method: 'post'
  })
}
// 部门级手动分配招标计划信息
export function departmentManualAssignScheme(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/departmentManualAssignScheme',
    method: 'post',
    data
  })
}
// 部门级计划管理员撤回招标计划
export function recallPurchasesSchemeByDepartmentPlanAdmin(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/recallPurchasesSchemeByDepartmentPlanAdmin',
    method: 'post',
    data
  })
}

// 项目经理根据schemeId拒收招标项目（公司级、部门级）
export function returnPurchasesSchemeByProjectManager(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/returnPurchasesSchemeByProjectManager',
    method: 'post',
    data
  })
}

// 分页获取所有未关联的招标计划与物料列表
export function getUnrelatedSchemeMaterialPages(data) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getUnrelatedSchemeMaterialPages',
    method: 'post',
    data
  })
}

// 获取招标计划类型
export function getPlanType(packId) {
  return request({
    url: '/bidprocurement/pretcloud-purchasescheme/pretcloud_purchasescheme/purchasescheme/getPlanType?packId=' + packId,
    method: 'post'
  })
}
