import { axios } from '@/utils/request'
import { stringify } from 'qs'

/**
 * page func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function getPurchaseDispatchContainerPage (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers/page?' + stringify(parameter),
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

/**
 * add func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function addPurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers',
        method: 'POST',
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json;charset=UTF-8'
        },
        data: parameter
    })
}

/**
 * update func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function updatePurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers/' + parameter.id,
        method: 'PUT',
        data: parameter
    })
}

/**
 * fetch single func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function fetchPurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers/' + parameter.id,
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

/**
 * query list func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function queryPurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers?' + stringify(parameter),
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

/**
 * delete batch func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function deletePurchaseDispatchContainers (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers',
        method: 'DELETE',
        data: parameter
    })
}

/**
 * delete single func
 * parameter: { }
 * @param parameter
 * @returns {*}
 */
export function deletePurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers/' + parameter.id,
        method: 'DELETE',
        data: parameter
    })
}


/**
 * export file
 * parameter: { }
 * @param parameter :
 * @returns {*}
 */
export function exportPurchaseDispatchContainer (parameter) {
    return axios({
        url: '/purchase/purchase-dispatch-containers/export?' + stringify(parameter),
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        },
        responseType: 'blob'
    })
}
