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

// 查询备件管理-申领记录列表
export function listSparePartApply(query) {
    return request({
        url: '/tongzhou/sparePartApply/sparePartApply/list',
        method: 'get',
        params: query
    })
}

// 查询备件管理-申领记录详细
export function getSparePartApply(sparePartApplyId) {
    return request({
        url: '/tongzhou/sparePartApply/sparePartApply/' + sparePartApplyId,
        method: 'get'
    })
}

// 新增备件管理-申领记录
export function addSparePartApplyDetails(data) {
    return request({
        url: '/tongzhou/sparePartApply/sparePartApply',
        method: 'post',
        data: data
    })
}

// 修改备件管理-申领记录
export function updateSparePartApplyDetails(data) {
    return request({
        url: '/tongzhou/sparePartApply/sparePartApply',
        method: 'put',
        data: data
    })
}

// 删除备件管理-申领记录
export function delSparePartApply(sparePartApplyId) {
    return request({
        url: '/tongzhou/sparePartApply/sparePartApply/' + sparePartApplyId,
        method: 'delete'
    })
}

// 导出备件管理-申领记录
export function downloadSparePartApply(data) {
    download(
        '/tongzhou/sparePartApply/sparePartApply/export',
        data,
        `sparePartApply_${new Date().getTime()}.xlsx`)
}
