Files
xin-procurement/web/domain/iStoreOrder.ts
T
2026-08-14 01:19:47 +08:00

81 lines
2.0 KiB
TypeScript

/** 门店订单明细(下单时商品档案快照) */
export interface IStoreOrderItem {
id?: number;
order_id?: number;
store_id?: number;
product_id?: number;
category_id?: number;
supplier_id?: number;
/** 详情接口附带的供应商信息 */
supplier?: { id: number; name: string };
product_name?: string;
product_spec?: string;
/** 计价单位(斤/件/箱等) */
unit?: string;
price?: string;
/** 列表接口附带的封面图 */
image?: string;
image_ids?: string;
shelf_life?: number;
quantity?: number;
weight?: string;
amount?: string;
/** 成本价(仅后台接口可见) */
cost_price?: string;
remark?: string;
}
/** 修改订单明细入参(保存后后端重算单品金额与订单总价) */
export interface IStoreOrderItemUpdate {
supplier_id: number;
product_name: string;
product_spec?: string;
unit: string;
price: number;
cost_price: number;
quantity: number;
weight: number;
remark: string;
}
/** 门店订单 */
export default interface IStoreOrder {
id?: number;
order_no?: string;
store_id?: number;
purchase_id?: number;
/** 关联账单ID(采购单完成后按门店生成账单时回写) */
bill_id?: number;
store?: {
id: number;
name: string;
address: string;
contact: string;
phone: string;
};
order_date?: string;
total_quantity?: number;
total_weight?: string;
total_amount?: string;
/** 0待接单 1已接单 2采购中 3配送中 4已完成 9已取消 */
status?: number;
remark?: string;
items?: IStoreOrderItem[];
created_at?: string;
purchase?: {
id: number;
purchase_no: string;
purchase_date: string;
status: number;
}
}
export const STORE_ORDER_STATUS_MAP: Record<number, { text: string; color: string }> = {
0: { text: '待接单', color: 'default' },
1: { text: '已接单', color: 'processing' },
2: { text: '采购中', color: 'warning' },
3: { text: '配送中', color: 'success' },
4: { text: '已完成', color: 'success' },
9: { text: '已取消', color: 'error' },
};