import request from '@/utils/httpRequest'

export default class ProjectReportService {
  list (params) {
    return request({
      url: '/cwProjectReport/list',
      method: 'get',
      params: params
    })
  }
  saveForm (inputForm) {
    return request({
      url: `/cwProjectReport/saveForm`,
      method: 'post',
      data: inputForm
    })
  }
  updateStatusById (data) {
    return request({
      url: '/cwProjectReport/updateStatusById',
      method: 'post',
      data: data
    })
  }
  queryById (id) {
    return request({
      url: '/cwProjectReport/queryById',
      method: 'get',
      params: {id: id}
    })
  }
  delete (ids) {
    return request({
      url: '/cwProjectReport/delete',
      method: 'delete',
      params: {ids: ids}
    })
  }
  clineList (params) {
    return request({
      url: '/cwProjectReport/clineList',
      method: 'get',
      params: params
    })
  }
  recordsList (params) {
    return request({
      url: '/cwProjectReport/recordsList',
      method: 'get',
      params: params
    })
  }
  saveFlowableParam (inputForm) {
    return request({
      url: `/cwProjectReport/saveFlowableParam`,
      method: 'post',
      data: inputForm
    })
  }
  updateSignatureStatusById (data) {
    return request({
      url: '/cwProjectReport/updateSignatureStatusById',
      method: 'post',
      data: data
    })
  }
  queryBySignatureId (id) {
    return request({
      url: '/cwProjectReport/queryBySignatureId',
      method: 'get',
      params: {id: id}
    })
  }
  findBySignatureId (id) {
    return request({
      url: '/cwProjectReport/findBySignatureId',
      method: 'get',
      params: {id: id}
    })
  }
  saveData (inputForm) {
    return request({
      url: `/cwProjectReport/saveData`,
      method: 'post',
      data: inputForm
    })
  }

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