diff --git a/src/views/plan/RealTimeInventory.vue b/src/views/plan/RealTimeInventory.vue index 3b3d252..5f3ddb5 100644 --- a/src/views/plan/RealTimeInventory.vue +++ b/src/views/plan/RealTimeInventory.vue @@ -396,16 +396,25 @@ const formatWireDisc = (wireDisc) => { // 方法:根据wight_completion获取完成度状态 const getCompletionStatus = (wight_completion) => { - if (wight_completion > 0) { - // 有进度时根据具体数值计算填充百分比 - let percentage = 25; // 默认25% - if (wight_completion >= 100) percentage = 100; - else if (wight_completion >= 75) percentage = 75; - else if (wight_completion >= 25) percentage = 25; - - return { percentage, color: '#67C23A' }; // 绿色 + if (wight_completion <= 0) { + return { percentage: 0, color: '#C0C4CC' }; // 灰色(无进度) } - return { percentage: 0, color: '#C0C4CC' }; // 灰色(无进度) + + // 根据具体百分比计算填充百分比 + let percentage = 0; + if (wight_completion >= 100) { + percentage = 100; // 100%完成 + } else if (wight_completion >= 75) { + percentage = 75; // 3/4完成 + } else if (wight_completion >= 50) { + percentage = 50; // 1/2完成 + } else if (wight_completion >= 25) { + percentage = 25; // 1/4完成 + } else { + percentage = Math.max(10, Math.floor(wight_completion / 2.5) * 2.5); // 最小10%,按2.5%递增 + } + + return { percentage, color: '#67C23A' }; // 绿色 }; // 方法:获取生产状态指示器 @@ -418,7 +427,7 @@ const getProductionStatusIndicator = (specification, columnProp) => { } const status = uidProductionStatusMap.value.get(keyWithSpec); - return getCompletionStatus(status.wight_completion); + return getCompletionStatus(status.wight_completion/100); }; // 方法:获取生产状态标题 @@ -431,7 +440,7 @@ const getProductionStatusTitle = (specification, columnProp) => { } const status = uidProductionStatusMap.value.get(keyWithSpec); - return `重量完成度: ${status.wight_completion.toFixed(2)}%`; + return `重量完成度: ${status.wight_completion.toFixed(2)/100}%`; }; // 方法:刷新数据