|
|
@@ -279,7 +279,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="station" label="场站" align="center"></el-table-column>
|
|
|
- <el-table-column prop="finalScore" label="工分" width="80" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="finalScore" label="工分" width="80" align="center" :formatter="formatScore"></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -430,17 +430,13 @@ export default {
|
|
|
this.applyFilter();
|
|
|
},
|
|
|
formatScore(row, column, cellValue) {
|
|
|
- if (cellValue == null || cellValue === '') return '--'; // 处理空值
|
|
|
+ if (cellValue == null || cellValue === '') return '0.00'; // 处理空值
|
|
|
return parseFloat(cellValue).toFixed(2); // 保留两位小数
|
|
|
},
|
|
|
// 格式化工时和工分显示,0显示为0,小数位超过两位时四舍五入
|
|
|
formatWorkValue(value) {
|
|
|
- if (value == null || value === '') return '--'; // 处理空值
|
|
|
- const num = parseFloat(value);
|
|
|
- // 四舍五入保留两位小数
|
|
|
- const rounded = num.toFixed(2);
|
|
|
- // 去掉不必要的末尾0
|
|
|
- return parseFloat(rounded).toString();
|
|
|
+ if (value == null || value === '') return '0.00'; // 处理空值
|
|
|
+ return parseFloat(value).toFixed(2);
|
|
|
},
|
|
|
// 加载首页统计数据
|
|
|
loadHomePageData() {
|