import request from '@/config/axios' export interface SwitchVO { id: number code: string description: string effectiveSetValue: string available: string } // 查询单据开关列表 export const getSwitchPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/switch/senior', data }) } else { return await request.get({ url: `/wms/switch/page`, params }) } } // 查询单据开关详情 export const getSwitch = async (id: number) => { return await request.get({ url: `/wms/switch/get?id=` + id }) } // 查询单据开关详情 export const getByCode = async (code) => { return await request.get({ url: `/wms/switch/getByCode?code=` + code }) } // 新增单据开关 export const createSwitch = async (data: SwitchVO) => { return await request.post({ url: `/wms/switch/create`, data }) } // 修改单据开关 export const updateSwitch = async (data: SwitchVO) => { return await request.put({ url: `/wms/switch/update`, data }) } // 删除单据开关 export const deleteSwitch = async (id: number) => { return await request.delete({ url: `/wms/switch/delete?id=` + id }) } // 导出单据开关 Excel export const exportSwitch = async (params) => { return await request.download({ url: `/wms/switch/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/switch/get-import-template'}) } // 获取开关详情 export const getSwitchByCode = async (code) => { // return await request.get({ url: '/wms/switch/getByCode?code=' + code }) }