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

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

// 查询维保详细
export function getMaintenance(maintenanceId) {
    return request({
        url: '/tongzhou/maintenance/maintenance/' + maintenanceId,
        method: 'get'
    })
}

// 新增维保
export function addMaintenance(data) {
    return request({
        url: '/tongzhou/maintenance/maintenance',
        method: 'post',
        data: data
    })
}

// 修改维保
export function updateMaintenance(data) {
    return request({
        url: '/tongzhou/maintenance/maintenance',
        method: 'put',
        data: data
    })
}

// 删除维保
export function delMaintenance(maintenanceId) {
    return request({
        url: '/tongzhou/maintenance/maintenance/' + maintenanceId,
        method: 'delete'
    })
}

// 导出维保
export function downloadMaintenance(data) {
    download(
        '/tongzhou/maintenance/maintenance/export',
        data,
        `maintenance_${new Date().getTime()}.xlsx`)
}
