import request from '@/utils/httpRequest'

export default class ContractInfoService {
  list (param) {
    return request({
      url: '/contract/registration/list',
      method: 'get',
      params: param
    })
  }
  save (param) {
    return request({
      url: '/contract/registration/save',
      method: 'post',
      data: param
    })
  }
  remove (url) {
    return request({
      url: '/contract/registration/remove',
      method: 'get',
      params: {id: url}
    })
  }
  findById (id) {
    return request({
      url: '/contract/registration/findById',
      method: 'get',
      params: {id: id}
    })
  }
  findFileInfoById (id) {
    return request({
      url: '/contract/registration/findFileInfoById',
      method: 'get',
      params: {id: id}
    })
  }
  findByContractId (id) {
    return request({
      url: '/contract/registration/findByContractId',
      method: 'get',
      params: {id: id}
    })
  }
  updateStatusById (param) {
    return request({
      url: '/contract/registration/updateStatusById',
      method: 'post',
      data: param
    })
  }
  updateInfo (param) {
    return request({
      url: '/contract/registration/updateInfo',
      method: 'post',
      data: param
    })
  }
  updatePaperInfo (param) {
    return request({
      url: '/contract/registration/updatePaperInfo',
      method: 'post',
      data: param
    })
  }
  getByClientId (id, contractForm) {
    return request({
      url: '/contract/registration/getByClientId',
      method: 'get',
      params: {contractId: id, ...contractForm}
    })
  }
  exportFile (params) {
    return request({
      url: '/contract/registration/exportFile',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
}
