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

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

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

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

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

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

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