import request from '@/assets/js/utils/request'
import { createURL } from '@/assets/js/utils/index'
/*
 * =======================采购人报价大厅==============================
 * */
// 项目经理点击驱动报价大厅显示信息
export function offerHall(packId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/offerHall?packId=' + packId,
    method: 'post'
  })
}
// 进入报价大厅(分项报价)
export function goOfferHall(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/goOfferHall',
    method: 'post',
    data
  })
}
// 生成报价单（询价大厅）
export function generateQuotationTemplate(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/generateQuotationTemplate',
    method: 'post',
    data
  })
}
// 获取该标段的项目驱动步骤信息
export function getProcurementStageByPackId(packId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferStage/getProcurementStageByPackId?packId=' + packId,
    method: 'post'
  })
}
// 查询报价页面展示信息(供应商)
export function queryNoOfferByPackId(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/queryNoOfferByPackId' + createURL(data),
    method: 'post'
  })
}
// 保存报价
export function saveOrUpdateOffer(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/saveOrUpdateOffer',
    method: 'post',
    data
  })
}
// 提交或撤销报价
export function submitOrUndoOffer(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/submitOrUndoOffer',
    method: 'post',
    data
  })
}
// 结束报价
export function endQuote(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/endQuote' + createURL(data),
    method: 'post'
  })
}
// 报价结束时间添加3天
export function addQuoteEndTimeThreeDay(stageId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/addQuoteEndTimeThreeDay?stageId=' + stageId,
    method: 'post'
  })
}
// 通过驱动编码将当前驱动节点标记为选择的进程状态
export function startProjectDriveNodeByTaskIdentification(data) {
  return request({
    url: '/bidprocurement/bidding-bidDriver/driverProject/bidtProjectDriverDriveSupplierPackFeignClient/startSupplierDriveNodeByTaskIdentification' + createURL(data),
    method: 'post'
  })
}
// 保存报价轮次信息
export function saveOfferStage(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferStage/saveOfferStage',
    method: 'post',
    data
  })
}
// 当前供应商获取阶段对应的报价信息
export function getOfferStageListByPackId(packId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getOfferStageListByPackId?packId=' + packId,
    method: 'post'
  })
}
// 获取供应商对应的物资信息
export function getOfferSubjectMatterList(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getOfferSubjectMatterList' + createURL(data),
    method: 'post'
  })
}
// 供应商获取报价记录
export function getOfferRecordBySupplierId(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getOfferRecordBySupplierId',
    method: 'post',
    data
  })
}
// 采购员获取报价记录
export function getOfferRecordList(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getOfferRecordList',
    method: 'post',
    data
  })
}
// 查询供应商报价信息
export function querySupplierOfferMessage(stageId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/querySupplierOfferMessage?stageId=' + stageId,
    method: 'post'
  })
}
/*
 * =======================竞价大厅公共==============================
 * */
// 获取竞价大厅获取竞价规则
export function getOfferNotOpen(packId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/getOfferNotOpen?packId=' + packId,
    method: 'post'
  })
}
/*
 * =======================采购人竞价大厅==============================
 * */
// 报价趋势（采购人）
export function getPriceTrend(params) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/getPriceTrend',
    method: 'post',
    params
  })
}
// 报价排名（采购人）
export function quotationRanking(params) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/quotationRanking',
    method: 'post',
    params
  })
}
// 结束竞价（采购人）
export function endBidding(params) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/endBidding',
    method: 'post',
    params
  })
}
/*
 * =======================供应商竞价大厅==============================
 * */
// 获取我的报价【最初报价、最新报价、我的排名、报价次数】
export function getBidOfSupplier(packId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/getBidOfSupplier?packId=' + packId,
    method: 'post'
  })
}
// 保存报价
export function addBidPriceOffer(params) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/addBidPriceOffer',
    method: 'post',
    params
  })
}
// 全部报价（供应商）
export function quotationRankingForSupplier(params) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/quotationRankingForSupplier',
    method: 'post',
    params
  })
}
// 获取我的竞价记录按报价时间升序排列
export function getMyOfferBidPriceRecords(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferBidPrice/getMyOfferBidPriceRecords',
    method: 'post',
    data
  })
}

