qinhouyu 1 anno fa
parent
commit
5a55d2ec0f

+ 29 - 49
src/components/EngineePipe/index.vue

@@ -357,7 +357,6 @@ export default {
       }
     },
     async openDialog(data, type,sata) {
-      console.log(data,sata)
       await this.reset();
       this.currentType = type
       if (this.currentType == 'add') {
@@ -366,10 +365,8 @@ export default {
         this.title = '修改顶管信息'
       } else if (this.currentType == 'addMaterial') {
         this.title = '添加用料'
-        this.enginNodeStatus == '添加用料'
+        this.enginNodeStatus = '添加用料'
         this.queryParams = sata
-        this.open = true
-        return
       }
       this.queryParams.enginId = data.id
       this.queryParams.type = data.type
@@ -410,12 +407,10 @@ export default {
         }})
     },
     toNodeDetail() {
-      console.log(this.queryParams)
       let nodeCollection = []
       // 收集节点信息
       this.currentCheckList.forEach((e, idx) => {
         let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
-        //  console.log(nodeItem)
         nodeCollection.push(nodeItem)
       })
       this.queryParams.zEngineeringNodeBoList = nodeCollection
@@ -434,11 +429,12 @@ export default {
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.currentCheckList = []
-                // this.getList();
+                this.getList();
               })
             }
           }})
-      } else if(this.enginNodeStatus == '添加用料'){
+      }
+      else if(this.enginNodeStatus == '添加用料'){
         addEngineeringPipeJacking(this.queryParams).then(res => {
           if(res.code == 200){
             this.$message({
@@ -452,47 +448,30 @@ export default {
             // this.$emit('closeToSucceed')
           }
         })
-      } else {
-        this.queryParams.files = this.$refs.obsFileUpload.fileList;
-        if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
-          this.$message.warning('必须上传文件!')
-          return
-        }
-        addEngineeringPipeJacking(this.queryParams).then(res => {
-          if (res.code == 200) {
-            this.$message({
-              message: '新增成功',
-              type: 'success'
-            });
-            this.open = false
-            console.log('选中节点集合', this.currentCheckList)
-            this.currentCheckList = []
-            // this.$emit('closeToSucceed')
-          }
-        })
-      }
-      return
-      if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
-        this.$message.warning('必须上传文件!')
-        return
       }
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          getDictList({enginType:['pipe_jack']}).then(res => {
-            this.nodeList = res.data
-            this.nodeList.forEach(e => {
-              e.name = e.value
-            })
-            if (this.currentType == 'put') {
-              this.queryParams.files = this.$refs.obsFileUpload.fileList;
-              this.$refs.childNode.open(this.queryParams, 15,this.nodeList)
-            } else if (this.currentType == 'add') {
-              this.queryParams.files = this.$refs.obsFileUpload.fileList;
-              this.$refs.childNode.open(this.queryParams, 10,this.nodeList)
+      else {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            this.queryParams.files = this.$refs.obsFileUpload.fileList;
+            if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
+              this.$message.warning('必须上传文件!')
+              return
             }
-          })
-        }
-      });
+            addEngineeringPipeJacking(this.queryParams).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '新增成功',
+                  type: 'success'
+                });
+                this.open = false
+                console.log('选中节点集合', this.currentCheckList)
+                this.currentCheckList = []
+                this.getList()
+                // this.$emit('closeToSucceed')
+              }
+            })
+          }})
+      }
     },
     // 取消按钮
     cancel() {
@@ -501,8 +480,9 @@ export default {
     },
     // 表单重置
     reset() {
-      this.resetForm("form");
-      this.resetForm("nodeForm");
+      for (let formKey in this.form) {
+        this.form[formKey] = null
+      }
     },
     /** 提交按钮 */
     submitForm() {

+ 1 - 1
src/views/zdsz/engineeringPipeJacking/index.vue

@@ -547,10 +547,10 @@
           },
           // 新增物料
           addMaterial(data) {
+            this.reset();
             this.title = "添加用料";
             this.enginNodeStatus = '添加用料'
             this.loading = true;
-            this.reset();
             const id = data.id || this.ids
             viewEngineeringPipeJacking(id).then(res => {
               this.loading = false;