pda_react_native_template/src/api/wmsApi.ts

174 lines
3.8 KiB
TypeScript
Raw Normal View History

2025-07-04 10:44:57 +08:00
import {HttpClient} from './http';
import type {ApiResponse} from '../types';
export class WmsApiClient {
private static http = HttpClient.getInstance();
/**
*
*/
static async emptyVehicleIn(
vehicleNo: string,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/emptyVehicleIn',
{vehicleNo},
{
timeout: timeOut,
},
);
return response.data;
}
/**
*
*/
static async getGoodsCanUse(
orderId: string,
goodsId: string,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/getCanUseGoods',
{orderId, goodsId},
{
timeout: timeOut,
},
);
return response.data;
}
/**
*
*/
static async bindingVehicleInLD(
bindingVehicleData: any,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/bindingVehicleIn',
bindingVehicleData,
{
timeout: timeOut,
},
);
return response.data;
}
/**
*
*/
static async getGoodsDetail(
boxNo: string,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.get('/api/mobile/stockIn/getGoodsDetail', {
params: {boxNo},
timeout: timeOut,
});
return response.data;
}
/**
* MES绑定入库
*/
static async bindingVehicleIn(
bindingVehicleData: any,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/bindingVehicleIn',
bindingVehicleData,
{
timeout: timeOut,
},
);
return response.data;
}
/**
* EBS入库单信息
*/
static async getCuxData(timeOut: number = 5000): Promise<ApiResponse<any>> {
const response = await this.http.get('/api/mobile/stockIn/getCuxData', {
timeout: timeOut,
});
return response.data;
}
/**
* EBS绑定入库
*/
static async bindingVehicleInEbsOld(
bindingVehicleData: any,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/bindingVehicleInEbsOld',
bindingVehicleData,
{
timeout: timeOut,
},
);
return response.data;
}
/**
* EBS绑定入库
*/
static async bindingVehicleInEbs(
bindingVehicleData: any,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/bindingVehicleInEbs',
bindingVehicleData,
{
timeout: timeOut,
},
);
return response.data;
}
/**
*
*/
static async getOrderLines(
bindingVehicleData: any,
timeOut: number = 10000,
): Promise<ApiResponse<any>> {
const response = await this.http.post(
'/api/mobile/stockIn/getOrderLines',
bindingVehicleData,
{
timeout: timeOut,
},
);
return response.data;
}
/**
*
*/
static async getSubInventory(timeOut: number = 10000): Promise<ApiResponse<any>> {
const response = await this.http.get('/api/mobile/stockIn/getSubInventory', {
timeout: timeOut,
});
return response.data;
}
/**
*
*/
static async getInventoryTask(
vehicleNo: string,
timeOut: number = 5000,
): Promise<ApiResponse<any>> {
const response = await this.http.get('/api/mobile/inventory/getInventoryTask', {
params: {vehicleNo},
timeout: timeOut,
});
return response.data;
}
}