ZaiZai 1 year ago
parent
commit
a967bcc071
1 changed files with 22 additions and 2 deletions
  1. 22 2
      pages/data-fill/editTable.vue

+ 22 - 2
pages/data-fill/editTable.vue

@@ -24,6 +24,7 @@ import {getStorage} from "@/utils/storage";
 import {useAppStore} from "@/store";
 import wbsApi from '~api/data-fill/wbs';
 import {getFormApiUrl} from '@/config/envApi';
+import api from '~api/api';
 
 const store = useAppStore()
 const instance = getCurrentInstance().proxy
@@ -50,6 +51,7 @@ onLoad((option) => {
         })
         pageNode.value = res
         webSrc.value = `${htmlsrc}&user=${user}&node=${option.node}`
+        queryNodeStatus()
     } else {
         errorToast('参数错误');
         setTimeout(() => {
@@ -120,7 +122,7 @@ const initWebview = async () => {
 }
 
 const isFormRender = ref(false)
-const handleMessage = (event) => {
+const handleMessage = async (event) => {
     let msg = {};
     // #ifdef H5
     if (event.data && event.data.data && event.data.data.arg) {
@@ -141,7 +143,8 @@ const handleMessage = (event) => {
         //保存成功
         if (msg.type === 'saveSuccess') {
             uni.hideLoading();
-            previewClick()
+            await queryNodeStatus()
+            await previewClick()
         }
         //消息提示
         if (msg.type === 'msg') {
@@ -157,6 +160,23 @@ const handleMessage = (event) => {
     }
 }
 
+//当前节点状态, 1 未填报,2待上报,3已上报
+const queryNodeStatus = async () => {
+    const {classify, treeId, status} = pageNode.value
+    let url = `blade-business/informationWriteQuery/${classify === 1?'queryNodeStatus': 'queryNodeStatus-jl'}`;
+    //查询节点状态
+    const { error, code, data } = await api.post({
+        url: url,
+        params: {
+            primaryKeyId: treeId ?? '',
+            classify: classify,
+        }
+    })
+    if (!error && code === 200) {
+        pageNode.value.status = data ?? status
+    }
+}
+
 const toBack = () => {
     webviewShow.value = false
     uni.navigateBack()