import request from '@/config/axios' export interface SupplierVO { code: string name: string shortName: string address: string country: string city: string phone: string fax: string postId: string contacts: string bank: string currency: string taxRate: number type: string available: number activeTime: Date expireTime: Date remark: string } // 查询供应商列表分页 export const getSupplierPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return request.post({ url: '/wms/supplier/senior', data }) } else { return await request.get({ url: `/wms/supplier/page`, params }) } } // 查询供应商列表 export const getSupplierList = async (params) => { return await request.get({ url: `/wms/supplier/list`, params }) } // 查询供应商详情 export const getSupplier = async (id: number) => { return await request.get({ url: `/wms/supplier/get?id=` + id }) } // 新增供应商 export const createSupplier = async (data: SupplierVO) => { return await request.post({ url: `/wms/supplier/create`, data }) } // 修改供应商 export const updateSupplier = async (data: SupplierVO) => { return await request.put({ url: `/wms/supplier/update`, data }) } // 删除供应商 export const deleteSupplier = async (id: number) => { return await request.delete({ url: `/wms/supplier/delete?id=` + id }) } // 导出供应商 Excel export const exportSupplier = async (params) => { if (params.isSearch) { const data = {...params} return await request.downloadPost({ url: `/wms/supplier/export-excel-senior`, data }) } else { return await request.download({ url: `/wms/supplier/export-excel`, params }) } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/supplier/get-import-template' }) }