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

// 查询物料管理-物料申购列表
export function listApplyPurchase(query) {
    return request({
        url: '/tongzhou/applyPurchase/applyPurchase/list',
        method: 'get',
        params: query
    })
}

// 查询物料管理-物料申购详细
export function getApplyPurchase(applyPurchaseId) {
    return request({
        url: '/tongzhou/applyPurchase/applyPurchase/' + applyPurchaseId,
        method: 'get'
    })
}

// 新增物料管理-物料申购
export function addApplyPurchaseDetails(data) {
    return request({
        url: '/tongzhou/applyPurchase/applyPurchase',
        method: 'post',
        data: data
    })
}

// 修改物料管理-物料申购
export function updateApplyPurchaseDetails(data) {
    return request({
        url: '/tongzhou/applyPurchase/applyPurchase',
        method: 'put',
        data: data
    })
}

// 删除物料管理-物料申购
export function delApplyPurchase(applyPurchaseId) {
    return request({
        url: '/tongzhou/applyPurchase/applyPurchase/' + applyPurchaseId,
        method: 'delete'
    })
}

// 导出物料管理-物料申购
export function downloadApplyPurchase(data) {
    download(
        '/tongzhou/applyPurchase/applyPurchase/export',
        data,
        `applyPurchase_${new Date().getTime()}.xlsx`)
}
