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

export default {
  list: function (params) {
    return request({
      url: prefix + '/cwProjectReport/list',
      method: 'get',
      params: params
    })
  },
  saveForm: function (inputForm) {
    return request({
      url: prefix + `/cwProjectReport/saveForm`,
      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}
    })
  },
  delete: function (ids) {
    return request({
      url: prefix + '/cwProjectReport/delete',
      method: 'delete',
      params: {ids: ids}
    })
  },
  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}
    })
  },
  findByReportId:function (id) {
	return request({
		url: prefix + '/cwProjectReport/getSignatureAnnotatorList',
		method: 'get',
		params: {reportId: id}
	})
  }
}
