import { projectApp } from "@/api/index";
import request from "@/utils/require";

// 项目申请条件-分页查询
export function projectPage(data) {
  return request({
    url: `${projectApp}/projectPage/${data.pageNum}/${data.pageSize}`,
    method: "post",
    data: data
  });
}

// 项目申请条件保存 发布
export function saveProject(data, type) {
  return request({
    url: `${projectApp}/project/${type}`,
    method: "post",
    data: data
  });
}
// 项目申请条件详情
export function getProject(data) {
  return request({
    url: `${projectApp}/project/${data}`,
    method: "get"
  });
}
// 项目申请条件下发
export function xiafaProject(data) {
  return request({
    url: `${projectApp}/updateReleaseStatus/${data}`,
    method: "post"
  });
}
// 项目申请条件更新
export function updataProject(data) {
  return request({
    url: `${projectApp}/project`,
    method: "put"
  });
}
// 项目申请条件删除
export function deleteProject(data) {
  return request({
    url: `${projectApp}/project/${data.xmId}`,
    method: "delete"
  });
}

// 项目立项-分页查询
export function projectApplicationPage(data) {
  return request({
    url: `${projectApp}/projectApplicationPage/${data.pageNum}/${data.pageSize}`,
    method: "post",
    data: data
  });
}

// 项目立项-回显
export function projectInfo(data) {
  return request({
    url: `${projectApp}/projectInfo`,
    method: "post",
    data: data
  });
}

// 项目立项-新增
export function projectApplication(data) {
  return request({
    url: `${projectApp}/projectApplication/${data.type}`,
    method: "post",
    data: data
  });
}
export function projectApplicationGet(data) {
  return request({
    url: `${projectApp}/projectApplication/${data.xmsqId}`,
    method: "get",
    data: data
  });
}

// 项目立项-删除
export function projectApplicationDelete(data) {
  return request({
    url: `${projectApp}/projectApplication/${data.xmsqId}`,
    method: "delete",
    data: data
  });
}

// 项目建议书保存
export function projectProposalReport(data) {
  return request({
    url: `${projectApp}/projectProposalReport/${data.type}`,
    method: "post",
    data: data.data
  });
}

// 项目立项保存
export function projectApprovalAcceptance(data) {
  return request({
    url: `${projectApp}/projectApprovalAcceptance/${data.type}`,
    method: "post",
    data: data.data
  });
}

// 项目建议书/可研报告-查询详情
export function projectProposalReportDetail(data) {
  return request({
    url: `${projectApp}/projectProposalReportDetail/${data.xmsqId}/${data.xmwblx}`,
    method: "post",
    data: data
  });
}

// 项目立项验收-查询详情
export function getProjectApprovalAcceptance(data) {
  return request({
    url: `${projectApp}/projectApprovalAcceptance/${data.xmsqId}/${data.xmlxlx}`,
    method: "get"
  });
}

// 项目招标-新增
export function projectBidding(data) {
  return request({
    url: `${projectApp}/projectBidding/${data.dataStatus}`,
    method: "post",
    data: data
  });
}

// 项目招标-详情
export function projectBiddingDetail(data) {
  return request({
    url: `${projectApp}/projectBiddingDetail/${data.xmsqId}/${data.xmzblx}`,
    method: "post",
    data: data
  });
}

// 资金申请-新增
export function projectFundApplication(data, ruleForm) {
  return request({
    url: `${projectApp}/projectFundApplication/${data.dataStatus}/${data.isCheck}`,
    method: "post",
    data: ruleForm
  });
}

// 资金申请-详情
export function getProjectFundApplication(data) {
  return request({
    url: `${projectApp}/projectFundApplication/${data.xmsqId}`,
    method: "get",
    data: data
  });
}

// POST
// /projectProgressBriefing/{dataStatus}
// 项目进度简报-更新
export function projectProgressBriefing(dataStatus, data) {
  return request({
    url: `${projectApp}/projectProgressBriefing/${dataStatus}`,
    method: "post",
    data: data
  });
}

// POST / projectProgressBriefingList / { xmsqId }
// 项目进度简报 - 查询详情
export function projectProgressBriefingList(id) {
  return request({
    url: `${projectApp}/projectProgressBriefingList/${id}`,
    method: "post"
  });
}

// 项目建议书/可研报告-审批
export function projectProposalReportApproval(data) {
  return request({
    url: `${projectApp}/projectProposalReportApproval`,
    method: "post",
    data: data
  });
}

// 项目验收审批
export function projectApprovalAcceptanceApproval(data) {
  return request({
    url: `${projectApp}/projectApprovalAcceptanceApproval`,
    method: "post",
    data: data
  });
}
// 资金申请-审批
export function projectFundApplicationApproval(data) {
  return request({
    url: `${projectApp}/projectFundApplicationApproval`,
    method: "post",
    data: data
  });
}

// 项目模板下载-分页
export function projectTemplatePage(data) {
  return request({
    url: `${projectApp}/projectTemplatePage/${data.pageNum}/${data.pageSize}`,
    method: "post",
    data: data
  });
}

// 项目模板下载-详情
export function getProjectTemplate(data) {
  return request({
    url: `${projectApp}/projectTemplate/${data.xmmbId}`,
    method: "get"
  });
}

// 项目模板下载-新增
export function saveProjectTemplate(data) {
  return request({
    url: `${projectApp}/projectTemplate`,
    method: "post",
    data: data
  });
}

// 项目模板下载-新增
export function updateProjectTemplate(data) {
  return request({
    url: `${projectApp}/projectTemplate`,
    method: "put",
    data: data
  });
}

// 项目模板下载-删除
export function removeProjectTemplate(data) {
  return request({
    url: `${projectApp}/projectTemplate/${data.xmmbId}`,
    method: "delete",
    data: data
  });
}

// 进度月报-分页
export function projectMonthlyProgressReportPage(data) {
  return request({
    url: `${projectApp}/projectMonthlyProgressReportPage/${data.pageNum}/${data.pageSize}`,
    method: "post",
    data: data
  });
}

// 进度月报-详情
export function projectMonthlyProgressReport(data) {
  return request({
    url: `${projectApp}/projectMonthlyProgressReport/${data.xmjdybId}`,
    method: "get",
    data: data
  });
}

// 进度月报-更新
export function updateProjectMonthlyProgressReport(data) {
  return request({
    url: `${projectApp}/updateProjectMonthlyProgressReport`,
    method: "put",
    data: data
  });
}

// /projectMaterialDetailsList/{dataStatus}
// 项目材料-根据状态保存数据
export function projectMaterialDetailsList(type, data) {
  return request({
    url: `${projectApp}/projectMaterialDetailsList/${type}`,
    method: "post",
    data: data
  });
}
// /getProjectMaterialDetailsList
// 项目材料-查看列表
export function getProjectMaterialDetailsList(data) {
  return request({
    url: `${projectApp}/getProjectMaterialDetailsList`,
    method: "post",
    data: data
  });
}
