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

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

// 查询维保申请详细
export function getMaintenanceApply(maintenanceApplyId) {
    return request({
        url: '/tongzhou/maintenanceApply/maintenanceApply/' + maintenanceApplyId,
        method: 'get'
    })
}

// 新增维保申请
export function addMaintenanceApply(data) {
    return request({
        url: '/tongzhou/maintenanceApply/maintenanceApply',
        method: 'post',
        data: data
    })
}

// 修改维保申请
export function updateMaintenanceApply(data) {
    return request({
        url: '/tongzhou/maintenanceApply/maintenanceApply',
        method: 'put',
        data: data
    })
}

// 删除维保申请
export function delMaintenanceApply(maintenanceApplyId) {
    return request({
        url: '/tongzhou/maintenanceApply/maintenanceApply/' + maintenanceApplyId,
        method: 'delete'
    })
}

// 导出维保申请
export function downloadMaintenanceApply(data) {
    download(
        '/tongzhou/maintenanceApply/maintenanceApply/export',
        data,
        `maintenanceApply_${new Date().getTime()}.xlsx`)
}
