feat: Track 网页端已完成/已入库/已出库状态展示与筛选
- ProductCard/ScanPage 徽标改用整体状态,补全宏观状态中文映射 - 产品管理/任务全景/我的任务/看板/WIP分析 状态筛选与徽标区分 - 转入在库显示在库实际操作人;新增已出库/OUTBOUND 状态色
This commit is contained in:
@ -13,6 +13,7 @@ import {
|
||||
getLabelPreview, executePrint,
|
||||
} from "../../services/printApi";
|
||||
import { useToast } from "../../components/ui/Toast";
|
||||
import { getStatusConfig } from "../../constants/task";
|
||||
|
||||
const QR_BASE = "/api/v1/products/qrcode";
|
||||
|
||||
@ -20,6 +21,8 @@ const STATUS_TABS = [
|
||||
{ key: "PENDING", label: "待接收" },
|
||||
{ key: "WIP", label: "进行中" },
|
||||
{ key: "COMPLETED", label: "已完成" },
|
||||
{ key: "ARCHIVED", label: "已入库" },
|
||||
{ key: "OUTBOUND", label: "已出库" },
|
||||
];
|
||||
|
||||
interface ProductGroup { groupKey: string; products: ProductResponse[]; allInWarehouse: boolean; }
|
||||
@ -89,7 +92,8 @@ export default function AdminProductsPage() {
|
||||
}
|
||||
return Array.from(map.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([groupKey, prods]) => ({
|
||||
groupKey, products: prods,
|
||||
allInWarehouse: prods.every(p => p.current_location_id === "virtual_warehouse"),
|
||||
// 已入库 = MOM 已扫码实收 (macro_status==ARCHIVED),而非仅"在仓库位置"
|
||||
allInWarehouse: prods.every(p => (p.macro_status || p.status).toUpperCase() === "ARCHIVED"),
|
||||
}));
|
||||
}, [products, statusFilters, groupBy]);
|
||||
|
||||
@ -233,6 +237,12 @@ export default function AdminProductsPage() {
|
||||
<div className="flex flex-col items-center px-4 pt-5 pb-3">
|
||||
<img src={`${QR_BASE}/${p.serial_number}`} alt={`QR-${p.serial_number}`} className="h-32 w-32 rounded-lg border border-gray-100" loading="lazy" />
|
||||
<p className="mt-3 font-mono text-sm font-bold tracking-wider text-gray-800">{p.serial_number}</p>
|
||||
{(() => {
|
||||
const cfg = getStatusConfig(p.macro_status || p.status);
|
||||
return cfg.label ? (
|
||||
<span className={`mt-1 inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${cfg.bg} ${cfg.text}`}>{cfg.label}</span>
|
||||
) : null;
|
||||
})()}
|
||||
</div>
|
||||
<div className="flex-1 space-y-2 border-t border-gray-50 px-4 py-3">
|
||||
<InfoRow icon={Package} label="物料名称" value={p.material_name || p.material_id || "—"} />
|
||||
|
||||
Reference in New Issue
Block a user