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

// 查询备件管理-出入库记录列表
export function listSparePartAccess(query) {
    return request({
        url: '/tongzhou/sparePartAccess/sparePartAccess/list',
        method: 'get',
        params: query
    })
}

// 查询备件管理-出入库记录详细
export function getSparePartAccess(sparePartAccessId) {
    return request({
        url: '/tongzhou/sparePartAccess/sparePartAccess/' + sparePartAccessId,
        method: 'get'
    })
}

// 新增备件管理-出入库记录
export function addSparePartAccess(data) {
    return request({
        url: '/tongzhou/sparePartAccess/sparePartAccess',
        method: 'post',
        data: data
    })
}

// 修改备件管理-出入库记录
export function updateSparePartAccess(data) {
    return request({
        url: '/tongzhou/sparePartAccess/sparePartAccess',
        method: 'put',
        data: data
    })
}

// 删除备件管理-出入库记录
export function delSparePartAccess(sparePartAccessId) {
    return request({
        url: '/tongzhou/sparePartAccess/sparePartAccess/' + sparePartAccessId,
        method: 'delete'
    })
}

// 导出备件管理-出入库记录
export function downloadSparePartAccess(data) {
    download(
        '/tongzhou/sparePartAccess/sparePartAccess/export',
        data,
        `sparePartAccess_${new Date().getTime()}.xlsx`)
}
