c1ed81dfab
后端 - 新增 shop handler:GET/PUT /shop/info(管理员权限) - 新增 finance CloseByRef:按单据 ref_type+ref_id 结清账款 - 新增 inventory UpdateRemark:PUT /inventory/:id/remark - 入库/出库审批自动生成财务应付/应收记录(去除金额>0限制) - 种子数据 S001-S003 补充真实门店信息 前端 - 设置页新增「酒行信息」Tab,管理员可编辑门店名称/地址/电话/负责人 - 入库单列表新增结清按钮(含确认弹窗),出库单同步 - 入库表单:规格、系列、生产日期、供应商、商品名称改为提交必填 - 入库/出库列表新增入库时间、出库时间、创建时间列 - 商品标签标题改为读取 shop 表门店名,扫码文案改为「扫码溯源 · TRACE」 - 标签页脚显示门店地址和电话(从 API 读取,不再依赖编译时 dart-define) - 库存备注支持点击编辑,超4字截断显示+Hover展示全文 - ApiClient 新增 patch() 方法(已改用 PUT 规避 CORS) 文档 - 新增 docs/user-manual.md 完整用户操作手册(12章) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
117 lines
3.9 KiB
Dart
117 lines
3.9 KiB
Dart
class StockOutItem {
|
|
final int? orderId;
|
|
final int productId;
|
|
final double quantity;
|
|
final double unitPrice;
|
|
final double totalPrice;
|
|
final String? productName;
|
|
final String? productCode;
|
|
final String? productSeries;
|
|
final String? productSpec;
|
|
final String? productUnit;
|
|
|
|
const StockOutItem({
|
|
this.orderId,
|
|
required this.productId,
|
|
required this.quantity,
|
|
required this.unitPrice,
|
|
required this.totalPrice,
|
|
this.productName,
|
|
this.productCode,
|
|
this.productSeries,
|
|
this.productSpec,
|
|
this.productUnit,
|
|
});
|
|
|
|
factory StockOutItem.fromJson(Map<String, dynamic> json) => StockOutItem(
|
|
orderId: 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(),
|
|
productName: (json['product'] as Map<String, dynamic>?)?['name'] as String?,
|
|
productCode: (json['product'] as Map<String, dynamic>?)?['code'] as String?,
|
|
productSeries: (json['product'] as Map<String, dynamic>?)?['series'] as String?,
|
|
productSpec: (json['product'] as Map<String, dynamic>?)?['spec'] as String?,
|
|
productUnit: (json['product'] as Map<String, dynamic>?)?['unit'] as String?,
|
|
);
|
|
}
|
|
|
|
class StockOutOrder {
|
|
final int id;
|
|
final String orderNo;
|
|
final String? type;
|
|
final int warehouseId;
|
|
final String? warehouseName;
|
|
final int? partnerId;
|
|
final String? partnerName;
|
|
final int? operatorId;
|
|
final String? operatorName;
|
|
final int? reviewerId;
|
|
final String? reviewerName;
|
|
final String status; // draft | pending | approved | rejected
|
|
final String? orderDate;
|
|
final String? reviewedAt;
|
|
final String? createdAt;
|
|
final double? totalAmount;
|
|
final String? remark;
|
|
final List<StockOutItem> items;
|
|
|
|
const StockOutOrder({
|
|
required this.id,
|
|
required this.orderNo,
|
|
this.type,
|
|
required this.warehouseId,
|
|
this.warehouseName,
|
|
this.partnerId,
|
|
this.partnerName,
|
|
this.operatorId,
|
|
this.operatorName,
|
|
this.reviewerId,
|
|
this.reviewerName,
|
|
required this.status,
|
|
this.orderDate,
|
|
this.reviewedAt,
|
|
this.createdAt,
|
|
this.totalAmount,
|
|
this.remark,
|
|
this.items = const [],
|
|
});
|
|
|
|
factory StockOutOrder.fromJson(Map<String, dynamic> json) => StockOutOrder(
|
|
id: (json['id'] as num).toInt(),
|
|
orderNo: json['order_no'] as String,
|
|
type: json['type'] as String?,
|
|
warehouseId: (json['warehouse_id'] as num).toInt(),
|
|
warehouseName: (json['warehouse'] as Map<String, dynamic>?)?['name'] as String?,
|
|
partnerId: json['partner_id'] != null
|
|
? (json['partner_id'] as num).toInt()
|
|
: null,
|
|
partnerName: (json['partner'] as Map<String, dynamic>?)?['name'] as String?,
|
|
operatorId: json['operator_id'] != null
|
|
? (json['operator_id'] as num).toInt()
|
|
: null,
|
|
operatorName: (json['operator'] as Map<String, dynamic>?)?['real_name'] as String?,
|
|
reviewerId: json['reviewer_id'] != null
|
|
? (json['reviewer_id'] as num).toInt()
|
|
: null,
|
|
reviewerName: (json['reviewer'] as Map<String, dynamic>?)?['real_name'] as String?,
|
|
status: json['status'] as String,
|
|
orderDate: json['order_date'] as String?,
|
|
reviewedAt: json['reviewed_at'] as String?,
|
|
createdAt: json['created_at'] as String?,
|
|
totalAmount: json['total_amount'] != null
|
|
? (json['total_amount'] as num).toDouble()
|
|
: null,
|
|
remark: json['remark'] as String?,
|
|
items: json['items'] != null
|
|
? (json['items'] as List)
|
|
.map((e) =>
|
|
StockOutItem.fromJson(e as Map<String, dynamic>))
|
|
.toList()
|
|
: [],
|
|
);
|
|
}
|