Browse Source

统计优化

xgb 1 tháng trước cách đây
mục cha
commit
9f00d27881
1 tập tin đã thay đổi với 12 bổ sung12 xóa
  1. 12 12
      src/views/hisStore/components/OrderSummaryTableNew.vue

+ 12 - 12
src/views/hisStore/components/OrderSummaryTableNew.vue

@@ -8,7 +8,6 @@
       stripe
       style="width: 100%; margin-top: 20px;"
       :span-method="objectSpanMethod"
-      show-summary
 
       height="500"
       >
@@ -115,8 +114,7 @@ export default {
       tableKey: 0
     }
   },
-  computed: {
-    // 添加处理后的数据计算属性
+ computed: {
     processedTableData() {
       if (!this.tableData || this.tableData.length === 0) {
         return [];
@@ -128,7 +126,7 @@ export default {
       
       // 分组数据
       this.tableData.forEach(item => {
-        const deptName = item.groupName || '未分配部门';
+        const deptName = item.deptName || item.groupName || '未分配部门';
         if (!deptMap.has(deptName)) {
           deptMap.set(deptName, []);
         }
@@ -137,11 +135,11 @@ export default {
       
       // 构建展示数据
       for (const [deptName, employees] of deptMap) {
-        // 部门标题行
+        // 部门标题行 - 确保只有 name 字段有值,其他字段为空
         result.push({
           name: deptName,
           isGroup: true,
-          isDeptTitle: true
+          isDeptTitle: true,
         });
         
         // 员工数据行
@@ -162,17 +160,19 @@ export default {
     }
   },
   methods: {
-    // 添加表格合并方法
+// 修改表格合并方法
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       // 部门标题行合并
       if (row.isDeptTitle) {
         if (columnIndex === 0) {
-          // 第一列显示部门名称,合并所有列
-          const totalColumns = 24;
-          return [1, totalColumns];
+          // 第一列显示部门名称
+          return [1, 1];
         } else {
-          // 其他列不显示
-          return [0, 0];
+          // 其他列不显示内容(保持空白)
+          return {
+            rowspan: 0,
+            colspan: 0
+          };
         }
       }