4 天以前 b7eb1da8220f5b72f6891c3c6471ca386604cce4
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
import { requestClient } from '#/api/request';
 
export namespace MesBagCodeHomeApi {
  /** 基础数据与一袋一码 状态分布项 */
  export interface StatusItem {
    status: number; // 状态值
    count: number; // 数量
  }
 
  /** 基础数据与一袋一码 首页汇总统计 */
  export interface Summary {
    mdmItemCount: number; // 品种总数(mdm_item)
    mesItemCount: number; // MES 品种数(mes_md_item)
    itemTypeCount: number; // 品种分类数
    unitMeasureCount: number; // 计量单位数
    lineCount: number; // 产线数
    batchCount: number; // 批次总数
    bagCodeCount: number; // 袋码总数
    palletCount: number; // 托盘码总数
    batchStatusList: StatusItem[]; // 批次状态分布
    bagCodeStatusList: StatusItem[]; // 袋码状态分布
  }
 
  /** 基础数据与一袋一码 袋码生成趋势 */
  export interface Trend {
    date: string; // 日期
    count: number; // 袋码生成数量
  }
}
 
/** 获得基础数据与一袋一码 首页汇总统计 */
export function getBagCodeHomeSummary() {
  return requestClient.get<MesBagCodeHomeApi.Summary>(
    '/mes/bag-code-home-statistics/summary',
  );
}
 
/** 获得袋码生成趋势 */
export function getBagCodeHomeTrend(days?: number) {
  return requestClient.get<MesBagCodeHomeApi.Trend[]>(
    '/mes/bag-code-home-statistics/trend',
    { params: { days } },
  );
}