import request from '@/config/axios'
|
|
export interface SrmSupplierVO {
|
id: number
|
code: string
|
name: string
|
shortName: string
|
type: string
|
companyNature: string
|
registeredCapital: number
|
businessLicenseNo: string
|
taxNo: string
|
legalPerson: string
|
address: string
|
website: string
|
contactName: string
|
contactMobile: string
|
contactEmail: string
|
bankName: string
|
bankAccount: string
|
status: number
|
remark: string
|
erpSupplierId: number
|
createTime: string
|
}
|
|
export interface SrmSupplierContactVO {
|
id: number
|
supplierId: number
|
name: string
|
position: string
|
mobile: string
|
telephone: string
|
email: string
|
wechat: string
|
isDefault: boolean
|
sort: number
|
createTime: string
|
}
|
|
export const SrmSupplierApi = {
|
// 分页查询
|
getSupplierPage: async (params: any) =>
|
request.get({ url: '/srm/supplier/page', params }),
|
|
// 获取详情
|
getSupplier: async (id: number) =>
|
request.get({ url: '/srm/supplier/get', params: { id } }),
|
|
// 创建
|
createSupplier: async (data: any) =>
|
request.post({ url: '/srm/supplier/create', data }),
|
|
// 更新
|
updateSupplier: async (data: any) =>
|
request.put({ url: '/srm/supplier/update', data }),
|
|
// 删除
|
deleteSupplier: async (id: number) =>
|
request.delete({ url: '/srm/supplier/delete', params: { id } }),
|
|
// 精简列表(下拉选择)
|
getSupplierSimpleList: async () =>
|
request.get({ url: '/srm/supplier/simple-list' }),
|
|
// 导出 Excel
|
exportSupplierExcel: async (params: any) =>
|
request.download({ url: '/srm/supplier/export-excel', params }),
|
|
// 联系人列表
|
getContactList: async (supplierId: number) =>
|
request.get({ url: '/srm/supplier-contact/list-by-supplier', params: { supplierId } }),
|
|
// 创建联系人
|
createContact: async (data: any) =>
|
request.post({ url: '/srm/supplier-contact/create', data }),
|
|
// 更新联系人
|
updateContact: async (data: any) =>
|
request.put({ url: '/srm/supplier-contact/update', data }),
|
|
// 删除联系人
|
deleteContact: async (id: number) =>
|
request.delete({ url: '/srm/supplier-contact/delete', params: { id } })
|
}
|