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

// 查询备件管理-出入库详情列表
export function listSparePartAccessDetails(query) {
    return request({
        url: '/tongzhou/business/sparePartAccessDetails/list',
        method: 'get',
        params: query
    })
}

// 查询备件管理-出入库详情详细
export function getSparePartAccessDetails(sparePartAccessDetailsId) {
    return request({
        url: '/tongzhou/business/sparePartAccessDetails/' + sparePartAccessDetailsId,
        method: 'get'
    })
}

// 新增备件管理-出入库详情
export function addSparePartAccessDetails(data) {
    return request({
        url: '/tongzhou/business/sparePartAccessDetails',
        method: 'post',
        data: data
    })
}

// 修改备件管理-出入库详情
export function updateSparePartAccessDetails(data) {
    return request({
        url: '/tongzhou/business/sparePartAccessDetails',
        method: 'put',
        data: data
    })
}

// 删除备件管理-出入库详情
export function delSparePartAccessDetails(sparePartAccessDetailsId) {
    return request({
        url: '/tongzhou/business/sparePartAccessDetails/' + sparePartAccessDetailsId,
        method: 'delete'
    })
}

// 导出备件管理-出入库详情
export function downloadSparePartAccessDetails(data) {
    download(
        '/tongzhou/business/sparePartAccessDetails/export',
        data,
        `sparePartAccessDetails_${new Date().getTime()}.xlsx`)
}
