liyong
2026-07-31 450bcae3cfffe9923dc09dea2a4e89312bb373d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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 } })
}