clean shit
This commit is contained in:
parent
910670c0cd
commit
5194d953ed
|
|
@ -6,8 +6,8 @@ class BaseDio {
|
||||||
static Dio instance() {
|
static Dio instance() {
|
||||||
if (!initializeComplete) {
|
if (!initializeComplete) {
|
||||||
final options = BaseOptions(
|
final options = BaseOptions(
|
||||||
// baseUrl: 'http://10.0.2.2:9990',
|
baseUrl: 'http://10.0.2.2:9990',
|
||||||
baseUrl: 'http://192.168.1.3:9990',
|
// baseUrl: 'http://192.168.1.3:9990',
|
||||||
connectTimeout: const Duration(seconds: 10),
|
connectTimeout: const Duration(seconds: 10),
|
||||||
receiveTimeout: const Duration(seconds: 5),
|
receiveTimeout: const Duration(seconds: 5),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ class StockInApi {
|
||||||
/// 空载具入库
|
/// 空载具入库
|
||||||
static Future<dynamic> emptyVehicleIn(String vehicleNo,
|
static Future<dynamic> emptyVehicleIn(String vehicleNo,
|
||||||
{int timeOut = 5000}) async {
|
{int timeOut = 5000}) async {
|
||||||
final response =
|
final response = await BaseDio.instance()
|
||||||
await BaseDio.instance().post<String>("/system/storage/addEmpty?vehicleNo=$vehicleNo",
|
.post<String>("/system/storage/addEmpty?vehicleNo=$vehicleNo",
|
||||||
options: Options(
|
options: Options(
|
||||||
responseType: ResponseType.json,
|
responseType: ResponseType.json,
|
||||||
sendTimeout: Duration(milliseconds: timeOut),
|
sendTimeout: Duration(milliseconds: timeOut),
|
||||||
|
|
@ -32,13 +32,19 @@ class StockInApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 码盘完成
|
/// 码盘完成
|
||||||
static Future<dynamic> stockInComplete(List<StockInDataXuGong> stockInDataXuGong,
|
static Future<dynamic> stockInComplete(
|
||||||
|
List<StockInDataXuGong> stockInDataXuGong, String vehicleNo,
|
||||||
{int timeOut = 5000}) async {
|
{int timeOut = 5000}) async {
|
||||||
logger.e("yuqili $stockInDataXuGong");
|
logger.e("yuqili $stockInDataXuGong");
|
||||||
final stockInDataJson = stockInDataXuGong.map((item) => item.toJson()).toList();
|
final stockInDataJson =
|
||||||
final response = await BaseDio.instance()
|
stockInDataXuGong.map((item) => item.toJson()).toList();
|
||||||
.post<String>("/system/storage/addOtherList",
|
final request = {
|
||||||
data: jsonEncode(stockInDataJson),
|
"data": stockInDataJson,
|
||||||
|
"vehicleNo": vehicleNo
|
||||||
|
};
|
||||||
|
final response =
|
||||||
|
await BaseDio.instance().post<String>("/system/storage/addOtherList",
|
||||||
|
data: jsonEncode(request),
|
||||||
options: Options(
|
options: Options(
|
||||||
responseType: ResponseType.json,
|
responseType: ResponseType.json,
|
||||||
sendTimeout: Duration(milliseconds: timeOut),
|
sendTimeout: Duration(milliseconds: timeOut),
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ class StockOutApi {
|
||||||
"goodsDesc": "empty",
|
"goodsDesc": "empty",
|
||||||
"spare1": uuidGen.v1(),
|
"spare1": uuidGen.v1(),
|
||||||
"spare2": uuidGen.v1(),
|
"spare2": uuidGen.v1(),
|
||||||
|
"orderStatus": 1,
|
||||||
}),
|
}),
|
||||||
options: Options(
|
options: Options(
|
||||||
responseType: ResponseType.json,
|
responseType: ResponseType.json,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class _StockInCardXuGongState extends State<StockInCardXuGong> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
BrnRichGridInfo('单据号:', item.orderId),
|
BrnRichGridInfo('单据号:', item.listId),
|
||||||
BrnRichGridInfo('单据类型:', item.orderType),
|
BrnRichGridInfo('单据类型:', item.orderType),
|
||||||
BrnRichGridInfo('客户名称:', item.customerName),
|
BrnRichGridInfo('客户名称:', item.customerName),
|
||||||
BrnRichGridInfo('物料描述:', item.goodsDesc),
|
BrnRichGridInfo('物料描述:', item.goodsDesc),
|
||||||
|
|
|
||||||
|
|
@ -1,127 +1,71 @@
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
|
|
||||||
class StockInDataXuGong {
|
class StockInDataXuGong {
|
||||||
String recordId = "";
|
|
||||||
String listId = "";
|
|
||||||
String orderType = ""; // 单据类型
|
|
||||||
String customerId = "";
|
|
||||||
String orderId = "test"; // 单据号
|
|
||||||
String vehicleNo = "";
|
|
||||||
String goodsId = ""; // 物料号
|
String goodsId = ""; // 物料号
|
||||||
|
|
||||||
int goodsNum = 0; // 物料数量
|
int goodsNum = 0; // 物料数量
|
||||||
String goodsCode = "";
|
|
||||||
String goodsDesc = ""; // 物料描述
|
String listId = ""; // 单据号
|
||||||
String unit = "";
|
|
||||||
String spare1 = ""; // 备用1
|
int orderType = 0; // 单据类型
|
||||||
String spare2 = ""; // 备用2
|
|
||||||
int status = 0;
|
|
||||||
int storageType = 0;
|
|
||||||
String createPerson = "empty";
|
|
||||||
String remark = "test";
|
|
||||||
DateTime createTime = DateTime.now();
|
|
||||||
DateTime updateTime = DateTime.now();
|
|
||||||
double weight = 0; // 重量
|
|
||||||
String customerName = ""; // 客户名称
|
String customerName = ""; // 客户名称
|
||||||
String size = ""; // 尺寸
|
|
||||||
String containerNo = ""; // 容器号
|
String goodsDesc = ""; // 物料描述
|
||||||
|
|
||||||
|
double weight = 0; // 重量
|
||||||
|
|
||||||
|
int size = 0; // 尺寸
|
||||||
|
|
||||||
|
String unit = ""; // 单位
|
||||||
|
|
||||||
|
String spare1 = ""; // 备用1
|
||||||
|
|
||||||
|
String spare2 = ""; // 备用2
|
||||||
|
|
||||||
StockInDataXuGong({
|
StockInDataXuGong({
|
||||||
required this.recordId,
|
|
||||||
required this.goodsId,
|
required this.goodsId,
|
||||||
required this.goodsNum,
|
required this.goodsNum,
|
||||||
required this.orderId,
|
|
||||||
required this.orderType,
|
required this.orderType,
|
||||||
required this.goodsDesc,
|
required this.goodsDesc,
|
||||||
required this.weight,
|
required this.weight,
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.customerName,
|
required this.customerName,
|
||||||
required this.containerNo,
|
|
||||||
required this.spare1,
|
required this.spare1,
|
||||||
required this.spare2,
|
required this.spare2,
|
||||||
required this.vehicleNo,
|
|
||||||
required this.customerId,
|
|
||||||
required this.goodsCode,
|
|
||||||
required this.listId,
|
required this.listId,
|
||||||
required this.unit,
|
required this.unit,
|
||||||
required this.status,
|
|
||||||
required this.storageType,
|
|
||||||
required this.createPerson,
|
|
||||||
required this.remark,
|
|
||||||
required this.createTime,
|
|
||||||
required this.updateTime,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Updated fromJson method
|
// Updated fromJson method
|
||||||
factory StockInDataXuGong.fromJson(Map<String, dynamic> json) {
|
factory StockInDataXuGong.fromJson(Map<String, dynamic> json) {
|
||||||
return StockInDataXuGong(
|
return StockInDataXuGong(
|
||||||
containerNo: json["containerNo"] ?? "0",
|
|
||||||
customerName: json["customerName"] ?? "",
|
customerName: json["customerName"] ?? "",
|
||||||
|
|
||||||
listId: json["listId"] ?? "",
|
listId: json["listId"] ?? "",
|
||||||
customerId: json["customerId"] ?? "",
|
|
||||||
recordId: json["recordId"] ?? "",
|
|
||||||
goodsId: json["goodsId"] ?? "",
|
goodsId: json["goodsId"] ?? "",
|
||||||
// 物料号
|
|
||||||
vehicleNo: json["vehicleNo"] ?? "",
|
|
||||||
// 物料号
|
|
||||||
goodsNum: json["goodsNum"] ?? 10.0,
|
goodsNum: json["goodsNum"] ?? 10.0,
|
||||||
// 物料数量
|
orderType: json["orderType"] ?? 0,
|
||||||
orderId: json["orderId"] ?? "",
|
|
||||||
// 单据号
|
|
||||||
orderType: json["orderType"] ?? "",
|
|
||||||
// 单据类型
|
|
||||||
goodsCode: json["goodsCode"] ?? "",
|
|
||||||
// customerName: json["customerName"] ?? "", // 客户名称
|
|
||||||
goodsDesc: json["goodsDesc"] ?? "",
|
goodsDesc: json["goodsDesc"] ?? "",
|
||||||
// 物料描述
|
|
||||||
// weight: json["weight"]?.toDouble() ?? 0.0, // 重量
|
|
||||||
// size: json["size"] ?? "", // 尺寸
|
|
||||||
// containerNo: json["containerNo"] ?? "",
|
|
||||||
// 容器号
|
|
||||||
spare1: json["spare1"] ?? "",
|
spare1: json["spare1"] ?? "",
|
||||||
// 备用1
|
|
||||||
spare2: json["spare2"] ?? "",
|
spare2: json["spare2"] ?? "",
|
||||||
// 备用2
|
|
||||||
unit: json["unit"] ?? "",
|
|
||||||
status: json["status"] ?? 0,
|
|
||||||
storageType: json["storageType"] ?? 0,
|
|
||||||
createPerson: json["createPerson"] ?? "",
|
|
||||||
remark: json["remark"] ?? "",
|
|
||||||
createTime: json["createTime"] ?? DateTime.now(),
|
|
||||||
updateTime: json["updateTime"] ?? DateTime.now(),
|
|
||||||
weight: json["weight"] ?? 10.0,
|
weight: json["weight"] ?? 10.0,
|
||||||
size: json["size"] ?? "50",
|
size: json["size"] ?? "50",
|
||||||
|
unit: json["unit"] ?? "",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 实现 toJson 方法
|
// 实现 toJson 方法
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
String formattedCreateDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(createTime);
|
|
||||||
String formattedUpdateDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(updateTime);
|
|
||||||
return {
|
return {
|
||||||
"recordId": recordId,
|
|
||||||
"listId": listId,
|
"listId": listId,
|
||||||
"orderType": orderType,
|
"orderType": orderType,
|
||||||
"customerId": customerId,
|
|
||||||
"orderId": orderId,
|
|
||||||
"vehicleNo": vehicleNo,
|
|
||||||
"goodsId": goodsId,
|
"goodsId": goodsId,
|
||||||
"goodsNum": goodsNum,
|
"goodsNum": goodsNum,
|
||||||
"goodsCode": goodsCode,
|
|
||||||
"goodsDesc": goodsDesc,
|
"goodsDesc": goodsDesc,
|
||||||
"unit": unit,
|
|
||||||
"spare1": spare1,
|
"spare1": spare1,
|
||||||
"spare2": spare2,
|
"spare2": spare2,
|
||||||
"status": status,
|
|
||||||
"storageType": storageType,
|
|
||||||
"createPerson": createPerson,
|
|
||||||
"remark": remark,
|
|
||||||
"createTime": formattedCreateDate,
|
|
||||||
"updateTime": formattedUpdateDate,
|
|
||||||
"weight": weight,
|
"weight": weight,
|
||||||
"customerName": customerName,
|
"customerName": customerName,
|
||||||
"size": size,
|
"size": size,
|
||||||
"containerNo": containerNo,
|
"unit": unit,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,55 +26,31 @@ class _InventoryCheckPageState extends State<InventoryCheckPage> {
|
||||||
// Filtering the data
|
// Filtering the data
|
||||||
filteredItems = [
|
filteredItems = [
|
||||||
StockInDataXuGong(
|
StockInDataXuGong(
|
||||||
recordId: "0001",
|
unit: "test",
|
||||||
vehicleNo: "11",
|
|
||||||
customerId: "111",
|
|
||||||
createTime: DateTime.now(),
|
|
||||||
updateTime: DateTime.now(),
|
|
||||||
goodsCode: "00001",
|
|
||||||
listId: "1111",
|
listId: "1111",
|
||||||
unit: "元",
|
|
||||||
status: 1,
|
|
||||||
storageType: 1,
|
|
||||||
createPerson: "system",
|
|
||||||
remark: "test",
|
|
||||||
|
|
||||||
goodsId: "001",
|
goodsId: "001",
|
||||||
goodsNum: 5,
|
goodsNum: 5,
|
||||||
orderId: "order123",
|
orderType: 1,
|
||||||
orderType: "订购",
|
|
||||||
customerName: "Customer A",
|
customerName: "Customer A",
|
||||||
goodsDesc: "Material 1 Description",
|
goodsDesc: "Material 1 Description",
|
||||||
weight: 20.0,
|
weight: 20.0,
|
||||||
size: "Small",
|
size: 10,
|
||||||
spare1: "Spare1A",
|
spare1: "Spare1A",
|
||||||
spare2: "Spare2A",
|
spare2: "Spare2A",
|
||||||
containerNo: "Container123"),
|
),
|
||||||
StockInDataXuGong(
|
StockInDataXuGong(
|
||||||
recordId: "0001",
|
unit: "test",
|
||||||
vehicleNo: "11",
|
|
||||||
customerId: "111",
|
|
||||||
createTime: DateTime.now(),
|
|
||||||
updateTime: DateTime.now(),
|
|
||||||
goodsCode: "00001",
|
|
||||||
listId: "1111",
|
listId: "1111",
|
||||||
unit: "元",
|
|
||||||
status: 1,
|
|
||||||
storageType: 1,
|
|
||||||
createPerson: "system",
|
|
||||||
remark: "test",
|
|
||||||
|
|
||||||
goodsId: "002",
|
goodsId: "002",
|
||||||
goodsNum: 10,
|
goodsNum: 10,
|
||||||
orderId: "order456",
|
orderType: 1,
|
||||||
orderType: "订购",
|
|
||||||
customerName: "Customer B",
|
customerName: "Customer B",
|
||||||
goodsDesc: "Material 2 Description",
|
goodsDesc: "Material 2 Description",
|
||||||
weight: 15.5,
|
weight: 15.5,
|
||||||
size: "Medium",
|
size: 10,
|
||||||
spare1: "Spare1B",
|
spare1: "Spare1B",
|
||||||
spare2: "Spare2B",
|
spare2: "Spare2B",
|
||||||
containerNo: "Container456"),
|
),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -113,7 +89,8 @@ class _InventoryCheckPageState extends State<InventoryCheckPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _completeInventoryCheck() {
|
void _completeInventoryCheck() {
|
||||||
DialogUtils.showSuccessMessage(context, "盘点完成", "所有物料已完成盘点", btnLabel: "我知道了");
|
DialogUtils.showSuccessMessage(context, "盘点完成", "所有物料已完成盘点",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -240,10 +217,8 @@ class _EditGoodPageState extends State<EditGoodPage> {
|
||||||
(value) => _editedItem.goodsId = value),
|
(value) => _editedItem.goodsId = value),
|
||||||
_buildEditableField("数量", _editedItem.goodsNum.toString(),
|
_buildEditableField("数量", _editedItem.goodsNum.toString(),
|
||||||
(value) => _editedItem.goodsNum = int.tryParse(value) ?? 0),
|
(value) => _editedItem.goodsNum = int.tryParse(value) ?? 0),
|
||||||
_buildEditableField("单据号", _editedItem.orderId,
|
_buildEditableField("单据类型", _editedItem.orderType.toString(),
|
||||||
(value) => _editedItem.orderId = value),
|
(value) => _editedItem.orderType = int.parse(value)),
|
||||||
_buildEditableField("单据类型", _editedItem.orderType,
|
|
||||||
(value) => _editedItem.orderType = value),
|
|
||||||
_buildEditableField("客户名称", _editedItem.customerName,
|
_buildEditableField("客户名称", _editedItem.customerName,
|
||||||
(value) => _editedItem.customerName = value),
|
(value) => _editedItem.customerName = value),
|
||||||
_buildEditableField("描述", _editedItem.goodsDesc,
|
_buildEditableField("描述", _editedItem.goodsDesc,
|
||||||
|
|
@ -251,7 +226,7 @@ class _EditGoodPageState extends State<EditGoodPage> {
|
||||||
_buildEditableField("重量", _editedItem.weight.toString(),
|
_buildEditableField("重量", _editedItem.weight.toString(),
|
||||||
(value) => _editedItem.weight = double.tryParse(value) ?? 0.0),
|
(value) => _editedItem.weight = double.tryParse(value) ?? 0.0),
|
||||||
_buildEditableField(
|
_buildEditableField(
|
||||||
"尺寸", _editedItem.size, (value) => _editedItem.size = value),
|
"尺寸", _editedItem.size.toString(), (value) => _editedItem.size = int.parse(value)),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
widget.onSave(_editedItem);
|
widget.onSave(_editedItem);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
||||||
import 'package:bruno/bruno.dart';
|
import 'package:bruno/bruno.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:wms_app/api_client/stock_in.dart';
|
import 'package:wms_app/api_client/stock_in.dart';
|
||||||
|
import 'package:wms_app/model/bo/stock_in_data_xugong.dart';
|
||||||
import 'package:wms_app/utils/stringUtils.dart';
|
import 'package:wms_app/utils/stringUtils.dart';
|
||||||
import '/common/colorCom.dart';
|
import '/common/colorCom.dart';
|
||||||
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||||
|
|
@ -19,7 +20,7 @@ class StockInWheelEBS extends StatefulWidget {
|
||||||
class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
||||||
final _vehicleTextController = TextEditingController(); // 载具号输入框
|
final _vehicleTextController = TextEditingController(); // 载具号输入框
|
||||||
final _goodsCodeController = TextEditingController(); // 条码输入框
|
final _goodsCodeController = TextEditingController(); // 条码输入框
|
||||||
List<dynamic> packageData = []; // 已经码盘的数据
|
List<StockInDataXuGong> packageData = []; // 已经码盘的数据
|
||||||
int packageDataId = 0; // 已经码盘的数据的序号
|
int packageDataId = 0; // 已经码盘的数据的序号
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -258,21 +259,34 @@ class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
||||||
final item = data["data"] as dynamic;
|
final item = data["data"] as dynamic;
|
||||||
setState(() {
|
setState(() {
|
||||||
packageDataId++;
|
packageDataId++;
|
||||||
packageData.add({
|
// packageData.add({
|
||||||
"id": packageDataId.toString(),
|
// "id": packageDataId.toString(),
|
||||||
"segment1": codeData[0],
|
// "segment1": codeData[0],
|
||||||
"itemId": codeData[1],
|
// "itemId": codeData[1],
|
||||||
"batch": codeData[2],
|
// "batch": codeData[2],
|
||||||
"quantity": codeData[3],
|
// "quantity": codeData[3],
|
||||||
"weight": codeData[4],
|
// "weight": codeData[4],
|
||||||
"productData": codeData[5],
|
// "productData": codeData[5],
|
||||||
"sendOrderId": sendOrderId, // 送货单号
|
// "sendOrderId": sendOrderId, // 送货单号
|
||||||
"goodsName": item["itemDesc"].toString(),
|
// "goodsName": item["itemDesc"].toString(),
|
||||||
"unit": item["purUomCode"].toString(),
|
// "unit": item["purUomCode"].toString(),
|
||||||
"poHeaderId": item["poHeaderId"].toString(),
|
// "poHeaderId": item["poHeaderId"].toString(),
|
||||||
"poLineId": item["poLineId"].toString(),
|
// "poLineId": item["poLineId"].toString(),
|
||||||
"lineLocationId": item["lineLocationId"].toString(),
|
// "lineLocationId": item["lineLocationId"].toString(),
|
||||||
});
|
// });
|
||||||
|
packageData.add(StockInDataXuGong(
|
||||||
|
goodsId: goodsId,
|
||||||
|
goodsNum: packageDataId,
|
||||||
|
listId: sendOrderId,
|
||||||
|
unit: "test",
|
||||||
|
orderType: 1,
|
||||||
|
customerName: "system",
|
||||||
|
goodsDesc: item["itemDesc"].toString(),
|
||||||
|
weight: double.parse(codeData[4]),
|
||||||
|
size: 10,
|
||||||
|
spare1: "test",
|
||||||
|
spare2: "test",
|
||||||
|
));
|
||||||
_goodsCodeController.clear();
|
_goodsCodeController.clear();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
@ -302,11 +316,11 @@ class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
||||||
|
|
||||||
/// 删除已经码盘的物料
|
/// 删除已经码盘的物料
|
||||||
void delete(dynamic) {
|
void delete(dynamic) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
packageData.removeWhere((r) {
|
// packageData.removeWhere((r) {
|
||||||
return r["id"] == dynamic["id"];
|
// return r["id"] == dynamic["id"];
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
if (packageData.isEmpty) {
|
if (packageData.isEmpty) {
|
||||||
packageDataId = 0;
|
packageDataId = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -320,10 +334,10 @@ class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
||||||
DialogUtils.showWarningMessage(context, "警告", "该文本框仅支持数字");
|
DialogUtils.showWarningMessage(context, "警告", "该文本框仅支持数字");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setState(() {
|
// setState(() {
|
||||||
packageData.where((w) => w["id"] == dynamic["id"]).first["quantity"] =
|
// packageData.where((w) => w["id"] == dynamic["id"]).first["quantity"] =
|
||||||
value;
|
// value;
|
||||||
});
|
// });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -365,7 +379,8 @@ class _StockInWheelEBSPageState extends State<StockInWheelEBS> {
|
||||||
confirmBtn: "继续", confirm: () {
|
confirmBtn: "继续", confirm: () {
|
||||||
int taskType = 1; // 1 表示进库,2 表示进站台
|
int taskType = 1; // 1 表示进库,2 表示进站台
|
||||||
BrnLoadingDialog.show(context, content: "正在请求入库");
|
BrnLoadingDialog.show(context, content: "正在请求入库");
|
||||||
StockInApi.stockInComplete(packageData).then((response) {
|
StockInApi.stockInComplete(packageData, vehicleNo)
|
||||||
|
.then((response) {
|
||||||
if (response["code"] != 200) {
|
if (response["code"] != 200) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ import '../../utils/dialogUtils.dart';
|
||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
|
Logger logger = Logger(
|
||||||
|
printer: PrettyPrinter(),
|
||||||
|
);
|
||||||
|
const Uuid uuidGen = Uuid();
|
||||||
|
|
||||||
class StockInBuy extends StatefulWidget {
|
class StockInBuy extends StatefulWidget {
|
||||||
const StockInBuy({super.key});
|
const StockInBuy({super.key});
|
||||||
|
|
||||||
|
|
@ -18,10 +23,6 @@ class StockInBuy extends StatefulWidget {
|
||||||
|
|
||||||
class _StockInBuyState extends State<StockInBuy> {
|
class _StockInBuyState extends State<StockInBuy> {
|
||||||
List<StockInDataXuGong> stockInDataXuGong = [];
|
List<StockInDataXuGong> stockInDataXuGong = [];
|
||||||
static var logger = Logger(
|
|
||||||
printer: PrettyPrinter(),
|
|
||||||
);
|
|
||||||
static var uuidGen = Uuid();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
@ -40,7 +41,8 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
if (response["code"] != 200) {
|
if (response["code"] != 200) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showWarningMessage(thisContext, "警告", "服务器请求失败", btnLabel: "我知道了");
|
DialogUtils.showWarningMessage(thisContext, "警告", "服务器请求失败",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +51,8 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
logger.e("yuqili2 $data");
|
logger.e("yuqili2 $data");
|
||||||
|
|
||||||
final List<dynamic> res = data["rows"];
|
final List<dynamic> res = data["rows"];
|
||||||
stockInDataXuGong = res.map((item) => StockInDataXuGong.fromJson(item)).toList();
|
stockInDataXuGong =
|
||||||
|
res.map((item) => StockInDataXuGong.fromJson(item)).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -96,8 +99,10 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text("物料号: ${item.goodsId}")),
|
Expanded(child: Text("物料号: ${item.goodsId}")),
|
||||||
Expanded(child: Text("数量: ${item.goodsNum}")),
|
Expanded(child: Text("数量: ${item.goodsNum}")),
|
||||||
Expanded(child: Text("描述: ${item.goodsDesc}")),
|
Expanded(
|
||||||
Expanded(child: Text("重量: ${item.weight} KG")),
|
child: Text("描述: ${item.goodsDesc}")),
|
||||||
|
Expanded(
|
||||||
|
child: Text("重量: ${item.weight} KG")),
|
||||||
Expanded(child: Text("尺寸: ${item.size}")),
|
Expanded(child: Text("尺寸: ${item.size}")),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.add),
|
icon: const Icon(Icons.add),
|
||||||
|
|
@ -144,7 +149,8 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
|
|
||||||
if (updatedItem != null) {
|
if (updatedItem != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
final index = stockInDataXuGong.indexWhere((e) => e.goodsId == item.goodsId);
|
final index =
|
||||||
|
stockInDataXuGong.indexWhere((e) => e.goodsId == item.goodsId);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
stockInDataXuGong[index] = updatedItem; // 更新列表
|
stockInDataXuGong[index] = updatedItem; // 更新列表
|
||||||
}
|
}
|
||||||
|
|
@ -152,8 +158,6 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _addMaterial(StockInDataXuGong item) {
|
void _addMaterial(StockInDataXuGong item) {
|
||||||
StockInApi.addStockIn(item).then((response) {
|
StockInApi.addStockIn(item).then((response) {
|
||||||
logger.e("yuqili $response");
|
logger.e("yuqili $response");
|
||||||
|
|
@ -167,8 +171,7 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
}
|
}
|
||||||
final data = Map<String, dynamic>.from(jsonDecode(response["data"]));
|
final data = Map<String, dynamic>.from(jsonDecode(response["data"]));
|
||||||
if (data["code"] == 200) {
|
if (data["code"] == 200) {
|
||||||
DialogUtils.showSuccessMessage(context, "成功", "添加入库",
|
DialogUtils.showSuccessMessage(context, "成功", "添加入库", btnLabel: "我知道了");
|
||||||
btnLabel: "我知道了");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
|
|
@ -193,7 +196,8 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
StockInApi.addCompleted(uuidGen.v4()).then((response) {
|
StockInApi.addCompleted(uuidGen.v4()).then((response) {
|
||||||
logger.e("yuqili $response");
|
logger.e("yuqili $response");
|
||||||
if (response["code"] != 200) {
|
if (response["code"] != 200) {
|
||||||
DialogUtils.showWarningMessage(context, "警告", "服务器请求失败", btnLabel: "我知道了");
|
DialogUtils.showWarningMessage(context, "警告", "服务器请求失败",
|
||||||
|
btnLabel: "我知道了");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final data = Map<String, dynamic>.from(jsonDecode(response["data"]));
|
final data = Map<String, dynamic>.from(jsonDecode(response["data"]));
|
||||||
|
|
@ -204,10 +208,13 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
DialogUtils.showSuccessMessage(context, "码盘成功", "", btnLabel: "我知道了");
|
DialogUtils.showSuccessMessage(context, "码盘成功", "", btnLabel: "我知道了");
|
||||||
} else {
|
} else {
|
||||||
DialogUtils.showWarningMessage(
|
DialogUtils.showWarningMessage(
|
||||||
context, "警告", "服务器返回失败:${data["message"]}", btnLabel: "我知道了");
|
context, "警告", "服务器返回失败:${data["message"]}",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
DialogUtils.showErrorMessage(context, "请求发生错误", "请求服务器发生错误:${err.toString()}", btnLabel: "我知道了");
|
DialogUtils.showErrorMessage(
|
||||||
|
context, "请求发生错误", "请求服务器发生错误:${err.toString()}",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}).whenComplete(() {
|
}).whenComplete(() {
|
||||||
BrnLoadingDialog.dismiss(context);
|
BrnLoadingDialog.dismiss(context);
|
||||||
});
|
});
|
||||||
|
|
@ -217,6 +224,7 @@ class _StockInBuyState extends State<StockInBuy> {
|
||||||
|
|
||||||
class EditStockInPage extends StatefulWidget {
|
class EditStockInPage extends StatefulWidget {
|
||||||
final StockInDataXuGong item;
|
final StockInDataXuGong item;
|
||||||
|
|
||||||
const EditStockInPage({super.key, required this.item});
|
const EditStockInPage({super.key, required this.item});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -234,10 +242,12 @@ class _EditStockInPageState extends State<EditStockInPage> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
goodsIdController = TextEditingController(text: widget.item.goodsId);
|
goodsIdController = TextEditingController(text: widget.item.goodsId);
|
||||||
goodsNumController = TextEditingController(text: widget.item.goodsNum.toString());
|
goodsNumController =
|
||||||
|
TextEditingController(text: widget.item.goodsNum.toString());
|
||||||
goodsDescController = TextEditingController(text: widget.item.goodsDesc);
|
goodsDescController = TextEditingController(text: widget.item.goodsDesc);
|
||||||
weightController = TextEditingController(text: widget.item.weight.toString());
|
weightController =
|
||||||
sizeController = TextEditingController(text: widget.item.size);
|
TextEditingController(text: widget.item.weight.toString());
|
||||||
|
sizeController = TextEditingController(text: widget.item.size.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -251,39 +261,25 @@ class _EditStockInPageState extends State<EditStockInPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _saveEdits() {
|
void _saveEdits() {
|
||||||
// Create the updated item
|
String listId = uuidGen.v4();
|
||||||
StockInDataXuGong updatedItem = StockInDataXuGong(
|
StockInDataXuGong updatedItem = StockInDataXuGong(
|
||||||
recordId: "0001",
|
listId: listId,
|
||||||
vehicleNo: "11",
|
|
||||||
customerId: "111",
|
|
||||||
createTime: DateTime.now(),
|
|
||||||
updateTime: DateTime.now(),
|
|
||||||
goodsCode: "00001",
|
|
||||||
listId: "1111",
|
|
||||||
unit: "元",
|
|
||||||
status: 1,
|
|
||||||
storageType: 1,
|
|
||||||
createPerson: "system",
|
|
||||||
remark: "test",
|
|
||||||
|
|
||||||
goodsId: goodsIdController.text,
|
goodsId: goodsIdController.text,
|
||||||
goodsNum: int.parse(goodsNumController.text),
|
goodsNum: int.parse(goodsNumController.text),
|
||||||
orderId: widget.item.orderId, // Retain the original value
|
orderType: widget.item.orderType,
|
||||||
orderType: widget.item.orderType, // Retain the original value
|
customerName: widget.item.customerName,
|
||||||
customerName: widget.item.customerName, // Retain the original value
|
|
||||||
goodsDesc: goodsDescController.text,
|
goodsDesc: goodsDescController.text,
|
||||||
weight: double.parse(weightController.text),
|
weight: double.parse(weightController.text),
|
||||||
size: sizeController.text,
|
size: int.parse(sizeController.text),
|
||||||
spare1: widget.item.spare1, // Retain the original value
|
unit: widget.item.unit,
|
||||||
spare2: widget.item.spare2, // Retain the original value
|
spare1: widget.item.spare1,
|
||||||
containerNo: widget.item.containerNo, // Retain the original value
|
spare2: widget.item.spare2,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pass the updated item back to the previous page
|
// Pass the updated item back to the previous page
|
||||||
Navigator.of(context).pop(updatedItem);
|
Navigator.of(context).pop(updatedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -319,15 +315,8 @@ class _EditStockInPageState extends State<EditStockInPage> {
|
||||||
controller: sizeController,
|
controller: sizeController,
|
||||||
decoration: const InputDecoration(labelText: '尺寸'),
|
decoration: const InputDecoration(labelText: '尺寸'),
|
||||||
),
|
),
|
||||||
// Non-editable fields styled to look like editable ones but greyed out
|
|
||||||
TextField(
|
TextField(
|
||||||
controller: TextEditingController(text: widget.item.orderId),
|
controller: TextEditingController(text: widget.item.orderType.toString()),
|
||||||
decoration: const InputDecoration(labelText: "单据号"),
|
|
||||||
enabled: false,
|
|
||||||
style: TextStyle(color: Colors.grey),
|
|
||||||
),
|
|
||||||
TextField(
|
|
||||||
controller: TextEditingController(text: widget.item.orderType),
|
|
||||||
decoration: const InputDecoration(labelText: "单据类型"),
|
decoration: const InputDecoration(labelText: "单据类型"),
|
||||||
enabled: false,
|
enabled: false,
|
||||||
style: TextStyle(color: Colors.grey),
|
style: TextStyle(color: Colors.grey),
|
||||||
|
|
@ -338,12 +327,6 @@ class _EditStockInPageState extends State<EditStockInPage> {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
style: TextStyle(color: Colors.grey),
|
style: TextStyle(color: Colors.grey),
|
||||||
),
|
),
|
||||||
TextField(
|
|
||||||
controller: TextEditingController(text: widget.item.containerNo),
|
|
||||||
decoration: const InputDecoration(labelText: "容器号"),
|
|
||||||
enabled: false,
|
|
||||||
style: TextStyle(color: Colors.grey),
|
|
||||||
),
|
|
||||||
TextField(
|
TextField(
|
||||||
controller: TextEditingController(text: widget.item.spare1),
|
controller: TextEditingController(text: widget.item.spare1),
|
||||||
decoration: const InputDecoration(labelText: "备用1"),
|
decoration: const InputDecoration(labelText: "备用1"),
|
||||||
|
|
@ -369,5 +352,3 @@ class _EditStockInPageState extends State<EditStockInPage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:ffi';
|
||||||
|
|
||||||
import 'package:bruno/bruno.dart';
|
import 'package:bruno/bruno.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -25,13 +26,13 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
final _vehicleTextController = TextEditingController(); // 载具号输入框
|
final _vehicleTextController = TextEditingController(); // 载具号输入框
|
||||||
final _goodsCodeController = TextEditingController(); // 条码输入框
|
final _goodsCodeController = TextEditingController(); // 条码输入框
|
||||||
final _goodsNumController = BrnStepsController();
|
final _goodsNumController = BrnStepsController();
|
||||||
final _orderNoController = TextEditingController();
|
final _listIdController = TextEditingController();
|
||||||
final _orderTypeController = TextEditingController();
|
final _orderTypeController = TextEditingController();
|
||||||
final _customerIdController = TextEditingController();
|
final _customerNameController = TextEditingController();
|
||||||
final _goodsDescController = TextEditingController();
|
final _goodsDescController = TextEditingController();
|
||||||
|
final _goodsUnitController = TextEditingController();
|
||||||
final _weightController = TextEditingController();
|
final _weightController = TextEditingController();
|
||||||
final _sizeController = TextEditingController();
|
final _sizeController = TextEditingController();
|
||||||
final _containerNoController = TextEditingController();
|
|
||||||
final _spare1Controller = TextEditingController();
|
final _spare1Controller = TextEditingController();
|
||||||
final _spare2Controller = TextEditingController();
|
final _spare2Controller = TextEditingController();
|
||||||
|
|
||||||
|
|
@ -44,9 +45,11 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
iconTheme: const IconThemeData(color: Colors.white),
|
iconTheme: const IconThemeData(color: Colors.white),
|
||||||
leading: IconButton(onPressed: () {
|
leading: IconButton(
|
||||||
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}, icon: const Icon(Icons.arrow_back)),
|
},
|
||||||
|
icon: const Icon(Icons.arrow_back)),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
backgroundColor: ColorCommon.colorScheme,
|
backgroundColor: ColorCommon.colorScheme,
|
||||||
title: const Text(
|
title: const Text(
|
||||||
|
|
@ -54,10 +57,12 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(onPressed: () {},
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
style: const ButtonStyle(
|
style: const ButtonStyle(
|
||||||
foregroundColor: WidgetStatePropertyAll(Colors.white)),
|
foregroundColor: WidgetStatePropertyAll(Colors.white)),
|
||||||
child: const Text("清空"),)
|
child: const Text("清空"),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
|
|
@ -67,7 +72,8 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
children: [
|
children: [
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _goodsCodeController,
|
controller: _goodsCodeController,
|
||||||
title: "物料号:", hint: "请输入或扫描物料号",
|
title: "物料号:",
|
||||||
|
hint: "请输入或扫描物料号",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnStepInputFormItem(
|
BrnStepInputFormItem(
|
||||||
|
|
@ -76,26 +82,40 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
value: goodsNum,
|
value: goodsNum,
|
||||||
maxLimit: 9999,
|
maxLimit: 9999,
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
canManualInput: true
|
canManualInput: true,
|
||||||
),
|
onChanged: (newValue, _) {
|
||||||
|
setState(() {
|
||||||
|
goodsNum = newValue;
|
||||||
|
});
|
||||||
|
}),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _orderNoController,
|
controller: _listIdController,
|
||||||
title: "单据号:", hint: "请输入或扫描单据号",
|
title: "单据号:",
|
||||||
|
hint: "请输入或扫描单据号",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _orderTypeController,
|
controller: _orderTypeController,
|
||||||
title: "单据类型:", hint: "请输入或扫描单据类型",
|
title: "单据类型:",
|
||||||
|
hint: "请输入或扫描单据类型",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _customerIdController,
|
controller: _customerNameController,
|
||||||
title: "客户名称:", hint: "请输入或扫描客户名称",
|
title: "客户名称:",
|
||||||
|
hint: "请输入或扫描客户名称",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _goodsDescController,
|
controller: _goodsDescController,
|
||||||
title: "物料描述:", hint: "请输入或扫描物料描述",
|
title: "物料描述:",
|
||||||
|
hint: "请输入或扫描物料描述",
|
||||||
|
isRequire: true,
|
||||||
|
),
|
||||||
|
BrnTextInputFormItem(
|
||||||
|
controller: _goodsUnitController,
|
||||||
|
title: "物料单位:",
|
||||||
|
hint: "请输入物料单位",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
|
|
@ -107,48 +127,48 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _sizeController,
|
controller: _sizeController,
|
||||||
title: "尺寸:", hint: "请输入或扫描尺寸",
|
title: "尺寸:",
|
||||||
|
hint: "请输入或扫描尺寸",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _spare1Controller,
|
controller: _spare1Controller,
|
||||||
title: "备用1:", hint: "请输入",
|
title: "备用1:",
|
||||||
|
hint: "请输入",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _spare2Controller,
|
controller: _spare2Controller,
|
||||||
title: "备用2:", hint: "请输入",
|
title: "备用2:",
|
||||||
|
hint: "请输入",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: resolveCode,
|
onPressed: resolveCode,
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStateProperty.all(
|
backgroundColor:
|
||||||
ColorCommon.colorScheme),
|
WidgetStateProperty.all(ColorCommon.colorScheme),
|
||||||
),
|
|
||||||
child: const Text(
|
|
||||||
"添加物料",
|
|
||||||
style: TextStyle(color: Colors.white))
|
|
||||||
),
|
),
|
||||||
|
child: const Text("添加物料",
|
||||||
|
style: TextStyle(color: Colors.white))),
|
||||||
BrnTextInputFormItem(
|
BrnTextInputFormItem(
|
||||||
controller: _containerNoController,
|
controller: _vehicleTextController,
|
||||||
title: "容器号:", hint: "",
|
title: "容器号:",
|
||||||
|
hint: "",
|
||||||
isRequire: true,
|
isRequire: true,
|
||||||
),
|
),
|
||||||
Padding(padding: const EdgeInsets.only(top: 0),
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: wheelComplete,
|
onPressed: wheelComplete,
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStateProperty.all(
|
backgroundColor:
|
||||||
ColorCommon.colorScheme),
|
WidgetStateProperty.all(ColorCommon.colorScheme),
|
||||||
),
|
),
|
||||||
child: const Text(
|
child: const Text("码盘完成",
|
||||||
"码盘完成",
|
style: TextStyle(color: Colors.white)))),
|
||||||
style: TextStyle(
|
const Padding(
|
||||||
color: Colors.white
|
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||||
))
|
|
||||||
)),
|
|
||||||
const Padding(padding: EdgeInsets.only(top: 10, bottom: 10),
|
|
||||||
child: Text("添加在载具的物料:"),
|
child: Text("添加在载具的物料:"),
|
||||||
),
|
),
|
||||||
StockInCardXuGong(stockInDataXuGong: stockInDataXuGong)
|
StockInCardXuGong(stockInDataXuGong: stockInDataXuGong)
|
||||||
|
|
@ -162,54 +182,41 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
void resolveCode() {
|
void resolveCode() {
|
||||||
setState(() {
|
setState(() {
|
||||||
stockInDataXuGong.add(StockInDataXuGong(
|
stockInDataXuGong.add(StockInDataXuGong(
|
||||||
customerName: "yuqili",
|
customerName: _customerNameController.text,
|
||||||
containerNo: "0",
|
weight: double.parse(_weightController.text),
|
||||||
weight: 10,
|
size: int.parse(_sizeController.text),
|
||||||
size: "55",
|
unit: _goodsUnitController.text,
|
||||||
listId: uuidGen.v4(),
|
listId: _listIdController.text,
|
||||||
goodsCode: "555",
|
orderType: int.parse(_orderTypeController.text),
|
||||||
unit: "支",
|
|
||||||
status: 0,
|
|
||||||
storageType: 0,
|
|
||||||
createPerson: "system",
|
|
||||||
remark: "test",
|
|
||||||
orderType: _orderTypeController.text,
|
|
||||||
goodsNum: goodsNum,
|
goodsNum: goodsNum,
|
||||||
orderId: _orderNoController.text,
|
|
||||||
vehicleNo: "0",
|
|
||||||
goodsId: _goodsCodeController.text,
|
goodsId: _goodsCodeController.text,
|
||||||
goodsDesc: _goodsDescController.text,
|
goodsDesc: _goodsDescController.text,
|
||||||
customerId: _customerIdController.text,
|
|
||||||
recordId: uuidGen.v4(),
|
|
||||||
createTime: DateTime.now(),
|
|
||||||
updateTime: DateTime.now(),
|
|
||||||
spare1: _spare1Controller.text,
|
spare1: _spare1Controller.text,
|
||||||
spare2: _spare2Controller.text));
|
spare2: _spare2Controller.text));
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 码盘完成
|
/// 码盘完成
|
||||||
void wheelComplete() {
|
void wheelComplete() {
|
||||||
if (stockInDataXuGong.isEmpty) {
|
if (stockInDataXuGong.isEmpty) {
|
||||||
DialogUtils.showWarningMessage(
|
DialogUtils.showWarningMessage(context, "警告", "您的码盘数据为空", btnLabel: "确定");
|
||||||
context, "警告", "您的码盘数据为空", btnLabel: "确定");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String vehicleNo = "1";
|
String vehicleNo = _vehicleTextController.text;
|
||||||
int dataCount = stockInDataXuGong.length;
|
int dataCount = stockInDataXuGong.length;
|
||||||
DialogUtils.showConfirmMessage(
|
DialogUtils.showConfirmMessage(
|
||||||
context, "码盘完成", "载具:$vehicleNo 码盘 $dataCount 条数据,是否继续?",
|
context, "码盘完成", "载具:$vehicleNo 码盘 $dataCount 条数据,是否继续?",
|
||||||
confirmBtn: "继续", confirm: () {
|
confirmBtn: "继续", confirm: () {
|
||||||
int taskType = 1; // 1 表示进库,2 表示进站台
|
int taskType = 1; // 1 表示进库,2 表示进站台
|
||||||
BrnLoadingDialog.show(context, content: "正在请求入库");
|
BrnLoadingDialog.show(context, content: "正在请求入库");
|
||||||
StockInApi.stockInComplete(stockInDataXuGong).then((response) {
|
StockInApi.stockInComplete(stockInDataXuGong, vehicleNo)
|
||||||
|
.then((response) {
|
||||||
if (response["code"] != 200) {
|
if (response["code"] != 200) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showWarningMessage(
|
DialogUtils.showWarningMessage(thisContext, "警告", "服务器请求失败",
|
||||||
thisContext, "警告", "服务器请求失败", btnLabel: "我知道了");
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -222,8 +229,8 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
});
|
});
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showSuccessMessage(
|
DialogUtils.showSuccessMessage(thisContext, "码盘成功", "",
|
||||||
thisContext, "码盘成功", "", btnLabel: "我知道了");
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -237,8 +244,9 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showErrorMessage(thisContext, "请求发生错误",
|
DialogUtils.showErrorMessage(
|
||||||
"请求服务器发生错误:${err.toString()}", btnLabel: "我知道了");
|
thisContext, "请求发生错误", "请求服务器发生错误:${err.toString()}",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}).whenComplete(() {
|
}).whenComplete(() {
|
||||||
|
|
@ -252,22 +260,19 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
|
|
||||||
/// 出一个空空箱
|
/// 出一个空空箱
|
||||||
getEmptyVehicle() {
|
getEmptyVehicle() {
|
||||||
DialogUtils.showConfirmMessage(
|
DialogUtils.showConfirmMessage(context, "空载具出库", "出一个空载具?",
|
||||||
context, "空载具出库", "出一个空载具?", confirmBtn: "出一个",
|
confirmBtn: "出一个", confirm: () {
|
||||||
confirm: () {
|
|
||||||
BrnLoadingDialog.show(context, content: "正在请求,请稍后");
|
BrnLoadingDialog.show(context, content: "正在请求,请稍后");
|
||||||
StockOutApi.getEmptyVehicle().then((response) {
|
StockOutApi.getEmptyVehicle().then((response) {
|
||||||
if (response["code"] != 200) {
|
if (response["code"] != 200) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showWarningMessage(
|
DialogUtils.showWarningMessage(thisContext, "警告", "服务器请求失败",
|
||||||
thisContext, "警告", "服务器请求失败",
|
|
||||||
btnLabel: "我知道了");
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final data = Map<String, dynamic>.from(
|
final data = Map<String, dynamic>.from(jsonDecode(response["data"]));
|
||||||
jsonDecode(response["data"]));
|
|
||||||
if (data["code"] == 200) {
|
if (data["code"] == 200) {
|
||||||
// 请求成功
|
// 请求成功
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -276,8 +281,8 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
});
|
});
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showSuccessMessage(
|
DialogUtils.showSuccessMessage(thisContext, "请求成功", "",
|
||||||
thisContext, "请求成功", "", btnLabel: "我知道了");
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -291,8 +296,9 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
var thisContext = context;
|
var thisContext = context;
|
||||||
if (thisContext.mounted) {
|
if (thisContext.mounted) {
|
||||||
DialogUtils.showErrorMessage(thisContext, "请求发生错误",
|
DialogUtils.showErrorMessage(
|
||||||
"请求服务器发生错误:${err.toString()}", btnLabel: "我知道了");
|
thisContext, "请求发生错误", "请求服务器发生错误:${err.toString()}",
|
||||||
|
btnLabel: "我知道了");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}).whenComplete(() {
|
}).whenComplete(() {
|
||||||
|
|
@ -303,5 +309,4 @@ class _StockInNormalState extends State<StockInNormal> {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user