|
|
|
|
@ -195,7 +195,7 @@
|
|
|
|
|
<el-table-column label="物料名称" prop="materialName" min-width="160" show-overflow-tooltip />
|
|
|
|
|
<el-table-column label="计划数" prop="planAmount" width="100" />
|
|
|
|
|
<el-table-column label="已完数" prop="completeAmount" width="100" />
|
|
|
|
|
<!-- <el-table-column label="剩余数" prop="remainingAmount" width="100" /> -->
|
|
|
|
|
<el-table-column label="剩余数" prop="remainingAmount" width="100" />
|
|
|
|
|
<el-table-column label="完成率" width="160">
|
|
|
|
|
<template #default="pScope">
|
|
|
|
|
<div style="display:flex;align-items:center;justify-content:flex-start;">
|
|
|
|
|
@ -564,7 +564,21 @@ async function onProcessRowExpand(row: any, expanded: boolean) {
|
|
|
|
|
try {
|
|
|
|
|
const res: any = await processPlanList(query);
|
|
|
|
|
const data = (res?.data || res?.rows || res) || [];
|
|
|
|
|
processPlansCache.value[key] = data;
|
|
|
|
|
// 规范化并补充子节点的剩余数与完成率
|
|
|
|
|
const normalized = (Array.isArray(data) ? data : []).map((it: any) => {
|
|
|
|
|
const plan = Number(it?.planAmount ?? it?.planQty ?? it?.planCount ?? 0) || 0;
|
|
|
|
|
const completed = Number(it?.completeAmount ?? it?.completedQty ?? it?.completeQty ?? it?.completedCount ?? 0) || 0;
|
|
|
|
|
const remaining = Math.max(plan - completed, 0);
|
|
|
|
|
const rate = plan > 0 ? Number(((completed * 100.0) / plan).toFixed(2)) : 0;
|
|
|
|
|
return {
|
|
|
|
|
...it,
|
|
|
|
|
planAmount: plan,
|
|
|
|
|
completeAmount: completed,
|
|
|
|
|
remainingAmount: remaining,
|
|
|
|
|
processProgress: rate
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
processPlansCache.value[key] = normalized;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
processPlansCache.value[key] = [];
|
|
|
|
|
} finally {
|
|
|
|
|
|