qinhouyu 1 年之前
父节点
当前提交
1a8c45848a
共有 3 个文件被更改,包括 40 次插入28 次删除
  1. 0 9
      src/api/zdsz/obs.js
  2. 5 4
      src/components/EngineeNode/index.vue
  3. 35 15
      src/components/EngineePipe/index.vue

+ 0 - 9
src/api/zdsz/obs.js

@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
-export function picDel(data) {
-  return request({
-    url: `/zdsz/engiineeringPhoto/url`,
-    method: 'delete',
-    params:data
-  })
-}

+ 5 - 4
src/components/EngineeNode/index.vue

@@ -350,7 +350,7 @@ export default {
                 });
                 return false
               }
-            }) 
+            })
           });
           return p;
         },
@@ -364,7 +364,7 @@ export default {
             // todo: 将当前tab页所选节点信息录入
             this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
             // console.log('_______',this.zEngineeringInfoBo)
-          
+
           }else{
             // todo: 校验当前表单
             this.$refs.nodeForm.validate(e => {
@@ -436,6 +436,7 @@ export default {
             this.nodeType=null
             this.reset()
             this.nodeDetailVisible = false
+            this.$emit('files',true)
         },
         created() {
             this.params = this.queryParams
@@ -630,7 +631,7 @@ export default {
         },
         open(queryParams,type = null,nodeOptions = []){
             this.formType = false
-            this.nodeList = [] 
+            this.nodeList = []
             this.currentNode = []
             this.zEngineeringNodeBoList = []
             console.log(queryParams)
@@ -687,7 +688,7 @@ export default {
               this.tabsModel = nodeOptions[0].name
               console.log('当前工程所有节点',this.nodeList)
             }
-            
+
             // end
             this.currentType = type
             console.log(this.queryParams)

+ 35 - 15
src/components/EngineePipe/index.vue

@@ -110,6 +110,7 @@
     <!-- 节点信息dialog -->
     <enginee-node
       @closeToSucceed="closeToSucceed"
+      @files="getFiles"
       ref="childNode"
     />
   </div>
@@ -163,8 +164,7 @@ export default {
         enginCode: '',       // 工程编码
         constructQuality: '',      // 施工质量
         constructSchedule: "",       // 施工进度
-        type: null,                // 类型  01工业工程 02市政工程
-        enginType: '',             // 工程类型  民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
+        type: null,                // 类型
         remark: '',                // 备注
         constructUnit: null,
         zEngineeringNodeBo: {
@@ -228,6 +228,11 @@ export default {
         remark: [
           {required: false, message: "备注不能为空", trigger: "blur"}
         ],
+        files: [
+          { required: false, message: '必须上传文件!', trigger: 'change' },
+        ]
+
+
       },
       currentType: null, // 组件类型 put修改 add新增
     };
@@ -257,7 +262,13 @@ export default {
       this.open = false
       this.nodeDetailVisible = false
     },
-    openDialog(data, type) {
+    getFiles(flag){
+      if (flag){
+        this.$refs.obsFileUpload.fileList=this.queryParams.files
+      }
+    },
+    async openDialog(data, type) {
+      await this.reset();
       this.currentType = type
       if (this.currentType == 'add') {
         this.title = '新增顶管信息'
@@ -272,19 +283,27 @@ export default {
       this.nodeDetailVisible = false
     },
     toNodeDetail() {
-      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)
+      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)
+            }
+          })
         }
-      })
+      });
     },
     // 取消按钮
     cancel() {
@@ -299,6 +318,7 @@ export default {
       // })
       this.resetForm("form");
       this.resetForm("nodeForm");
+      this.queryParams.files=[]
     },
     /** 提交按钮 */
     submitForm() {