import type { IBill } from '@/domain/iPurchaseOrder.ts'; /** 门店账单(采购单完成后按门店生成),类型定义在 iPurchaseOrder.ts */ export type { IBill }; export { BILL_STATUS_MAP } from '@/domain/iPurchaseOrder.ts'; /** 账单合并商品明细行(按商品聚合账单关联的全部订单明细) */ export interface IBillGoodsItem { product_id: number; product_name: string; /** 规格/包规 */ product_spec: string; unit: string; /** 单价(加权平均:Σ金额÷Σ数量) */ price: string; /** 数量合计 */ quantity: number; /** 重量合计 */ weight: string; /** 金额合计 = Σ 明细金额 */ amount: string; } /** 账单关联的门店订单 */ export interface IBillOrder { id: number; order_no: string; order_date: string; total_quantity: number; total_weight: string; total_amount: string; /** 0待接单 1已接单 2采购中 3配送中 4已完成 9已取消 */ status: number; } /** 账单详情(账单 + 合并商品明细 + 关联订单) */ export interface IBillDetail { bill: IBill; items: IBillGoodsItem[]; orders: IBillOrder[]; }