import request from '@/config/axios' export interface CustomerVO { 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 getCustomerPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return request.post({ url: '/wms/customer/senior', data }) } else { return await request.get({ url: `/wms/customer/page`, params }) } } // 查询客户列表 export const getCustomerList = async (params) => { return await request.get({ url: `/wms/customer/list`, params }) } // 查询客户详情 export const getCustomer = async (id: number) => { return await request.get({ url: `/wms/customer/get?id=` + id }) } // 新增客户 export const createCustomer = async (data: CustomerVO) => { return await request.post({ url: `/wms/customer/create`, data }) } // 修改客户 export const updateCustomer = async (data: CustomerVO) => { return await request.put({ url: `/wms/customer/update`, data }) } // 删除客户 export const deleteCustomer = async (id: number) => { return await request.delete({ url: `/wms/customer/delete?id=` + id }) } // 导出客户 Excel export const exportCustomer = async (params) => { if (params.isSearch) { const data = {...params} return await request.downloadPost({ url: `/wms/customer/export-excel-senior`, data }) } else { return await request.download({ url: `/wms/customer/export-excel`, params }) } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/customer/get-import-template' }) }