import request from '@/utils/request'
import { download } from '@/utils/request'

// 查询维保项目列表
export function listMaintenanceProject (query) {
  return request({
    url: '/tongzhou/maintenanceProject/maintenanceProject/list',
    method: 'get',
    params: query
  })
}

// 查询维保项目详细
export function getMaintenanceProject (maintenanceProjectId) {
  return request({
    url: '/tongzhou/maintenanceProject/maintenanceProject/' + maintenanceProjectId,
    method: 'get'
  })
}

// 新增维保项目
export function addMaintenanceProject (data) {
  return request({
    url: '/tongzhou/maintenanceProject/maintenanceProject',
    method: 'post',
    data: data
  })
}

// 修改维保项目
export function updateMaintenanceProject (data) {
  return request({
    url: '/tongzhou/maintenanceProject/maintenanceProject',
    method: 'put',
    data: data
  })
}

// 删除维保项目
export function delMaintenanceProject (maintenanceProjectId) {
  return request({
    url: '/tongzhou/maintenanceProject/maintenanceProject/' + maintenanceProjectId,
    method: 'delete'
  })
}

// 导出维保项目
export function downloadMaintenanceProject (data) {
  download(
    '/tongzhou/maintenanceProject/maintenanceProject/export',
    data,
    `维保项目-${new Date().getTime()}.xlsx`
  )
}
