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

// 查询物料管理-申领记录列表
export function listWarehouseApply(query) {
    return request({
        url: '/tongzhou/warehouseApply/warehouseApply/list',
        method: 'get',
        params: query
    })
}

// 查询物料管理-申领记录详细
export function getWarehouseApply(warehouseApplyId) {
    return request({
        url: '/tongzhou/warehouseApply/warehouseApply/' + warehouseApplyId,
        method: 'get'
    })
}

// 新增物料管理-申领记录
export function addWarehouseApply(data) {
    return request({
        url: '/tongzhou/warehouseApply/warehouseApply',
        method: 'post',
        data: data
    })
}

// 修改物料管理-申领记录
export function updateWarehouseApply(data) {
    return request({
        url: '/tongzhou/warehouseApply/warehouseApply',
        method: 'put',
        data: data
    })
}

// 删除物料管理-申领记录
export function delWarehouseApply(warehouseApplyId) {
    return request({
        url: '/tongzhou/warehouseApply/warehouseApply/' + warehouseApplyId,
        method: 'delete'
    })
}

// 导出物料管理-申领记录
export function downloadWarehouseApply(data) {
    download(
        '/tongzhou/warehouseApply/warehouseApply/export',
        data,
        `WarehouseApply_${new Date().getTime()}.xlsx`)
}
