import request from '../request.js';

/** 接口管理 */
const Api = {
    page: '/api/wms/pallet/page',
    save: '/api/wms/pallet/save',
    edit: '/api/wms/pallet/edit',
    remove: '/api/wms/pallet/remove',
    removeBatch: '/api/wms/pallet/removeBatch',
    getPalletByCode: '/api/wms/pallet/getPalletByCode',
    palletCheck:'/api/wms/pallet/palletCheckOut'
}

/** 托盘列表 (分页) */
export const page = data => {
    return request.request({
        url: Api.page,
        params: data,
        method: 'GET'
    })
}

/** 根据托盘号获取托盘信息  */
export const getPalletByCode = data => {
    return request.request({
        url: Api.getPalletByCode,
        params: data,
        method: 'GET'
    })
}

/** 保存 */
export const save = data => {
    return request.request({
        url: Api.save,
        data: data,
        method: 'POST'
    })
}

/** 修改 */
export const edit = data => {
    return request.request({
        url: Api.edit,
        data: data,
        method: 'PUT'
    })
}

/** 删除 */
export const remove = data => {
    return request.request({
        url: Api.remove,
        params: data,
        method: 'DELETE'
    })
}

/** 批量删除 */
export const removeBatch = data => {
    return request.request({
        url: Api.removeBatch,
        params: data,
        method: 'DELETE'
    })
}
/** 指定托盘抽检 */
export const palletCheck = data => {
    return request.request({
        url: Api.palletCheck,
        data: data,
        method: 'POST'
    })
}
