洪海涛 4 жил өмнө
parent
commit
b6817363aa

+ 8 - 3
src/store/modules/monthlyReport/edit/index.js

@@ -548,9 +548,14 @@ export default {
       const find = (arr) => {
         arr.forEach(elm => {
           if (elm.title === '线上问题') {
-            // console.log(532, elm, rowData)
-            // console.log(elm.content[0].tableRows, rowData)
-            elm.content[0].tableRows.push(rowData[0])
+            const newQuestion = rowData[0].tableItems[1].value
+            const isQuestion = elm.content[0].tableRows.map(elm => elm.tableItems[1]).filter(
+              elm => elm.value === newQuestion
+            )
+            // 判断数据是否冲突
+            if (!isQuestion.length) {
+              elm.content[0].tableRows.push(rowData[0])
+            }
           }
           if (elm.children && elm.children.length) {
             find(elm.children)