瀏覽代碼

根据url获取nodeType节点类型

吕宣芝 1 年之前
父節點
當前提交
6e5cad92f8
共有 1 個文件被更改,包括 13 次插入2 次删除
  1. 13 2
      src/views/zdsz/engineeringIndustry/index.vue

+ 13 - 2
src/views/zdsz/engineeringIndustry/index.vue

@@ -341,7 +341,6 @@
                 label:'基建工程'
               },
             ],
-            nodeType:'1',               // 节点类型
             // 查询参数
             queryParams: {
               sceneHead:null,           // 现场负责人
@@ -362,6 +361,7 @@
               }
             },
             zEngineeringInfoBo:{
+              nodeType:'',               // 节点类型
               constructAddre:'',        // 施工地址
               constructPhone:'',        // 施工人电话
               constructUser:'',         // 施工人
@@ -459,7 +459,7 @@
             },
             // 节点规则校验
             nodeRules:{
-              type: [
+              nodeType: [
                 { required: true, message: "节点类型不能为空" ,trigger: 'blur'}
               ],
               constructAddre: [
@@ -483,8 +483,19 @@
         },
         created() {
           this.getList();
+          // 根据url获取nodeType节点类型
+          this.getType();
         },
         methods: {
+          // 根据url获取nodeType节点类型
+          getType() {
+            const queryString = window.location.search;
+            const params = new URLSearchParams(queryString);
+            const type = params.get('type');
+            if (type) {
+              this.zEngineeringInfoBo.nodeType = type;
+            }
+          },
           // 新增顶管工程
           addNewPipe(data){
             this.$refs.enginPipe.openDialog({