50 lines
1.8 KiB
Dart
50 lines
1.8 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'baseDio.dart';
|
|
|
|
class StockInApi {
|
|
/// 空载具入库
|
|
static Future<dynamic> emptyVehicleIn(Object? request,
|
|
{int timeOut = 5000}) async {
|
|
final response = await BaseDio.instance()
|
|
.post<String>("/api/mobile/stockIn/emptyVehicleIn",
|
|
data: request,
|
|
options: Options(
|
|
responseType: ResponseType.json,
|
|
sendTimeout: Duration(milliseconds: timeOut),
|
|
receiveTimeout: Duration(milliseconds: timeOut),
|
|
));
|
|
return {"code": response.statusCode, "data": response.data};
|
|
}
|
|
|
|
/// 码盘完成
|
|
static Future<dynamic> stockInComplete(dynamic bindingVehicleData,
|
|
{int timeOut = 5000}) async {
|
|
final response = await BaseDio.instance()
|
|
.post<String>("/api/mobile/stockIn/bindingVehicleIn",
|
|
data: jsonEncode(bindingVehicleData),
|
|
options: Options(
|
|
responseType: ResponseType.json,
|
|
sendTimeout: Duration(milliseconds: timeOut),
|
|
receiveTimeout: Duration(milliseconds: timeOut),
|
|
));
|
|
return {"code": response.statusCode, "data": response.data};
|
|
}
|
|
|
|
/// 扫描之后从数据库获取EBS数据
|
|
static Future<dynamic> getGoodsCanUse(String orderId, String goodsId,
|
|
{int timeOut = 5000}) async {
|
|
final response = await BaseDio.instance()
|
|
.post<String>("/api/mobile/stockIn/getCanUseGoods",
|
|
data: jsonEncode({"orderId": orderId, "goodsId": goodsId}),
|
|
options: Options(
|
|
responseType: ResponseType.json,
|
|
sendTimeout: Duration(milliseconds: timeOut),
|
|
receiveTimeout: Duration(milliseconds: timeOut),
|
|
));
|
|
return {"code": response.statusCode, "data": response.data};
|
|
}
|
|
}
|