/** 产品信息卡片 */ import { Package } from "lucide-react"; import type { ProductScanResponse } from "../../types/api"; import { TASK_STATUS } from "../../types/api"; const STATUS_LABELS: Record = { [TASK_STATUS.PENDING]: "待接收", [TASK_STATUS.WIP]: "进行中", [TASK_STATUS.COMPLETED]: "已完成", [TASK_STATUS.REJECTED]: "已驳回", [TASK_STATUS.ARCHIVED]: "已入库", }; function statusColor(status: string): string { switch (status) { case TASK_STATUS.PENDING: return "bg-yellow-100 text-yellow-700"; case TASK_STATUS.WIP: return "bg-blue-100 text-blue-700"; case TASK_STATUS.COMPLETED: return "bg-green-100 text-green-700"; case TASK_STATUS.REJECTED: return "bg-red-100 text-red-700"; default: return "bg-gray-100 text-gray-600"; } } interface ProductCardProps { product: ProductScanResponse; } export default function ProductCard({ product }: ProductCardProps) { return (

产品信息

{STATUS_LABELS[product.status] ?? product.status}
序列号

{product.serial_number}

物料名称

{product.material_name || product.material_id || "—"}

规格型号

{product.spec_model || "—"}

订单编号

{product.order_no || "—"}

{product.current_location_id && (
当前位置

{product.current_location_id === "virtual_warehouse" ? "🏭 仓库" : product.current_location_id}

)}
); }