import request from '@/assets/js/utils/request'
import { createURL } from '@/assets/js/utils'
/*
* 异议投诉API接口
* */
// 项目经理查看投标人提出的异议投诉列表
export function listManagerRaiseObjectionPages(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/listManagerRaiseObjectionPages',
    method: 'post',
    data
  })
}
// 根据异议投诉id获取投标人提出异议基本信息
export function getRaiseObjectionInfoByObjectionId(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/getRaiseObjectionInfoByObjectionId',
    method: 'post',
    data
  })
}

// 异议投诉受理(不受理)数据保存(生成异议函)
export function saveObjectionReceipt(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/saveObjectionReceipt',
    method: 'post',
    data
  })
}

// 保存异议投诉内容并生成pdf盖章
export function saveObjectionReceiptContent(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/saveObjectionReceiptContent',
    method: 'post',
    data
  })
}
// 项目经理提交异议投诉回复函
export function submitObjectionByObjectionId(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/submitObjectionByObjectionId',
    method: 'post',
    data
  })
}

// 运维人员-审批回复异议投诉
export function auditRecordObjection(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionAudit/auditRecordObjection' + createURL(data),
    method: 'post'
  })
}
// 运维人员-获取审批回复异议投诉列表
export function listWaitAuditRecordObjectionPages(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionAudit/listWaitAuditRecordObjectionPages',
    method: 'post',
    data
  })
}
// 项目经理发送异议投诉回复函
export function sendObjectionByObjectionId(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/sendObjectionByObjectionId',
    method: 'post',
    data
  })
}

// 根据异议投诉id获取审批记录列表
export function getAuditRecordByObjectionId(objectionId) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionAudit/getAuditRecordByObjectionId?objectionId=' + objectionId,
    method: 'post'
  })
}
/* ======================= 供应商(风险控制部)=====================*/
// 供应商(风险控制部) 提出异议审核列表 运维人员-获取审批异议投诉列表
export function listWaitAuditObjectionPages(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionAudit/listWaitAuditObjectionPages',
    method: 'post',
    data
  })
}
// 风险控制部提交异议投诉
export function riskDepartSaveObjection(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/riskDepartSaveObjection',
    method: 'post',
    data
  })
}
// 运维人员-审批异议投诉
export function auditObjection(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionAudit/auditObjection' + createURL(data),
    method: 'post'
  })
}
// 风险控制部提出的异议投诉列表
export function listRiskDepartObjectionPages(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/listRiskDepartObjectionPages',
    method: 'post',
    data
  })
}
// 异议投诉删除
export function removeRaiseObjectionByObjectionId(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/removeRaiseObjectionByObjectionId',
    method: 'post',
    data
  })
}

// 风险控制部提出的异议投诉列表导出
export function listRiskDepartObjectionPagesOfExport(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/listRiskDepartObjectionPagesOfExport',
    method: 'post',
    data,
    responseType: 'blob'
  })
}
// 项目经理查看投标人提出的异议投诉列表导出
export function listManagerRaiseObjectionPagesOfExport(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/listManagerRaiseObjectionPagesOfExport',
    method: 'post',
    data,
    responseType: 'blob'
  })
}
// 导出异议审批单内容并生成pdf
export function exportObjectionReceiptOfPdf(receiptStatus) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/exportObjectionReceiptOfPdf?receiptStatus=' + receiptStatus,
    method: 'post',
    responseType: 'blob'
  })
}

// 根据异议回复主键id获取异议主键id
export function getObjectionId(receiptId) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjectionReceipt/getObjectionId?receiptId=' + receiptId,
    method: 'get'
  })
}

// 风险控制部，复核异议确认的接口
export function confirmobjectionReceipt(data) {
  return request({
    url: '/bidprocurement/bidding-clarification/clarification/tenderObjection/confirmobjectionReceipt' + createURL(data),
    method: 'post',
    data
  })
}
