From 1a4afec1bea4a19223339d9e664c238f98b4fdd3 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Wed, 8 Apr 2026 08:39:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E4=BF=AE=E5=A4=8D=E5=85=A5?= =?UTF-8?q?=E5=BA=93/=E5=87=BA=E5=BA=93=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=92=8C=E4=BB=93=E5=BA=93=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fromJson 读 json['warehouse']['name'] 而非不存在的 json['warehouse_name'], partner 同理。后端返回的是嵌套对象而非扁平字段。 Co-Authored-By: Claude Sonnet 4.6 --- client/lib/models/stock_in.dart | 4 ++-- client/lib/models/stock_out.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/lib/models/stock_in.dart b/client/lib/models/stock_in.dart index d6e7079..12202a3 100644 --- a/client/lib/models/stock_in.dart +++ b/client/lib/models/stock_in.dart @@ -84,11 +84,11 @@ class StockInOrder { orderNo: json['order_no'] as String, type: json['type'] as String?, warehouseId: (json['warehouse_id'] as num).toInt(), - warehouseName: json['warehouse_name'] as String?, + warehouseName: (json['warehouse'] as Map?)?['name'] as String?, partnerId: json['partner_id'] != null ? (json['partner_id'] as num).toInt() : null, - partnerName: json['partner_name'] as String?, + partnerName: (json['partner'] as Map?)?['name'] as String?, operatorId: json['operator_id'] != null ? (json['operator_id'] as num).toInt() : null, diff --git a/client/lib/models/stock_out.dart b/client/lib/models/stock_out.dart index 333e722..68c9f7a 100644 --- a/client/lib/models/stock_out.dart +++ b/client/lib/models/stock_out.dart @@ -72,11 +72,11 @@ class StockOutOrder { orderNo: json['order_no'] as String, type: json['type'] as String?, warehouseId: (json['warehouse_id'] as num).toInt(), - warehouseName: json['warehouse_name'] as String?, + warehouseName: (json['warehouse'] as Map?)?['name'] as String?, partnerId: json['partner_id'] != null ? (json['partner_id'] as num).toInt() : null, - partnerName: json['partner_name'] as String?, + partnerName: (json['partner'] as Map?)?['name'] as String?, operatorId: json['operator_id'] != null ? (json['operator_id'] as num).toInt() : null,