174 lines
3.8 KiB
TypeScript
174 lines
3.8 KiB
TypeScript
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;
|
||
}
|
||
}
|