feat(client): 出库明细成本/售价/利润三列重设计 + 建单利润列 + 入库列头统一

- 出库详情抽屉(管理员):数量/成本价/售价/利润 + 合计金额/合计利润 双行;
  operator 见 售价/小计(服务端抹零+前端隐藏双保险);利润负数 danger
- 出库建单:商品名称下带编码(字体同系列列);金额列→利润列(实时);
  底栏合计利润(仅管理员);进价列仅管理员;提交发新 key(cost_price/sale_price)
- 入库建单列头:进价(单瓶)/ 参考售价 / 总进价
- 退单弹窗金额改售价口径(与冲应收一致);打印保留待定价回退成本兼容
- models 字段随后端消歧改名;golden 重打;新增抽屉双形态 widget 测试

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-03 12:44:22 +08:00
parent 4fd0bb8b83
commit 979ca3c83b
20 changed files with 400 additions and 145 deletions
+12 -12
View File
@@ -3,8 +3,8 @@ class StockInItem {
final int? orderId;
final int productId;
final double quantity;
final double unitPrice;
final double totalPrice;
final double costPrice; // 进价(单瓶)
final double costAmount; // 总进价 = quantity × costPrice
final double returnedQuantity; // 0=未退;>=quantity 表示整行已退单
final String? batchNo;
final String? productionDate;
@@ -26,8 +26,8 @@ class StockInItem {
this.orderId,
required this.productId,
required this.quantity,
required this.unitPrice,
required this.totalPrice,
required this.costPrice,
required this.costAmount,
this.returnedQuantity = 0,
this.batchNo,
this.productionDate,
@@ -57,8 +57,8 @@ class StockInItem {
json['order_id'] != null ? (json['order_id'] as num).toInt() : null,
productId: (json['product_id'] as num).toInt(),
quantity: (json['quantity'] as num).toDouble(),
unitPrice: (json['unit_price'] as num).toDouble(),
totalPrice: (json['total_price'] as num).toDouble(),
costPrice: (json['cost_price'] as num?)?.toDouble() ?? 0,
costAmount: (json['cost_amount'] as num?)?.toDouble() ?? 0,
returnedQuantity: (json['returned_quantity'] as num?)?.toDouble() ?? 0,
batchNo: json['batch_no'] as String?,
productionDate: json['production_date'] as String?,
@@ -81,8 +81,8 @@ class StockInItem {
Map<String, dynamic> toJson() => {
'product_id': productId,
'quantity': quantity,
'unit_price': unitPrice,
'total_price': totalPrice,
'cost_price': costPrice,
'cost_amount': costAmount,
if (batchNo != null) 'batch_no': batchNo,
if (productionDate != null) 'production_date': productionDate,
};
@@ -104,7 +104,7 @@ class StockInOrder {
final String returnState; // none | partial | full(退单状态)
final String? orderDate;
final String? reviewedAt;
final double? totalAmount;
final double? costTotal; // 应付合计 = Σ 总进价
final String? remark;
final List<StockInItem> items;
@@ -124,7 +124,7 @@ class StockInOrder {
this.returnState = 'none',
this.orderDate,
this.reviewedAt,
this.totalAmount,
this.costTotal,
this.remark,
this.items = const [],
});
@@ -155,8 +155,8 @@ class StockInOrder {
returnState: json['return_state'] as String? ?? 'none',
orderDate: json['order_date'] as String?,
reviewedAt: json['reviewed_at'] as String?,
totalAmount: json['total_amount'] != null
? (json['total_amount'] as num).toDouble()
costTotal: json['cost_total'] != null
? (json['cost_total'] as num).toDouble()
: null,
remark: json['remark'] as String?,
items: json['items'] != null