fix(client): 修复入库/出库单列表供应商和仓库显示为空
fromJson 读 json['warehouse']['name'] 而非不存在的 json['warehouse_name'], partner 同理。后端返回的是嵌套对象而非扁平字段。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,11 +84,11 @@ class StockInOrder {
|
|||||||
orderNo: json['order_no'] as String,
|
orderNo: json['order_no'] as String,
|
||||||
type: json['type'] as String?,
|
type: json['type'] as String?,
|
||||||
warehouseId: (json['warehouse_id'] as num).toInt(),
|
warehouseId: (json['warehouse_id'] as num).toInt(),
|
||||||
warehouseName: json['warehouse_name'] as String?,
|
warehouseName: (json['warehouse'] as Map<String, dynamic>?)?['name'] as String?,
|
||||||
partnerId: json['partner_id'] != null
|
partnerId: json['partner_id'] != null
|
||||||
? (json['partner_id'] as num).toInt()
|
? (json['partner_id'] as num).toInt()
|
||||||
: null,
|
: null,
|
||||||
partnerName: json['partner_name'] as String?,
|
partnerName: (json['partner'] as Map<String, dynamic>?)?['name'] as String?,
|
||||||
operatorId: json['operator_id'] != null
|
operatorId: json['operator_id'] != null
|
||||||
? (json['operator_id'] as num).toInt()
|
? (json['operator_id'] as num).toInt()
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ class StockOutOrder {
|
|||||||
orderNo: json['order_no'] as String,
|
orderNo: json['order_no'] as String,
|
||||||
type: json['type'] as String?,
|
type: json['type'] as String?,
|
||||||
warehouseId: (json['warehouse_id'] as num).toInt(),
|
warehouseId: (json['warehouse_id'] as num).toInt(),
|
||||||
warehouseName: json['warehouse_name'] as String?,
|
warehouseName: (json['warehouse'] as Map<String, dynamic>?)?['name'] as String?,
|
||||||
partnerId: json['partner_id'] != null
|
partnerId: json['partner_id'] != null
|
||||||
? (json['partner_id'] as num).toInt()
|
? (json['partner_id'] as num).toInt()
|
||||||
: null,
|
: null,
|
||||||
partnerName: json['partner_name'] as String?,
|
partnerName: (json['partner'] as Map<String, dynamic>?)?['name'] as String?,
|
||||||
operatorId: json['operator_id'] != null
|
operatorId: json['operator_id'] != null
|
||||||
? (json['operator_id'] as num).toInt()
|
? (json['operator_id'] as num).toInt()
|
||||||
: null,
|
: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user