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');
|
}
|