import request from '@/utils/request'

/**
 *  获取新购待绑定列表数据
 */
export function getNewBuyBindListApi(query) {
    return request({
        url: '/material/purchase/bind/list',
        method: 'get',
        params: query,
    })
}

/**
 *  获取新购待绑定列表详情
 */
export function getNewBuyBindListDetailsApi(query) {
    return request({
        url: '/material/purchase/bind/getInfo',
        method: 'get',
        params: query,
    })
}

//二级页面 查看
export function getMaCodeInfo(query) {
    return request({
        url: '/material/purchase_macode_info/list',
        method: 'get',
        params: query,
    })
}

export function bindAllData(data) {
    return request({
        url: '/material/purchase/bind/bind',
        method: 'post',
        data: data,
    })
}
//绑定驳回
export function rejectBind(data) {
    return request({
        url: '/material/purchase/bind/reject',
        method: 'post',
        data: data,
    })
}

//编码解绑
export function unBindCodeApi(data) {
    return request({
        url: '/material/purchase_macode_info/un_bind',
        method: 'post',
        data: data,
    })
}

//二级页面 详情
export function getListDetailById(query) {
    return request({
        url: '/material/purchase/bind/getById',
        method: 'get',
        params: query,
    })
}


// 导出
export function exportNewBuy(purchaseId) {
    return request({
        url: '/material/purchase/bind/downloadQrCode?purchaseId='+purchaseId,
        method: 'post',
        responseType: 'blob',
        headers: {
            encryptRequest: false,
            checkIntegrity: false,
            encryptResponse: false,
        },
    })
}
  

