import request from "@/utils/httpRequest";
import { FINANCE_PATH as prefix } from "../../AppPath";

export default {
	archivedInfoExport: function (params) {
		return request({
			url: prefix + "/cwProjectReport/archivedInfoExport",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},
  list: function (params) {
    return request({
      url: prefix + '/cwProjectReport/list',
      method: 'get',
      params: params
    })
  },
	list2: function (params) {
    return request({
      url: prefix + '/cwProjectReport/list2',
      method: 'get',
      params: params
    })
  },
	list3: function (params) {
    return request({
      url: prefix + '/cwProjectReport/list3',
      method: 'get',
      params: params
    })
  },
	getTotal: function () {
		return request({
			url: prefix + "/cwProjectReport/getTotal",
			method: "get",
			params: {  },
		});
	},
  saveForm: function (inputForm) {
    return request({
      url: prefix + `/cwProjectReport/saveForm`,
      method: 'post',
      data: inputForm
    })
  },
	saveForm2: function (inputForm) {
		return request({
			url: prefix + `/cwProjectReport/saveForm2`,
			method: 'post',
			data: inputForm
		})
	},
  updateStatusById: function (data) {
    return request({
      url: prefix + '/cwProjectReport/updateStatusById',
      method: 'post',
      data: data
    })
  },
  queryById: function (id) {
    return request({
      url: prefix + '/cwProjectReport/queryById',
      method: 'get',
      params: {id: id}
    })
  },
	queryByIdNew: function (id) {
		return request({
			url: prefix + '/cwProjectReport/queryByIdNew',
			method: 'get',
			params: {id: id}
		})
	},
	queryBySignAndIssueId: function (id) {
		return request({
			url: prefix + '/cwProjectReport/queryBySignAndIssueId',
			method: 'get',
			params: {id: id}
		})
	},
	queryByOnlineArchivingId: function (id) {
		return request({
			url: prefix + '/cwProjectReport/queryByOnlineArchivingId',
			method: 'get',
			params: {id: id}
		})
	},
	queryByPaperArchivingId: function (id) {
		return request({
			url: prefix + '/cwProjectReport/queryByPaperArchivingId',
			method: 'get',
			params: {id: id}
		})
	},
	/*
	根据项目id，与报告id查询附件信息
	 */
	getAttachmentList(projectId,id,type){
		return request({
			url: prefix + '/cwProjectReport/getAttachmentList',
			method: 'get',
			params: {projectId:projectId, id: id,type: type}
		})
	},
	queryById2: function (id) {
    return request({
      url: prefix + '/cwProjectReport/queryById2',
      method: 'get',
      params: {id: id}
    })
  },
  delete: function (ids,projectId) {
    return request({
      url: prefix + '/cwProjectReport/delete',
      method: 'delete',
      params: {ids: ids,projectId: projectId}
    })
  },
  clineList: function (params) {
    return request({
      url: prefix + '/cwProjectReport/clineList',
      method: 'get',
      params: params
    })
  },
  recordsList: function (params) {
    return request({
      url: prefix + '/cwProjectReport/recordsList',
      method: 'get',
      params: params
    })
  },
  saveFlowableParam: function (inputForm) {
    return request({
      url: prefix + `/cwProjectReport/saveFlowableParam`,
      method: 'post',
      data: inputForm
    })
  },
  updateSignatureStatusById: function (data) {
    return request({
      url: prefix + '/cwProjectReport/updateSignatureStatusById',
      method: 'post',
      data: data
    })
  },
  updateSigStatusById: function (data) {
		return request({
			url: prefix + '/cwProjectReport/updateSigStatusById',
			method: 'post',
			data: data
		})
  },
  queryBySignatureId: function (id) {
    return request({
      url: prefix + '/cwProjectReport/queryBySignatureId',
      method: 'get',
      params: {id: id}
    })
  },
  findBySignatureId: function (id) {
    return request({
      url: prefix + '/cwProjectReport/findBySignatureId',
      method: 'get',
      params: {id: id}
    })
  },
  saveData: function (inputForm) {
    return request({
      url: prefix + `/cwProjectReport/saveData`,
      method: 'post',
      data: inputForm
    })
  },

saveSignatureAnnotator: function (inputForm) {
	return request({
		url: prefix + '/cwProjectReport/saveSignatureAnnotator',
		method: 'post',
		data: inputForm
	})
},

  exportExcel: function (params) {
    return request({
      url: prefix + '/cwProjectReport/export',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  },
  getAuditNodeByReportId: function (id) {
    return request({
      url: prefix + '/cwProjectReport/getAuditNodeByReportId',
      method: 'get',
      params: {id: id}
    })
  },
  getSignatureTypeById: function (id, signatureType) {
    return request({
      url: prefix + '/cwProjectReport/getSignatureTypeById',
      method: 'get',
      params: {id: id, signatureType: signatureType}
    })
  },
  getIdByContractId: function (contractId, reportForm) {
    return request({
      url: prefix + '/cwProjectReport/getIdByContractId',
      method: 'get',
      params: {contractId: contractId, ...reportForm}
    })
  },
  getIdByProjectId: function (projectId, reportForm) {
    return request({
      url: prefix + '/cwProjectReport/getIdByProjectId',
      method: 'get',
      params: {projectId: projectId, ...reportForm}
    })
  },
  getIdByClientId: function (clientId, reportForm) {
    return request({
      url: prefix + '/cwProjectReport/getIdByClientId',
      method: 'get',
      params: {clientId: clientId, ...reportForm}
    })
  },
  saveSignFiles: function (data) {
    return request({
      url: prefix + '/cwProjectReport/saveSignFiles',
      method: 'post',
      data: data
    })
  },
  saveReportArchive: function (reportId) {
    return request({
      url: prefix + '/cwProjectReport/saveReportArchive',
      method: 'get',
      params: {reportId: reportId}
    })
  },
  /* 三级校审文档下载 */
  downloadCwReportAuditTpl: function (id) {
    return request({
      url: prefix + '/cwProjectReport/downloadCwReportAuditTpl',
      method: 'get',
      params: {id: id},
      responseType: 'blob'
    })
  },
  rebackSign: function (id) {
    return request({
      url: prefix + '/cwProjectReport/rebackSign',
      method: 'get',
      params: {reportId: id}
    })
  },
	rebackReviewSign: function (id) {
    return request({
      url: prefix + '/cwProjectReport/rebackReviewSign',
      method: 'get',
      params: {reportId: id}
    })
  },
  findByReportId:function (id) {
	return request({
		url: prefix + '/cwProjectReport/getSignatureAnnotatorList',
		method: 'get',
		params: {reportId: id}
	})
  },
	updateAgree: function (data) {
		return request({
			url: prefix + '/cwProjectReport/updateAgree',
			method: 'post',
			data: data
		})
	},
	getSigById:function (id) {
		return request({
			url: prefix + '/cwProjectReport/getSigById',
			method: 'get',
			params: {id:id}
		})
	},
	updateStatusByIdSig:function (param) {
		return request({
			url: prefix + '/cwProjectReport/updateStatusByIdSig',
			method: 'post',
			data: param
		})
	},
	returnRequest:function (param) {
		return request({
			url: prefix + '/cwProjectReport/returnRequest',
			method: 'post',
			data: param
		})
	},
}
