import request from '@/utils/httpRequest'

export default class WorkClientService {
  list (params) {
    return request({
      url: '/cw_work_client/info/list',
      method: 'get',
      params: params
    })
  }
  listTree (params) {
    return request({
      url: '/cw_work_client/info/list_tree',
      method: 'get',
      params: params
    })
  }
  queryById (id) {
    return request({
      url: '/cw_work_client/info/queryById',
      method: 'get',
      params: {id: id}
    })
  }
  save (inputForm) {
    return request({
      url: `/cw_work_client/info/save`,
      method: 'post',
      data: inputForm
    })
  }
  saveForm (inputForm) {
    return request({
      url: `/cw_work_client/info/saveForm`,
      method: 'post',
      data: inputForm
    })
  }
  delete (ids) {
    return request({
      url: '/cw_work_client/info/delete',
      method: 'delete',
      params: {ids: ids}
    })
  }
  updateStatusById (data) {
    return request({
      url: '/cw_work_client/info/updateStatusById',
      method: 'post',
      data: data
    })
  }
  exportFile (params) {
    return request({
      url: '/cw_work_client/info/export',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
  pushUpdate (id) {
    return request({
      url: '/cw_work_client/info/pushUpdate',
      method: 'get',
      params: {id: id}
    })
  }
  stopUpdate (id) {
    return request({
      url: '/cw_work_client/info/stopUpdate',
      method: 'get',
      params: {id: id}
    })
  }
  rejectUpdate (id) {
    return request({
      url: '/cw_work_client/info/rebackOrAgreeUpdate',
      method: 'get',
      params: {id: id, type: 'reject'}
    })
  }
  rebackUpdate (id) {
    return request({
      url: '/cw_work_client/info/rebackOrAgreeUpdate',
      method: 'get',
      params: {id: id, type: 'reback'}
    })
  }
  rebackPushUpdate (id) {
    return request({
      url: '/cw_work_client/info/rebackOrAgreeUpdate',
      method: 'get',
      params: {id: id, type: 'reback_push'}
    })
  }
  agreeUpdate (id) {
    return request({
      url: '/cw_work_client/info/rebackOrAgreeUpdate',
      method: 'get',
      params: {id: id, type: 'agree'}
    })
  }
  reapplyUpdate (id) {
    return request({
      url: '/cw_work_client/info/rebackOrAgreeUpdate',
      method: 'get',
      params: {id: id, type: 'reapply'}
    })
  }
  queryUscCodeIsUse (uscCode) {
    return request({
      url: '/cw_work_client/info/queryUscCodeIsUse',
      method: 'get',
      params: {uscCode: uscCode}
    })
  }
  queryUscCodeById (id) {
    return request({
      url: '/cw_work_client/info/queryUscCodeById',
      method: 'get',
      params: {id: id}
    })
  }
  queryNameIsUse (name) {
    return request({
      url: '/cw_work_client/info/queryNameIsUse',
      method: 'get',
      params: {name: name}
    })
  }
  queryNameById (id) {
    return request({
      url: '/cw_work_client/info/queryNameById',
      method: 'get',
      params: {id: id}
    })
  }
  queryUpdateLogList (params) {
    return request({
      url: '/cw_work_client/info/queryUpdateLogList',
      method: 'get',
      params: params
    })
  }
  getBillingListByClientId (params) {
    return request({
      url: '/cw_work_client/info/getBillingListByClientId',
      method: 'get',
      params: params
    })
  }
}
