|
1
2
3
4
5
|
import { defHttp } from '/@/utils/http/axios';
import { DemoParams, DemoListGetResultModel } from './model/tableModel';
enum Api {
DEMO_LIST = '/table/getDemoList',
|
sanmu
authored
|
6
7
8
9
|
ORDER = '/order/erp/order/list_by_page',
DICT_INIT = '/order/erp/dictionary/get_all',
APPROVE = '/order/erp/audit/list_by_page',
CHECK = '/order/erp/audit/do_audit',
|
|
10
11
12
|
}
/**
|
vben
authored
|
13
|
* @description: Get sample list value
|
|
14
|
*/
|
Vben
authored
|
15
|
|
sanmu
authored
|
16
17
18
|
export const demoListApi = async (params: DemoParams) => {
const res = await defHttp.post<DemoListGetResultModel>({
url: Api.ORDER,
|
|
19
|
params,
|
vben
authored
|
20
|
headers: {
|
|
21
|
// @ts-ignore
|
vben
authored
|
22
23
|
ignoreCancelToken: true,
},
|
|
24
|
});
|
sanmu
authored
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
return new Promise((resolve) => {
resolve(res.records);
});
};
export const demoApproveListApi = async (params: DemoParams) => {
const res = await defHttp.post<DemoListGetResultModel>({
url: Api.APPROVE,
params,
});
res.records = res.records.map((item) => {
item.fields = [];
Object.entries(item.fieldInfos.baseFields).map(([key, value]) => {
if (value === 'UN_LOCKED') {
|
sanmu
authored
|
40
41
|
// const obj = find(FIELDS_BASE_INFO, { field: key });
// item.fields.push(obj?.label);
|
sanmu
authored
|
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
|
}
});
item.fields = item.fields.join(',');
return item;
});
return new Promise((resolve) => {
resolve(res.records);
});
};
export const demoApproveCheckApi = async (params: DemoParams) => {
const res = await defHttp.post<DemoListGetResultModel>({
url: Api.CHECK,
params,
headers: {
// @ts-ignore
ignoreCancelToken: true,
},
});
return new Promise((resolve) => {
resolve(res);
});
};
export const getInitDictData = async () => {
const res = await defHttp.post({
url: Api.DICT_INIT,
params: {},
headers: {
// @ts-ignore
ignoreCancelToken: true,
},
});
return res;
};
|