Преглед изворни кода

新增同步项目信息到节点

duy пре 2 година
родитељ
комит
4ea8052993
2 измењених фајлова са 49 додато и 0 уклоњено
  1. 10 0
      src/api/manager/wbsprivate.js
  2. 39 0
      src/views/manager/projectinfo/tree.vue

+ 10 - 0
src/api/manager/wbsprivate.js

@@ -121,6 +121,16 @@ export const syncNodeTable = (primaryKeyId) => {
     }
   })
 }
+//同步项目基础信息到合同段接口sync-node-info
+export const syncNodeinfo = (primaryKeyId) => {
+  return request({
+    url: '/api/blade-manager/projectInfo/sync-node-info',
+    method: 'post',
+    params: {
+      primaryKeyId
+    }
+  })
+}
 
 
 

+ 39 - 0
src/views/manager/projectinfo/tree.vue

@@ -56,6 +56,14 @@
                               title="同步元素表单"
                             ></i>
                           </el-link>
+                          <el-link :underline="false">
+                            <i
+                              class="el-icon-upload"
+                              style="margin-left: 2px"
+                              @click="syncProjectHandle(data, node)"
+                              title="同步项目信息到合同段"
+                            ></i>
+                          </el-link>
                         </span>
                         <!-- <el-dropdown
                       @click="command=>{setLeftType(command,data)}"
@@ -1611,6 +1619,7 @@ import {
   privateSubmitFullName,
   syncNodeParam,
   syncNodeTable,
+  syncNodeinfo,
   tabTypeLazyTree,
 } from "@/api/manager/wbsprivate";
 import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
@@ -3286,6 +3295,36 @@ export default {
           });
       });
     },
+    syncProjectHandle (data) {
+      this.$confirm("是否同步节点【" + data.title + "】?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        let notify = this.$notify({
+          title: "提示",
+          message: "节点数据同步中...",
+          duration: 0,
+        });
+        syncNodeinfo(data.primaryKeyId)
+          .then(() => {
+            this.updateNodeTable();
+            this.$message({
+              type: "success",
+              message: "同步成功",
+            });
+          })
+          .catch(() => {
+            this.$message({
+              type: "error",
+              message: "同步失败",
+            });
+          })
+          .finally(() => {
+            notify.close();
+          });
+      });
+    },
 
     typeTreeLoadNode(node, resolve) {
       let pid = 0;