You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

101 lines
2.7 KiB

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 getSupplierPageSCP = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/supplier/seniorSCP', data })
} else {
return await request.get({ url: `/wms/supplier/pageSCP`, 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 })
}
}
// 导出供应商 Excel
export const exportSupplierSCP = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/supplier/export-excel-senior-SCP`, data })
} else {
return await request.download({ url: `/wms/supplier/export-excel-SCP`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplier/get-import-template' })
}
// 根据code获取数据列表
export const getSupplierListByCodes = async (codes: string) => {
return await request.get({ url: `/wms/supplier/listByCodes?codes=` + codes })
}