feat: Track 网页端已完成/已入库/已出库状态展示与筛选

- ProductCard/ScanPage 徽标改用整体状态,补全宏观状态中文映射
- 产品管理/任务全景/我的任务/看板/WIP分析 状态筛选与徽标区分
- 转入在库显示在库实际操作人;新增已出库/OUTBOUND 状态色
This commit is contained in:
2026-09-01 13:53:30 +08:00
parent 73faa1fd93
commit 6cb7731cbb
10 changed files with 122 additions and 16 deletions

View File

@ -24,6 +24,8 @@ const STATUS_TABS = [
{ key: "PENDING", label: "待接收" },
{ key: "WIP", label: "进行中" },
{ key: "COMPLETED", label: "已完成" },
{ key: "ARCHIVED", label: "已入库" },
{ key: "OUTBOUND", label: "已出库" },
];
type SortOrder = "asc" | "desc";
@ -44,6 +46,7 @@ interface OrderGroup {
orderNo: string;
products: ProductResponse[];
allInWarehouse: boolean;
allCompleted: boolean;
}
/** 滞留时长格式化:小时 → 天/小时/分钟 */
@ -102,18 +105,20 @@ export default function AdminTasksPage() {
render: (p) => <div className="text-xs text-gray-500 truncate">{p.spec_model || p.material_name || p.material_id || "—"}</div>,
},
{
key: "overall_status", label: "宏观状态", colSpan: 1,
key: "overall_status", label: "当前工序", colSpan: 1,
filterType: "enum", getFilterValue: (p) => p.overall_status || "—",
enumOptions: ["备货", "生产", "测试", "维修", "在库"].map((v) => ({ value: v, label: v })),
enumOptions: ["备货", "生产", "测试", "维修", "在库", "待仓库收货", "已入库", "已出库"].map((v) => ({ value: v, label: v })),
render: (p) => <span className="text-xs font-medium text-gray-700">{p.overall_status || "—"}</span>,
},
{
key: "status", label: "任务状态", colSpan: 1,
key: "status", label: "产品状态", colSpan: 1,
filterType: "enum", getFilterValue: (p) => (p.macro_status || p.status).toUpperCase(),
enumOptions: [
{ value: "PENDING", label: "待接收" },
{ value: "WIP", label: "进行中" },
{ value: "COMPLETED", label: "已完成" },
{ value: "ARCHIVED", label: "已入库" },
{ value: "OUTBOUND", label: "已出库" },
],
render: (p) => {
const statusCfg = getStatusConfig(p.macro_status || p.status);
@ -292,8 +297,12 @@ export default function AdminTasksPage() {
return {
orderNo,
products: sorted,
// 已入库 = MOM 已扫码实收 (macro_status==ARCHIVED),而非仅"在仓库位置"
allInWarehouse: prods.every(
(p) => p.current_location_id === "virtual_warehouse"
(p) => (p.macro_status || p.status).toUpperCase() === "ARCHIVED"
),
allCompleted: prods.every(
(p) => (p.macro_status || p.status).toUpperCase() === "COMPLETED"
),
};
});
@ -683,7 +692,13 @@ export default function AdminTasksPage() {
已全部入库
</span>
)}
{!group.allInWarehouse && (
{group.allCompleted && !group.allInWarehouse && group.products.length > 0 && (
<span className="inline-flex items-center gap-1 rounded-full bg-orange-50 px-2.5 py-0.5 text-xs font-medium text-orange-600">
<Warehouse className="h-3 w-3" />
已完工待入库
</span>
)}
{!group.allInWarehouse && !group.allCompleted && (
<span className="text-xs text-gray-400">流转中</span>
)}
</button>