2025-02-19 18:52:05 +08:00
|
|
|
class StockInDataXuGong {
|
2025-02-23 16:19:27 +08:00
|
|
|
String goodsId = ""; // 物料号
|
2025-02-24 15:52:03 +08:00
|
|
|
|
2025-02-23 16:19:27 +08:00
|
|
|
int goodsNum = 0; // 物料数量
|
2025-02-24 15:52:03 +08:00
|
|
|
|
|
|
|
|
String listId = ""; // 单据号
|
|
|
|
|
|
|
|
|
|
int orderType = 0; // 单据类型
|
|
|
|
|
|
|
|
|
|
String customerName = ""; // 客户名称
|
|
|
|
|
|
2025-02-22 15:56:40 +08:00
|
|
|
String goodsDesc = ""; // 物料描述
|
2025-02-24 15:52:03 +08:00
|
|
|
|
|
|
|
|
double weight = 0; // 重量
|
|
|
|
|
|
|
|
|
|
int size = 0; // 尺寸
|
|
|
|
|
|
|
|
|
|
String unit = ""; // 单位
|
|
|
|
|
|
2025-02-23 16:19:27 +08:00
|
|
|
String spare1 = ""; // 备用1
|
2025-02-24 15:52:03 +08:00
|
|
|
|
2025-02-23 16:19:27 +08:00
|
|
|
String spare2 = ""; // 备用2
|
2025-02-19 18:52:05 +08:00
|
|
|
|
|
|
|
|
StockInDataXuGong({
|
|
|
|
|
required this.goodsId,
|
|
|
|
|
required this.goodsNum,
|
|
|
|
|
required this.orderType,
|
|
|
|
|
required this.goodsDesc,
|
|
|
|
|
required this.weight,
|
|
|
|
|
required this.size,
|
2025-02-23 16:19:27 +08:00
|
|
|
required this.customerName,
|
2025-02-19 18:52:05 +08:00
|
|
|
required this.spare1,
|
|
|
|
|
required this.spare2,
|
2025-02-23 16:19:27 +08:00
|
|
|
required this.listId,
|
|
|
|
|
required this.unit,
|
2025-02-19 18:52:05 +08:00
|
|
|
});
|
2025-02-22 15:56:40 +08:00
|
|
|
|
|
|
|
|
// Updated fromJson method
|
|
|
|
|
factory StockInDataXuGong.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return StockInDataXuGong(
|
2025-02-23 16:19:27 +08:00
|
|
|
customerName: json["customerName"] ?? "",
|
|
|
|
|
listId: json["listId"] ?? "",
|
|
|
|
|
goodsId: json["goodsId"] ?? "",
|
|
|
|
|
goodsNum: json["goodsNum"] ?? 10.0,
|
2025-02-24 15:52:03 +08:00
|
|
|
orderType: json["orderType"] ?? 0,
|
2025-02-23 16:19:27 +08:00
|
|
|
goodsDesc: json["goodsDesc"] ?? "",
|
|
|
|
|
spare1: json["spare1"] ?? "",
|
|
|
|
|
spare2: json["spare2"] ?? "",
|
|
|
|
|
weight: json["weight"] ?? 10.0,
|
|
|
|
|
size: json["size"] ?? "50",
|
2025-02-24 15:52:03 +08:00
|
|
|
unit: json["unit"] ?? "",
|
2025-02-22 15:56:40 +08:00
|
|
|
);
|
|
|
|
|
}
|
2025-02-23 16:19:27 +08:00
|
|
|
|
|
|
|
|
// 实现 toJson 方法
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
return {
|
|
|
|
|
"listId": listId,
|
|
|
|
|
"orderType": orderType,
|
|
|
|
|
"goodsId": goodsId,
|
|
|
|
|
"goodsNum": goodsNum,
|
|
|
|
|
"goodsDesc": goodsDesc,
|
|
|
|
|
"spare1": spare1,
|
|
|
|
|
"spare2": spare2,
|
|
|
|
|
"weight": weight,
|
|
|
|
|
"customerName": customerName,
|
|
|
|
|
"size": size,
|
2025-02-24 15:52:03 +08:00
|
|
|
"unit": unit,
|
2025-02-23 16:19:27 +08:00
|
|
|
};
|
|
|
|
|
}
|
2025-02-20 13:23:50 +08:00
|
|
|
}
|