2 天以前 a55ad6ba920b2fc8e6abc84f3285041914e565d6
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace MesProScanEventApi {
  export interface ScanEvent {
    id?: number;
    eventId?: string;
    bagCode?: string;
    batchCode?: string;
    quantity?: number;
    deviceCode?: string;
    lineCode?: string;
    warehouseId?: number;
    eventTime?: string;
    transactionId?: number;
    status?: 'SUCCESS' | 'FAILED';
    errorCode?: string;
    errorMessage?: string;
    receivedTime?: string;
    failedTime?: string;
    eventTime?: string;
    remark?: string;
  }
 
  export interface Dashboard {
    latest?: ScanEvent;
    total?: number;
  }
 
  export interface InboundParams {
    eventId: string;
    bagCode: string;
    quantity: number;
    deviceCode: string;
    lineCode?: string;
    locationId: number;
    areaId: number;
    remark?: string;
  }
}
 
export function inboundScanEvent(data: MesProScanEventApi.InboundParams) {
  return requestClient.post<MesProScanEventApi.ScanEvent>('/mes/pro/scan-in/inbound', data);
}
 
export function getScanEventPage(params: PageParam & { deviceCode?: string; bagCode?: string }) {
  return requestClient.get<PageResult<MesProScanEventApi.ScanEvent>>('/mes/pro/scan-in/page', { params });
}
 
export function getLatestScanEvent(deviceCode?: string) {
  return requestClient.get<MesProScanEventApi.ScanEvent>('/mes/pro/scan-in/latest', { params: { deviceCode } });
}
 
export function getScanDashboard() {
  return requestClient.get<MesProScanEventApi.Dashboard>('/mes/pro/scan-in/dashboard');
}