// 获取最后一轮次报价信息
export function getLastOfferSureDetatilByOfferId(offerId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getLastOfferSureDetatilByOfferId?offerId=' + offerId,
    method: 'post'
  })
}
/** ===========================供应商盖章api Start======================================================== */
// 查询签章状态
export function querySignatureStatus(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/querySignatureStatus',
    method: 'post',
    data
  })
}
// 获取【身份认证的二维码】
export function getQRCodeContent() {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getQRCodeContent',
    method: 'post'
  })
}
// 生成二维码
export function getQRCencodeQrcode(content) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/encodeQrcode?content=' + content,
    method: 'post',
    async: false,
    responseType: 'blob'
  })
}
// 获取二维码登录信息（认证信息）
export function getSupplierQRCodeLoginInfo(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getQRCodeLoginInfo',
    method: 'post',
    async: false,
    data
  })
}
// 获取签章列表1
export function getSupplierSealImageListInfo() {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getSealImageListInfo',
    method: 'post',
    async: false
  })
}
// 获取签章列表2
export function getSealImageListInfoRedis() {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getSealImageListInfoRedis',
    method: 'post',
    async: false
  })
}
// 获取签章二维码数据
export function getSupplierSignatureQRCodeContent(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getSignatureQRCodeContent',
    method: 'post',
    async: false,
    data
  })
}
// 签章合章
export function getSupplierSignatureValueSealPDF(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementSupplierSignature/getSignatureValueSealPDF',
    method: 'post',
    async: false,
    data
  })
}
/** ===========================供应商盖章api End======================================================== */

// 邀请供应商加入视频会议列表
export function getRoomSupplierList(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getRoomSupplierList?packId=' + data.packId,
    method: 'post',
    async: false,
    data
  })
}
// 保存项目经理是否邀请供应商参与视频
export function saveInvitationStatus(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/saveInvitationStatus?isInvitationMeetRoom=' + data.isInvitationMeetRoom + '&roomId=' + data.roomId + '&id=' + data.id,
    method: 'post',
    async: false,
    data
  })
}
// 供应商【进入视频会议】
export function comeintoFSMeetingRoomBySupplier(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/comeintoFSMeetingRoomBySupplier?packId=' + data.packId,
    method: 'post',
    async: false,
    data
  })
}
// 供应商上传应答文件
export function uploadBidReply(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/uploadBidReply',
    method: 'post',
    data
  })
}
// 获取应答文件列表
export function getProtProcurementBidReplyList(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getProtProcurementBidReplyList',
    method: 'post',
    data
  })
}
// 删除供应商应答文件
export function delBidReply(majorId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/delBidReply?id=' + majorId,
    method: 'post'
  })
}

// 获取报价按钮状态
export function getOfferFunctionButton(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/getOfferFunctionButton',
    method: 'post',
    data
  })
}

// 导出需要报价的行项目
export function exportOfferList(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/exportOfferList',
    method: 'get',
    params: data,
    responseType: 'blob'
  })
}

// 导入需要报价的行项目
export const importOfferInfoList = '/bidprocurement/procurement-offer/procurementOfferSure/importOfferInfoList'

// 查询供应商报价明细
export function queryOfferSureDetailListByOfferId(offerId) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/queryOfferSureDetailListByOfferId?offerId=' + offerId,
    method: 'get'
  })
}
// 查询报价记录ip地址标红
export function checkOfferRecord(data) {
  return request({
    url: '/bidprocurement/procurement-offer/procurementOfferSure/checkOfferRecord',
    method: 'post',
    data
  })
}
