Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

ZaiZai 1 gadu atpakaļ
vecāks
revīzija
379fb43bc2

+ 27 - 6
src/views/project/debit/contract/components/unit/row-data.vue

@@ -132,7 +132,7 @@ import { isNumberReg } from '~uti/tools'
 import AddCheckList from './addCheckList.vue'
 import AddCheckList from './addCheckList.vue'
 import unitApi from '~api/project/debit/contract/unit.js'
 import unitApi from '~api/project/debit/contract/unit.js'
 import { getDictionary } from '~api/other'
 import { getDictionary } from '~api/other'
-import { getArrValue, isArrIndex, isNullES } from 'js-fast-way'
+import { getArrValue, getObjValue, isArrIndex, isNullES } from 'js-fast-way'
 import { delMessageV2 } from '~com/message/index.js'
 import { delMessageV2 } from '~com/message/index.js'
 import BigNumber from 'bignumber.js'
 import BigNumber from 'bignumber.js'
 
 
@@ -329,14 +329,35 @@ const closeDialog = () => {
     isCanSave.value = false
     isCanSave.value = false
 }
 }
 const addCheckListShow = ref(false)
 const addCheckListShow = ref(false)
-const addCheckFinish = (val) => {
+const addCheckFinish = async (val) => {
     addCheckListShow.value = false
     addCheckListShow.value = false
-    val.forEach((ele) => {
-        tableData.value.push(ele)
-    })
     // emit('getDetail', { id: ids.value })
     // emit('getDetail', { id: ids.value })
+    await getTreeNodeDetail({ id: ids.value })
+    for (let i = 0; i < nowTableData.value.length; i++) {
+     for (let index = 0; index < tableData.value.length; index++) {
+        const element = nowTableData.value[i]
+        const element1 = tableData.value[index]
+        if (element.id === element1.id) {
+            nowTableData.value[i] = tableData.value[index]
+        }
+        
+     }
+    }
+    tableData.value = nowTableData.value
+  
+}
+const nowTableData = ref([])
+const getTreeNodeDetail = async ({ id }) => {
+    const { error, code, data } = await unitApi.getNodeDetail({ id })
+    if (!error && code === 200) {
+        curTreeData.value = getObjValue(data)
+        nowTableData.value = curTreeData.value['decompositionList']
+        
+    } else {
+     
+        nowTableData.value = []
+    }
 }
 }
-
 //删除
 //删除
 const delRow = async (row, index) => {
 const delRow = async (row, index) => {
     delMessageV2(async (action, instance, done) => {
     delMessageV2(async (action, instance, done) => {