Ver código fonte

修改详情得分情况最后一列合并规则

zhangliang2 2 anos atrás
pai
commit
d0f3db5499
1 arquivos alterados com 110 adições e 9 exclusões
  1. 110 9
      src/views/workManagement/evaluationReport.vue

+ 110 - 9
src/views/workManagement/evaluationReport.vue

@@ -301,7 +301,8 @@ export default {
             }
         },
         arraySpanMethodA({ row, column, rowIndex, columnIndex }) {
-            if (columnIndex === 0 || columnIndex === this.columnsC.length - 1) {
+            // if (columnIndex === 0 || columnIndex === this.columnsC.length - 1) {
+            if (columnIndex === 0) {
                 if (this.subIndexArrA[0].includes(rowIndex)) {
                     return [
                         this.sublistNameObjA[0][row.sublistName1 + rowIndex],
@@ -363,16 +364,115 @@ export default {
                     }
                 }
             } else if (columnIndex === 5) {
-                if (this.subIndexArrA[5].includes(rowIndex)) {
-                    return [
-                        this.sublistNameObjA[5][row.sublistName6 + rowIndex],
-                        1,
-                    ];
-                } else {
-                    if (row.sublistName6) {
+                // 说明只有一级指标
+                if (columnIndex === this.info.length - 1) {
+                    if (this.subIndexArrA[0].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[0][
+                                row.sublistName1 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
                         return [0, 0];
+                    }
+                } else {
+                    if (this.subIndexArrA[5].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[5][
+                                row.sublistName6 + rowIndex
+                            ],
+                            1,
+                        ];
                     } else {
-                        return [1, 1];
+                        if (row.sublistName6) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
+                    }
+                }
+            } else if (columnIndex === this.columnsC.length - 1) {
+                // 说明至少有二级指标
+                if (this.info.maxIndex === 2) {
+                    // 只到二级
+                    if (this.subIndexArrA[1].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[1][
+                                row.sublistName2 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
+                        if (row.sublistName2) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
+                    }
+                } else if (this.info.maxIndex === 3) {
+                    // 只到三级
+                    if (this.subIndexArrA[2].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[2][
+                                row.sublistName3 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
+                        if (row.sublistName3) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
+                    }
+                } else if (this.info.maxIndex === 4) {
+                    // 只到四级
+                    if (this.subIndexArrA[3].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[3][
+                                row.sublistName4 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
+                        if (row.sublistName4) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
+                    }
+                } else if (this.info.maxIndex === 5) {
+                    // 只到五级
+                    if (this.subIndexArrA[4].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[4][
+                                row.sublistName5 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
+                        if (row.sublistName5) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
+                    }
+                } else if (this.info.maxIndex === 6) {
+                    // 到六级
+                    if (this.subIndexArrA[5].includes(rowIndex)) {
+                        return [
+                            this.sublistNameObjA[5][
+                                row.sublistName6 + rowIndex
+                            ],
+                            1,
+                        ];
+                    } else {
+                        if (row.sublistName6) {
+                            return [0, 0];
+                        } else {
+                            return [1, 1];
+                        }
                     }
                 }
             }
@@ -570,6 +670,7 @@ export default {
                         this.columnsC = res.info.sceneScoreLiTitle;
                         this.dataHandle(res.info.sceneScoreLi, 2);
                         this.getDataWayC.data = res.info.sceneScoreLi;
+                        console.log(this.getDataWayC.data);
                     } else {
                         this.$message.error(res.message || "获取信息失败");
                     }