gaoluyang
2 天以前 98312d84f785c09574bfd5add730ea448fb0cbd5
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
import { requestClient } from '#/api/request';
 
export namespace FinStatisticsApi {
  /** 会计核算看板查询参数 */
  export interface StatisticsParams {
    startMonth?: string; // 起始月份 yyyy-MM,留空默认本年 1 月
    endMonth?: string; // 结束月份 yyyy-MM,留空默认当前月
  }
 
  /** 会计核算看板总览 */
  export interface StatisticsOverview {
    startDate: string; // 实际统计起始日期
    endDate: string; // 实际统计结束日期
    receiptPrice: number; // 收款金额(ERP 已审核收款单)
    paymentPrice: number; // 付款金额(ERP 已审核付款单)
    netProfit: number; // 净利润 = 收款 - 付款
    saleOrderPrice: number; // 销售订单金额(已审核)
    purchaseOrderPrice: number; // 采购订单金额(已审核)
 
    fixedAssetOriginalValue: number; // 固定资产原值合计
    fixedAssetAccumulatedDepreciation: number; // 固定资产累计折旧合计
    fixedAssetNetValue: number; // 固定资产净值合计
    intangibleAssetOriginalValue: number; // 无形资产原值合计
    intangibleAssetAccumulatedAmortization: number; // 无形资产累计摊销合计
    intangibleAssetNetValue: number; // 无形资产净值合计
    totalAssetNetValue: number; // 资产净值合计
 
    subjectCount: number; // 会计科目数量
    voucherCount: number; // 凭证总数
    voucherUnpostedCount: number; // 未过账凭证数量
    voucherPostedCount: number; // 已过账凭证数量
    voucherCancelledCount: number; // 已作废凭证数量
  }
 
  /** 月度趋势 */
  export interface StatisticsTrend {
    month: string; // 月份 yyyy-MM
    receiptPrice: number; // 收款金额
    paymentPrice: number; // 付款金额
    netProfit: number; // 净利润
    saleOrderPrice: number; // 销售订单金额
    purchaseOrderPrice: number; // 采购订单金额
  }
}
 
/** 获取会计核算看板总览 */
export function getStatisticsOverview(params?: FinStatisticsApi.StatisticsParams) {
  return requestClient.get<FinStatisticsApi.StatisticsOverview>(
    '/finance/statistics/overview',
    { params },
  );
}
 
/** 获取月度收支趋势(期间内无数据的月份补 0) */
export function getStatisticsTrend(params?: FinStatisticsApi.StatisticsParams) {
  return requestClient.get<FinStatisticsApi.StatisticsTrend[]>(
    '/finance/statistics/trend',
    { params },
  );
}