import request from '@/assets/js/utils/request'
/* **招标和采购合同签订** */
// 招标/采购项目合同签订列表
export function listBidtCalibrationTenderContract(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/listBidtCalibrationTenderContract',
    method: 'post',
    data
  })
}
// 招标/采购项目合同签订保存
export function saveBidtCalibrationTenderContractData(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/saveBidtCalibrationTenderContractData',
    method: 'post',
    data
  })
}
// 合同工具制作
export function getOpenToolsUrl(contractId) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/getOpenToolsUrl?contractId=' + contractId,
    method: 'post'
  })
}
// 招标/采购项目合同查询详情
export function getBidtCalibrationTenderContractData(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/getBidtCalibrationTenderContractData',
    method: 'post',
    data
  })
}

// 获取合同付款阶段
export function listContractPayStage(params) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractPayStage/listContractPayStage',
    method: 'post',
    params
  })
}

// 保存合同付款阶段
export function saveContractPayStageData(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractPayStage/saveContractPayStageData',
    method: 'post',
    data
  })
}

// 合同提交
export function submitContractInfo(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/submitContractInfo',
    method: 'post',
    data
  })
}
// 合同审核
export function auditContractMainInfo(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/auditContractMainInfo',
    method: 'post',
    data
  })
}
// 供应商合同确认
export function confirmContract(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/confirmContract?contractId=' + data,
    method: 'post'
  })
}
/* **协议采购api** */
// 协议采购列表
export function getAgreementPurchaseList(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/getAgreementPurchaseList',
    // url: '/bidprocurement/bidding-calibration/contract/tenderContract/listBidtCalibrationTenderContract',
    method: 'post',
    data
  })
}
// 框架协议弹窗
export function getFocusContractList(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/getFocusContractList',
    method: 'post',
    data
  })
}
// 月度计划
export function getPurchasePlanMainDetailList(data) {
  return request({
    // url: '/bidprocurement/bidding-calibration/contract/tenderContract/getAgreementPurchaseList',
    url: '/bidprocurement/procurement-purchasplan/purchasePlanMain/getPurchasePlanMainDetailList',
    method: 'post',
    data
  })
}

// 查询合同标定物详细信息
export function listContractDetailInfoPage(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/listContractDetailInfoPage',
    method: 'post',
    data
  })
}
/* **验收api** */
// 获取合同验收阶段
export function listContractCheckStage(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractCheckStage/listContractCheckStage',
    method: 'post',
    data
  })
}
// 根据id查询合同验收阶段
export function queryContractCheckStageById(id, checkFlag) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractCheckStage/queryContractCheckStageById?id=' + id + '&checkFlag=' + checkFlag,
    method: 'post'
  })
}
// 保存合同验收阶段
export function saveContractCheckStageData(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractCheckStage/saveContractCheckStageData',
    method: 'post',
    data
  })
}

// 删除合同标定物详细信息
export function delContractDetailInfo(id) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/delContractDetailInfo?id=' + id,
    method: 'post'
  })
}
// 删除订单关联合同标定物详细信息
export function delOrderContractDetailInfo(id, contractId) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/delOrderContractDetailInfo?orderId=' + id + '&contractId=' + contractId,
    method: 'post'
  })
}
// 删除合同及其相关数据
export function delOrderContract(id) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/delOrderContract?id=' + id,
    method: 'post'
  })
}

/* **验收api** */
// 查询付款申请记录
export function listPaymentRequestInfo(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractPayStage/listPaymentRequestInfo',
    method: 'post',
    data
  })
}

// 发票付款详情
export function queryContractInvoiceByCheckId(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractInvoice/queryContractInvoiceByCheckId',
    method: 'post',
    data
  })
}

// 发票付款保存/提交
export function saveContractInvoice(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractInvoice/saveContractInvoice',
    method: 'post',
    data
  })
}
// 履约评价详情
export function queryContractSupplierEvaluation(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/queryContractSupplierEvaluation',
    method: 'post',
    data
  })
}
// 保存合同履约评价信息
export function saveContractSupplierEvaluation(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/saveContractSupplierEvaluation',
    method: 'post',
    data
  })
}

// 查询合同SAP详细信息
export function findListContractDetailInfoPage(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/findListContractDetailInfoPage',
    method: 'post',
    data
  })
}

// 大类中类
export function getPayCategoryInfoDictionaries(data) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContractInvoice/getPayCategoryInfoDictionaries',
    method: 'post',
    data
  })
}

// 校验合同编号是否存在
export function checkContractNoIsExist(params) {
  return request({
    url: '/bidprocurement/bidding-calibration/contract/tenderContract/checkContractNoIsExist',
    method: 'post',
    params
  })
}

