diff --git a/src/views/statistics/bxerp/zhongjian1Total.vue b/src/views/statistics/bxerp/zhongjian1Total.vue
index 75c717a9..086adb24 100644
--- a/src/views/statistics/bxerp/zhongjian1Total.vue
+++ b/src/views/statistics/bxerp/zhongjian1Total.vue
@@ -41,6 +41,8 @@
:query="params"
id="exportDiv"
row-key="id"
+ :summary-method="getSummaries"
+ show-summary
stripe
>
@@ -60,6 +62,11 @@
{{ scope.row.data.中检一_count_use }}
+
+
+ {{ scope.row.data.中检一_count_ok }}
+
+
@@ -356,8 +363,67 @@ export default {
},
getCountQt(data,type){
let count_qt = 0,count = 0;
-
- }
+ },
+ getSummaries({ columns, data }) {
+ const sums = [];
+
+ // 总中检数(作为比率分母)
+ const totalCount = data.reduce((s, item) =>
+ s + Number(item.data['中检一_count_use'] || 0), 0);
+
+ // 数量列:列索引 → data 字段名
+ const countFieldMap = {
+ 5: '中检一_count_use',
+ 6: '中检一_count_ok',
+ 7: '中检一_含缺陷_炸',
+ 9: '中检一_含缺陷_偏',
+ 11: '中检一_含缺陷_掉头',
+ 13: '中检一_含缺陷_台阶划伤',
+ 15: '中检一_含缺陷_柱面划伤',
+ 17: '中检一_含缺陷_台棱',
+ 19: '中检一_含缺陷_台糙',
+ 21: '中检一_含缺陷_尺寸大/小',
+ 23: '中检一_含缺陷_崩',
+ 25: '中检一_含缺陷_修崩/炸',
+ 27: '中检一_含缺陷_拆头',
+ 29: '中检一_含缺陷_外黑',
+ 31: '中检一_含缺陷_外磕',
+ 33: '中检一_含缺陷_打毛/打台',
+ 35: '中检一_含缺陷_喷码',
+ 37: '中检一_含缺陷_掉皮',
+ 39: '中检一_含缺陷_量崩',
+ 41: '中检一_含缺陷_坑',
+ 43: '中检一_count_ok',
+ };
+
+ // 预先求和
+ const sumCache = {};
+ Object.entries(countFieldMap).forEach(([idx, field]) => {
+ sumCache[idx] = data.reduce((s, item) =>
+ s + Number(item.data[field] || 0), 0);
+ });
+
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = 合计
比率
;
+ return;
+ }
+ if (countFieldMap[index] !== undefined) {
+ const sum = sumCache[index];
+ if (index === 5 || index === 6) {
+ // 中检数/合格数:只显示合计
+ sums[index] = {sum}
-
;
+ } else {
+ const ratio = totalCount > 0
+ ? Number(sum / totalCount * 100).toFixed(2)
+ : '0.00';
+ sums[index] = {sum}
{ratio}%
;
+ }
+ }
+ // 比例子列留空,避免重复
+ });
+ return sums;
+ },
},
};