Bläddra i källkod

民用顶管批量新增

付宇航 1 år sedan
förälder
incheckning
5c6c8f2f54

+ 139 - 66
src/components/EngineeNode/index.vue

@@ -68,22 +68,23 @@
                 </el-select>
               </el-form-item> -->
             <el-form-item label="施工地址" prop="constructAddre">
-            <el-input v-model="zEngineeringInfoBo.constructAddre" placeholder="请填写施工地址"></el-input>
+            <el-input v-model="zEngineeringInfoBo.constructAddre" placeholder="请填写施工地址" :disabled="formType"></el-input>
             </el-form-item>
             <el-form-item label="施工人电话" prop="constructPhone">
-            <el-input v-model="zEngineeringInfoBo.constructPhone" placeholder="请填写施工人电话"></el-input>
+            <el-input v-model="zEngineeringInfoBo.constructPhone" placeholder="请填写施工人电话" :disabled="formType"></el-input>
             </el-form-item>
             <el-form-item label="施工人" prop="constructUser">
-            <el-input v-model="zEngineeringInfoBo.constructUser" placeholder="请填写施工人"></el-input>
+            <el-input v-model="zEngineeringInfoBo.constructUser" placeholder="请填写施工人" :disabled="formType"></el-input>
             </el-form-item>
             <!-- <el-form-item label="负责人" prop="headName">
             <el-input v-model="zEngineeringInfoBo.headName" placeholder="请填写负责人"></el-input>
             </el-form-item> -->
             <el-form-item label="负责人电话" prop="headPhone">
-            <el-input v-model="zEngineeringInfoBo.headPhone" placeholder="请填写负责人电话"></el-input>
+            <el-input v-model="zEngineeringInfoBo.headPhone" placeholder="请填写负责人电话" :disabled="formType"></el-input>
             </el-form-item>
             <el-form-item label="回填时间" prop="backfillTime">
             <el-date-picker
+                :disabled="formType"
                 v-model="zEngineeringInfoBo.backfillTime"
                 value-format="yyyy-MM-dd hh:mm:ss"
                 type="datetime"
@@ -92,6 +93,7 @@
             </el-form-item>
             <el-form-item label="施工时间" prop="constructTime">
             <el-date-picker
+                :disabled="formType"
                 v-model="zEngineeringInfoBo.constructTime"
                 value-format="yyyy-MM-dd hh:mm:ss"
                 type="datetime"
@@ -99,7 +101,7 @@
             </el-date-picker>
             </el-form-item>
             <el-form-item label="是否按图纸施工" prop="constructAccordingDrawings">
-            <el-select v-model="zEngineeringInfoBo.constructAccordingDrawings">
+            <el-select v-model="zEngineeringInfoBo.constructAccordingDrawings" :disabled="formType">
                 <el-option
                 v-for="e in constructAccordingDrawingsOption"
                 :key="e.value"
@@ -109,7 +111,7 @@
             </el-select>
             </el-form-item>
             <el-form-item label="分段打压" prop="segmentedCompressionQualified">
-            <el-select v-model="zEngineeringInfoBo.segmentedCompressionQualified">
+            <el-select v-model="zEngineeringInfoBo.segmentedCompressionQualified" :disabled="formType">
                 <el-option
                 v-for="e in segmentedCompressionQualifiedOption"
                 :key="e.value"
