liu
2 天以前 18340ebdeb405be3ba01eb4d1600d9b26cee7ccd
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace SrmSupplierApi {
  export interface SupplierVO {
    id?: number;
    code: string;
    name: string;
    type: string;
    status: number;
    contactName?: string;
    contactMobile?: string;
    contactEmail?: string;
    address?: string;
    bankName?: string;
    bankAccount?: string;
    taxNo?: string;
    remark?: string;
    createTime?: string;
  }
}
 
/** 分页查询供应商 */
export function getSupplierPage(params: PageParam) {
  return requestClient.get<PageResult<SrmSupplierApi.SupplierVO>>('/srm/supplier/page', { params });
}
 
/** 获取供应商精简列表(仅返回已通过准入审批的供应商) */
export function getSupplierSimpleList() {
  return requestClient.get<SrmSupplierApi.SupplierVO[]>('/srm/supplier/simple-list');
}
 
/** 获取供应商档案列表(不过滤准入状态) */
export function getSupplierList() {
  return requestClient.get<SrmSupplierApi.SupplierVO[]>('/srm/supplier/list');
}
 
/** 获取供应商详情 */
export function getSupplier(id: number) {
  return requestClient.get<SrmSupplierApi.SupplierVO>(`/srm/supplier/get?id=${id}`);
}
 
/** 创建供应商 */
export function createSupplier(data: SrmSupplierApi.SupplierVO) {
  return requestClient.post('/srm/supplier/create', data);
}
 
/** 更新供应商 */
export function updateSupplier(data: SrmSupplierApi.SupplierVO) {
  return requestClient.put('/srm/supplier/update', data);
}
 
/** 删除供应商 */
export function deleteSupplier(id: number) {
  return requestClient.delete(`/srm/supplier/delete?id=${id}`);
}
 
/** 导出供应商档案 Excel(按列表查询条件) */
export function exportSupplierExcel(params: any) {
  return requestClient.download('/srm/supplier/export-excel', { params });
}
 
/** 下载供应商档案导入模板 */
export function getSupplierImportTemplate() {
  return requestClient.download('/srm/supplier/get-import-template');
}
 
/** 导入供应商档案 Excel */
export function importSupplierExcel(data: {
  file: File;
  updateSupport: boolean;
}) {
  return requestClient.upload('/srm/supplier/import-excel', data);
}