import request from '@/assets/js/utils/request'
import { createURL } from '@/assets/js/utils/index'

/*
 * =======================采购人-项目管理-成交結果Start==============================
 * */
// 最低成交价法(中选汇总)
export function queryMinimumTransactionPriceWinningResultInfo(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/queryMinimumTransactionPriceWinningResultInfo',
    method: 'post',
    data
  })
}

// 最低成交价法(行项目报价明细)
export function queryMinimumTransactionPriceWinningResultDetailList(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/queryMinimumTransactionPriceWinningResultDetailList',
    method: 'post',
    data
  })
}

// 采购结果-提交中选请求
export function saveMinimumTransactionPrice(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/saveMinimumTransactionPrice',
    method: 'post',
    data
  })
}
// 采购结果-导出比价分析表
export function exportPriceComparisonAnalysisTable(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/exportPriceComparisonAnalysisTable',
    method: 'post',
    responseType: 'blob',
    data
  })
}
//  成交通知书 - 发送成交通知书
export function sendNotice(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/sendNotice',
    method: 'post',
    data
  })
}
//  成功通知书 - 发送结果通知书
export function sendResultNotice(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/sendResultNotice',
    method: 'post',
    data
  })
}
// 供应商查看结果通知书
export function queryNotice(packId) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/queryNotice?packId=' + packId,
    method: 'post'
  })
}
// 部门经理查询中选审核列表
export function queryAuditWinningResultList(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/queryAuditWinningResultList',
    method: 'post',
    data
  })
}
// 部门经理审核采购结果
export function auditWinningResult(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/auditWinningResult',
    method: 'post',
    data
  })
}
// 查看通知书（采购人/供应商通用方法）
export function queryNoticeOrSupplier(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/queryNoticeOrSupplier',
    method: 'post',
    data
  })
}
// 采购记过-打印供应商报价
export function printSupplierOffer(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/printSupplierOffer' + createURL(data),
    method: 'post',
    responseType: 'blob'

  })
}
// 打印供应商报价
export function printSupplierOfferNew(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/printSupplierOfferNew',
    method: 'post',
    data,
    responseType: 'blob'
  })
}
// 采购记过-释放或者退回行项目
export function releaseProcurementWinningSureDetail(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/releaseProcurementWinningSureDetail',
    method: 'post',
    data

  })
}
// 查询中标结果信息
export function queryWinningResultInfoByPackId(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/queryWinningResultInfoByPackId',
    method: 'post',
    data

  })
}
// 采购结果-查询中选行项目tab列表请求
export function queryResultVersionList(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResultVersion/queryResultVersionList',
    method: 'post',
    data

  })
}

// 成交记录API接口
export function getProtProjectTransactionRecordsList(params) {
  return request({
    url: '/bidprocurement/procurement-result/transactionRecords/getProtProjectTransactionRecordsList',
    method: 'get',
    params
  })
}
/*
 * =======================采购人-项目管理-成交結果End==============================
 * */
/*
 * =======================采购人-项目管理-成交结果公示Start==============================
 * */
//  成交公示-查询结果公示基本信息
export function queryBaseProcurementPublicityInfo(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/queryBaseProcurementPublicityInfo?packId=' + data,
    method: 'get'
  })
}
//  成交公示-未公示-预览公告模板
export function previewProcurementPublicityTemplate(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/previewProcurementPublicityTemplate',
    method: 'post',
    data
  })
}
//  成交公示-未公示-提交
export function submitPublicity(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/submitPublicity',
    method: 'post',
    data
  })
}
//  成交公示-已公示-查看
export function alreadyPublicity(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/alreadyPublicity?packId=' + data,
    method: 'get'
  })
}
// 发送采购公告列表
export function queryPublicityListByPackId(packId) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/queryPublicityListByPackId?packId=' + packId,
    method: 'get'
  })
}
// 查看变更详情html
export function getTemplateById(id) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/getTemplateById?id=' + id,
    method: 'get'
  })
}
// 中选审核页面获取中选公告
export function getTemplate(tenderId, packId) {
  return request({
    url: '/bidprocurement/procurement-result/procurementPublicity/getTemplate?tenderId=' + tenderId + '&packId=' + packId,
    method: 'get'
  })
}
/*
 * =======================采购人-项目管理-成交结果公示End==============================
 * */
/*
 * =======================采购人-项目管理-成交結果通知书Start==============================
 * */
//  成交通知书 - 查询成交通知书信息
export function queryBaseProcurementNoticeInfo(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/queryBaseProcurementNoticeInfo',
    method: 'post',
    data
  })
}
//  成交通知书 - 通知书列表
export function listProcurementNoticePages(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/listProcurementNoticePages',
    method: 'post',
    data
  })
}
//  成交通知书 - 预览成交通知书模板
export function previewProcurementNoticeTemplate(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/previewProcurementNoticeTemplate',
    method: 'post',
    data
  })
}
//  成交通知书 - 预览成交结果通知书模板
export function previewProcurementResultNoticeTemplate(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/previewProcurementResultNoticeTemplate?packId=' + data,
    method: 'get'
  })
}
/*
 * =======================采购人-项目管理-成交結果通知书End==============================
 * */
// 获取中选通知书附件信息
export function getNoticePdfAttachment(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/getNoticePdfAttachment' + createURL(data),
    method: 'post'
  })
}
/*
 * =======================供应商--成交結果通知书start==============================
 * */
export function listProcurementNoticeSupplierPages(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/listProcurementNoticeSupplierPages',
    method: 'post',
    data
  })
}

// 查询通知书html
export function getNoticeHtmlByPackId(packId) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/getNoticeHtmlByPackId?packId=' + packId,
    method: 'get'
  })
}

/*
 * =======================合同==============================
 * */

// 根据项目id查询中标供应商信息
export function selectWinnerSupplierInfo(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/selectWinnerSupplierInfo',
    method: 'post',
    data
  })
}
// 根据项目id查询中标供应商信息
export function getPurchaseDepartInfo() {
  return request({
    url: '/bidprocurement/procurement-result/procurementNotice/getPurchaseDepartInfo',
    method: 'post'
  })
}
/*
 * =======================采购--采购结果start==============================
 * */
// 采购结果供应商竞价列表
export function queryBiddingWinningResultInfo(params) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/queryBiddingWinningResultInfo',
    method: 'get',
    params
  })
}
// 提交结果
export function saveBiddingResults(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/saveBiddingResults',
    method: 'post',
    data
  })
}
// 中选审核
export function auditBiddingWinningResult(data) {
  return request({
    url: '/bidprocurement/procurement-result/procurementWinningResult/auditBiddingWinningResult',
    method: 'post',
    data
  })
}