@@ -320,7 +322,8 @@ export default {
             zEngineeringNodeBoList:[
 
             ],                            // 节点信息大集合
-            tabsModel:""
+            tabsModel:"",
+            formType:false
           }
     },
     created(){
@@ -329,6 +332,8 @@ export default {
     },
     methods:{
         confirmLeave(){
+          console.log(this.zEngineeringNodeBoList)
+          if(this.currentType == '16') return true
           let p = new Promise((resolve, reject) => {
             this.$refs.nodeForm.validate(e => {
               e ? resolve() : reject();
@@ -351,32 +356,43 @@ export default {
         },
         nodeHasChanged(el){
           if(el.label == this.beforeNodeName ) return
-          // todo: 校验当前表单
-          this.$refs.nodeForm.validate(e => {
-            if(e){
-              this.$message({
-                message: '保存成功',
-                type: 'sucess'
-              });
-              // todo: 将当前的节点信息录入到大集合中
-              if(this.beforeNodeName != null){
-                const beforeNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => this.beforeNodeName == e.name)
-                this.zEngineeringNodeBoList[beforeNodeInfoIndex].zEngineeringInfoBo = this.zEngineeringInfoBo
+          if(this.currentType == '16'){
+            // console.log('_______',currentNodeInfo)
+            // this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
+            const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
+            const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
+            // todo: 将当前tab页所选节点信息录入
+            this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
+            // console.log('_______',this.zEngineeringInfoBo)
+          
+          }else{
+            // todo: 校验当前表单
+            this.$refs.nodeForm.validate(e => {
+              if(e){
+                this.$message({
+                  message: '保存成功',
+                  type: 'sucess'
+                });
+                // todo: 将当前的节点信息录入到大集合中
+                if(this.beforeNodeName != null){
+                  const beforeNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => this.beforeNodeName == e.name)
+                  this.zEngineeringNodeBoList[beforeNodeInfoIndex].zEngineeringInfoBo = this.zEngineeringInfoBo
+                }
+                // end
+                const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
+                const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
+                // todo: 将当前tab页所选节点信息录入
+                this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
+                this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
+                console.log('节点信息大集合',this.zEngineeringNodeBoList)
+              }else{
+                this.$message({
+                  message: '请完善当前节点信息',
+                  type: 'warning'
+                });
               }
-              // end
-              const currentNodeInfo = this.zEngineeringNodeBoList.find(e => el.label == e.name)
-              const currentNodeInfoIndex = this.zEngineeringNodeBoList.findIndex(e => el.label == e.name)
-              // todo: 将当前tab页所选节点信息录入
-              this.zEngineeringInfoBo = currentNodeInfo.zEngineeringInfoBo
-              this.beforeNodeName = this.zEngineeringNodeBoList[currentNodeInfoIndex].name
-              console.log('节点信息大集合',this.zEngineeringNodeBoList)
-            }else{
-              this.$message({
-                message: '请完善当前节点信息',
-                type: 'warning'
-              });
-            }
-          })
+            })
+          }
 
           return
           // 拿到当前所选择的节点info
@@ -502,8 +518,33 @@ export default {
                         break;
                         case 10 :
                             // 顶管新增
-                            this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
-                          debugger
+                          //   this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+                          // debugger
+                          //   addEngineeringPipeJacking(this.params).then(res => {
+                          //     if(res.code == 200){
+                          //       this.$message({
+                          //         message: '新增成功',
+                          //         type: 'success'
+                          //       });
+                          //       this.$emit('closeToSucceed')
+                          //       this.nodeDetailVisible = false
+                          //     }
+                          //   })
+
+
+                          // 民用工程 新增
+                          console.log('节点信息大集合',this.zEngineeringNodeBoList)
+                            console.log('节点option',this.nodeList)
+                            // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+                            this.params.zEngineeringNodeBoList = []
+                            this.zEngineeringNodeBoList.forEach(e => {
+                              this.params.zEngineeringNodeBoList.push({
+                                type:e.type,
+                                zEngineeringInfoBo:e.zEngineeringInfoBo
+                              })
+                            })
+                            this.params.enginType = this.nodeList[0].enginType
+                            this.params.enginClassification = this.nodeList[0].enginClassification
                             addEngineeringPipeJacking(this.params).then(res => {
                               if(res.code == 200){
                                 this.$message({
@@ -588,33 +629,65 @@ export default {
             // });
         },
         open(queryParams,type = null,nodeOptions = []){
-            // this.nodeList = [] 
-            this.nodeList = nodeOptions // 节点初始化
-            console.log('节点option',this.nodeList)
+            this.formType = false
+            this.nodeList = [] 
             this.currentNode = []
-            this.currentNode.push(nodeOptions[0].name)        // tab页默认选中第一条节点
-            console.log(nodeOptions[0])
-            this.beforeNodeName = nodeOptions[0].name
-            this.zEngineeringNodeBoList.push({
-              type:nodeOptions[0].value,
-              validateFlag:null,                   // 校验当前集合是否通过标识
-              name:nodeOptions[0].name,            // 节点完整名称
-              zEngineeringInfoBo:{
-                constructAddre:'',                 // 施工地址
-                constructPhone:'',                 // 施工人电话
-                constructUser:'',                  // 施工人
-                headName:'',                       // 负责人
-                headPhone:'',                      // 负责人电话
-                constructAccordingDrawings:'',     // 是否按图纸施工
-                segmentedCompressionQualified:'',  // 分段打压是否合格
-                backfillTime:'',                   // 回填时间
-                constructTime:'',                  // 施工时间
-                zEngiineeringPhotoBoList:[],              // 图片列表
-                zEngineeringMaterialBo:[],         // 用料对象
-              }
-            })
-            this.tabsModel = nodeOptions[0].name
-            console.log('当前工程所有节点',this.nodeList)
+            this.zEngineeringNodeBoList = []
+            console.log(queryParams)
+            console.log(nodeOptions)
+            if(type == 16){
+              this.formType = true
+              this.nodeList = nodeOptions // 节点初始化
+              queryParams.zEngineeringNodeBoList.forEach(e => {
+                // todo: 取出已添加节点回显
+                let currentNodeName = nodeOptions.find(i => i.label == e.type).name
+                let currentNodeValue = nodeOptions.find(i => i.label == e.type).value
+                e.name = currentNodeName
+                this.currentNode.push(currentNodeName)
+                // 回显当前已添加节点
+                console.log(e)
+                // this.zEngineeringNodeBoList.push(e.zEngineeringInfoBoList[0])
+                this.zEngineeringNodeBoList.push({
+                  type:currentNodeValue,
+                  validateFlag:null,                                                  // 校验当前集合是否通过标识
+                  name:e.name,                                                        // 节点完整名称
+                  zEngineeringInfoBo:e.zEngineeringInfoBoList[0]
+                })
+              })
+              console.log('修改——————————',this.zEngineeringNodeBoList)
+              // 当前tab页签所选中得节点
+              this.tabsModel = nodeOptions[0].name
+              // 记录当前节点页签
+              this.beforeNodeName = this.currentNode[0]
+              this.zEngineeringInfoBo = this.zEngineeringNodeBoList[0].zEngineeringInfoBo
+            }else{
+              this.nodeList = nodeOptions // 节点初始化
+              console.log('节点option',this.nodeList)
+              this.currentNode.push(nodeOptions[0].name)        // tab页默认选中第一条节点
+              console.log(nodeOptions[0])
+              this.beforeNodeName = nodeOptions[0].name
+              this.zEngineeringNodeBoList.push({
+                type:nodeOptions[0].value,
+                validateFlag:null,                   // 校验当前集合是否通过标识
+                name:nodeOptions[0].name,            // 节点完整名称
+                zEngineeringInfoBo:{
+                  constructAddre:'',                 // 施工地址
+                  constructPhone:'',                 // 施工人电话
+                  constructUser:'',                  // 施工人
+                  headName:'',                       // 负责人
+                  headPhone:'',                      // 负责人电话
+                  constructAccordingDrawings:'',     // 是否按图纸施工
+                  segmentedCompressionQualified:'',  // 分段打压是否合格
+                  backfillTime:'',                   // 回填时间
+                  constructTime:'',                  // 施工时间
+                  zEngiineeringPhotoBoList:[],              // 图片列表
+                  zEngineeringMaterialBo:[],         // 用料对象
+                }
+              })
+              this.tabsModel = nodeOptions[0].name
+              console.log('当前工程所有节点',this.nodeList)
+            }
+            
             // end
             this.currentType = type
             console.log(this.queryParams)
@@ -625,12 +698,12 @@ export default {
             this.params = queryParams
             console.log('111',this.params)
             this.nodeDetailVisible = true
-            if(type == 15){
-              this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
-            }
-            if(type == 16){
-              this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
-            }
+            // if(type == 15){
+            //   this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
+            // }
+            // if(type == 16){
+            //   this.zEngineeringInfoBo = this.params.zEngineeringNodeBo.zEngineeringInfoBo
+            // }
             if(type == 14){
               this.zEngineeringInfoBo = this.params.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
             }

+ 20 - 12
src/components/EngineePipe/index.vue

@@ -120,6 +120,7 @@ import {getComprehensive, delComprehensive} from "@/api/zdsz/comprehensive";
 import {
   getEngineeList,                            // 查询工程列表
   addEnginee,                                // 新增工程
+  getDictList
 } from "@/api/zdsz/enginee"
 import EngineeNode from '@/components/EngineeNode/index'  // 节点信息
 
@@ -237,11 +238,11 @@ export default {
     async putEnginPipe(data, type) {
       await this.reset();
       let newData = data
-      let zEngineeringNodeBo = {
-        type: data.zengineeringNodeBoList[0].type,
-        zEngineeringInfoBo: data.zengineeringNodeBoList[0].zEngineeringInfoBoList[0]
-      }
-      newData.zEngineeringNodeBo = zEngineeringNodeBo
+      // let zEngineeringNodeBo = {
+      //   type: data.zEngineeringNodeBoList[0].type,
+      //   zEngineeringInfoBo: data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
+      // }
+      // newData.zEngineeringNodeBo = zEngineeringNodeBo
       this.currentType = type
       if (this.currentType=='put'){
         this.title = '修改顶管信息'
@@ -270,13 +271,20 @@ export default {
       this.nodeDetailVisible = false
     },
     toNodeDetail() {
-      if (this.currentType == 'put') {
-        this.queryParams.files = this.$refs.obsFileUpload.fileList
-        this.$refs.childNode.open(this.queryParams, 15)
-      } else if (this.currentType == 'add') {
-        this.queryParams.files = this.$refs.obsFileUpload.fileList
-        this.$refs.childNode.open(this.queryParams, 10)
-      }
+      getDictList({enginType:['pipe_jack']}).then(res => {
+        this.nodeList = res.data
+        this.nodeList.forEach(e => {
+          e.name = e.value
+        })
+        console.log('顶管节点',this.nodeList)
+        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() {

+ 11 - 8
src/views/zdsz/engineeringCivil/index.vue

@@ -544,7 +544,7 @@ export default {
     addNewPipe(data) {
       this.$refs.enginPipe.openDialog({
         id: data.id,
-        type: this.form.zEngineeringNodeBo.type
+        type: '民用工程'
       }, 'add')
     },
     currentEnginTypeChange(val){
@@ -696,20 +696,21 @@ export default {
       this.multiple = !selection.length
     },
     // 新增顶管工程
-    addNewPipe(data){
-      this.$refs.enginPipe.openDialog({
-        id:data.id
-      },'add')
-    },
+    // addNewPipe(data){
+    //   this.$refs.enginPipe.openDialog({
+    //     id:data.id
+    //   },'add')
+    // },
     nodeCancel(){
       this.nodeDetailVisible = false
     },
     toNodeDetail(){
       getDictList({enginType:['new_built','old_renovation']}).then(res => {
         this.nodeList = res.data
-
+        console.log('跳到详情前的queryParams',this.queryParams)
+        console.log('跳到详情前的节点集合',this.nodeList)
         if(this.currentType == 'put'){
-          this.$refs.childNode.open(this.queryParams,16)
+          this.$refs.childNode.open(this.queryParams,16,this.nodeList)
           this.currentType = null
           return
         }
@@ -720,6 +721,7 @@ export default {
         // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
         // this.queryParams.enginClassification = result
         // console.log(this.queryParams)
+        console.log('新增queryparams传值',this.queryParams)
         this.$refs.childNode.open(this.queryParams,0,this.nodeList)
         return
         this.$refs['form'].validate(e => {
@@ -782,6 +784,7 @@ export default {
         newData.zEngineeringNodeBo = zEngineeringNodeBo
         this.currentType = 'put'
         this.queryParams = newData
+        console.log('修改queryparams传值',this.queryParams)
         console.log(this.queryParams)
         this.zEngineeringInfoBo = newData.zEngineeringNodeBo.zEngineeringInfoBo
         this.open = true

+ 5 - 4
src/views/zdsz/engineeringPipeJacking/index.vue

@@ -438,7 +438,8 @@
                 { required: true, message: "负责人电话不能为空" ,trigger: 'blur'}
               ],
 
-            }
+            },
+            nodeList:[],
           };
         },
         created() {
@@ -468,9 +469,9 @@
             this.nodeDetailVisible = false
           },
           toNodeDetail(){
-            // getDictList({enginType:['engineering_infrastructure']}).then(res => {
-
-            // })
+            getDictList({enginType:['pipe_jack']}).then(res => {
+              this.nodeList = res.data
+            })
             this.nodeDetailVisible = true
             return
             this.$refs['form'].validate(e => {