Blame view

src/api/project/approve.ts 1.1 KB
sanmu authored
1
2
import { find, isEmpty } from 'lodash-es';
import { defHttp } from '/@/utils/http/axios';
sanmu authored
3
4
5
6
import {
  FIELDS_BASE_INFO,
  FIELDS_PROFIT_INFO,
  FIELDS_REPORT_INFO,
sanmu authored
7
} from '../../views/project/order/constant';
sanmu authored
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

enum Api {
  APPROVE = '/order/erp/audit/wait_audit_list',
  APPROVE_ED = '/order/erp/audit/audit_list',
  AUDIT = '/order/erp/audit/do_audit',
}

export const approveAuditApi = async (params: any) =>
  defHttp.post<any>(
    {
      url: Api.AUDIT,
      params,
    },
    { message: '操作成功' },
  );
柏杨 authored
24
export const getWaitListApi = async (params: any) => {
sanmu authored
25
26
27
28
29
30
31
32
  const res = await defHttp.post({
    url: Api.APPROVE,
    params,
  });
  res.records = res.records.map((item) => {
    return item;
  });
  return new Promise((resolve) => {
sanmu authored
33
    resolve({ items: res.records, total: res.total });
sanmu authored
34
35
36
37
38
39
40
41
42
43
44
45
46
  });
};

export const getApprovedListApi = async (params: any) => {
  const res = await defHttp.post({
    url: Api.APPROVE_ED,
    params,
  });

  res.records = res.records.map((item) => {
    return item;
  });
  return new Promise((resolve) => {
sanmu authored
47
    resolve({ items: res.records, total: res.total });
sanmu authored
48
49
  });
};