ZaiZai 1 year ago
parent
commit
7b43aa4255
2 changed files with 15 additions and 2 deletions
  1. 6 1
      pages/data-fill/dataTable.vue
  2. 9 1
      pages/ledger/index.vue

+ 6 - 1
pages/data-fill/dataTable.vue

@@ -95,6 +95,7 @@ import { eVisaTaskCheck } from '~api/other/index'
 import api from '~api/api';
 
 const store = useAppStore()
+const isNodes = ref(false)
 
 //初始变量
 const contractInfo = ref(store.contractInfo);
@@ -107,11 +108,14 @@ const appUserValue = ref(['0'])
 onLoad((option) => {
     if (option.node) {
         treeNode.value = JSON.parse(decodeURIComponent(option.node));
+        getTableDataAll();
     }
 })
 
 onShow(() => {
-    getTableDataAll();
+    if (isNodes.value) {
+        getTableDataAll()
+    }
 })
 
 //获取相关数据
@@ -142,6 +146,7 @@ const searchNodeAllTable = async () => {
         })
     })
     appUserList.value = [...userMap.values()]
+    isNodes.value = true
 }
 
 //当前节点状态, 1 未填报,2待上报,3已上报

+ 9 - 1
pages/ledger/index.vue

@@ -47,7 +47,7 @@
 
 <script setup>
 import {ref, getCurrentInstance} from "vue";
-import {onLoad, onReady} from '@dcloudio/uni-app'
+import {onLoad, onReady, onShow} from '@dcloudio/uni-app'
 import mainApi from '~api/ledger/index';
 import {useAppStore} from "@/store";
 import {deepClone, getArrValue, isString} from "js-fast-way";
@@ -56,6 +56,7 @@ import dayjs from "dayjs";
 
 //初始变量
 const store = useAppStore()
+const isNodes = ref(false)
 const instance = getCurrentInstance().proxy
 const contractInfo = ref(store.contractInfo);
 const userInfo = ref(store.userInfo);
@@ -73,6 +74,12 @@ onReady(() => {
     setContentStyle()
 })
 
+onShow(() => {
+    if (isNodes.value) {
+        getDataApi()
+    }
+})
+
 //设置样式
 const bottomStyle = ref({})     // 距离底部
 const setContentStyle = async () => {
@@ -108,6 +115,7 @@ const getDataApi= async () => {
     await queryLogList()
     queryLogTimeTreeList().then()
     getSubmitLogDateList().then()
+    isNodes.value = true
 }
 
 //获取tab数据