Browse Source

民用基建批量新增 基建历史

付宇航 1 year ago
parent
commit
4d1c233d10

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

@@ -16,6 +16,15 @@ export function getDictType({dictType}) {
     })
 }
 
+// 获取工程子节点集合(民用 基建 顶管)
+export function getDictList({enginType}) {
+    return request({
+        url: `/system/dict/data/dictList/${enginType}`,
+        method: 'get',
+    })
+}
+
+
 
 // 查询楼栋集合
 export function getBuildingList({areaId}) {

+ 142 - 25
src/components/EngineeNode/index.vue

@@ -11,12 +11,13 @@
   <div style="width: 100%; height: 100%;">
     <el-dialog :visible="nodeDetailVisible" :rules="nodeRules" title="节点信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
       <!-- 节点选项卡 -->
-      <el-tabs type="border-card" class="engineNodeTypes" @tab-click="nodeHasChanged">
-        <el-tab-pane label="基本信息"></el-tab-pane>
+      <el-tabs type="border-card" class="engineNodeTypes" @tab-click="nodeHasChanged" :before-leave="confirmLeave" v-model="tabsModel">
+        <!-- <el-tab-pane label="基本信息"></el-tab-pane> -->
         <el-tab-pane
           :label="e"
           v-for="e in currentNode"
           :key="e"
+          :name="e"
           >
         </el-tab-pane>
       </el-tabs>
@@ -46,13 +47,13 @@
                 ></el-option>
               </el-select>
             </el-form-item> -->
-            <el-form-item label="工程类型">
+            <!-- <el-form-item label="工程类型">
                 <el-cascader
                     v-model="value"
                     :options="options"
                     @change="currentEnginTypeChange">
                 </el-cascader>
-              </el-form-item>
+              </el-form-item> -->
               <!-- <el-form-item label="工程节点">
                 <el-select 
                     v-model="enginClassification" 
@@ -75,9 +76,9 @@
             <el-form-item label="施工人" prop="constructUser">
             <el-input v-model="zEngineeringInfoBo.constructUser" placeholder="请填写施工人"></el-input>
             </el-form-item>
-            <el-form-item label="负责人" prop="headName">
+            <!-- <el-form-item label="负责人" prop="headName">
             <el-input v-model="zEngineeringInfoBo.headName" placeholder="请填写负责人"></el-input>
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item label="负责人电话" prop="headPhone">
             <el-input v-model="zEngineeringInfoBo.headPhone" placeholder="请填写负责人电话"></el-input>
             </el-form-item>
@@ -124,9 +125,9 @@
             <!-- 节点复选框 -->
             <el-checkbox-group v-model="currentNode" @change="currentNodeHasChanged">
               <el-checkbox
-                :label="e"
+                :label="e.name"
                 v-for="e in nodeList"
-                :key="e"
+                :key="e.name"
               ></el-checkbox>
             </el-checkbox-group>
             <div style="display: flex;margin-top: 3%;">
@@ -302,7 +303,6 @@ export default {
             ],
             enginClassification:'',
             enginClassificationOption:[],
-
             currentType:null ,          // 民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
             drawer: false,
             direction: 'rtl',
@@ -313,9 +313,14 @@ export default {
               visitType:'',                   // 上门类型
               selfClosingValveType:'',        // 自闭阀类型
             },
+            beforeNodeName:null,          // 上一个所选的节点全名称
             currentNode:[],
             nodeList:[],
             currentPickedNode:{} ,        // 当前所选中的节点界面
+            zEngineeringNodeBoList:[
+
+            ],                            // 节点信息大集合
+            tabsModel:""
           }
     },
     created(){
@@ -323,17 +328,57 @@ export default {
       this.options[1].children = this.dict.type.new_built
     },
     methods:{
+        confirmLeave(){
+          let p = new Promise((resolve, reject) => {
+            this.$refs.nodeForm.validate(e => {
+              e ? resolve() : reject();
+              if(e){
+                this.$message({
+                  message: '保存成功',
+                  type: 'success'
+                });
+                return true
+              }else{
+                this.$message({
+                  message: '请完善当前节点信息',
+                  type: 'error'
+                });
+                return false
+              }
+            }) 
+          });
+          return p;
+        },
         nodeHasChanged(el){
-          this.$nodeForm.validate(e => {
+          if(el.label == this.beforeNodeName ) return
+          // todo: 校验当前表单
+          this.$refs.nodeForm.validate(e => {
             if(e){
-              // 通过校验
-              this.currentPickedNode
+              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.error('请完善当前节点信息!');
+              this.$message({
+                message: '请完善当前节点信息',
+                type: 'warning'
+              });
             }
           })
 
-          return 
+          return
           // 拿到当前所选择的节点info
           const nodeItem = this.dict.type.engineering_infrastructure.find(e => e.label == this.currentNode[el.index -1])
           this.currentPickedNode = nodeItem
@@ -341,6 +386,28 @@ export default {
         },
         // 当前所选节点发生改变
         currentNodeHasChanged(e){
+          const currentName = e[e.length -1]
+          const currentNodeInfo = this.nodeList.find(e => e.name == currentName)
+          // todo: 填入节点大集合
+          this.zEngineeringNodeBoList.push({
+            type:currentNodeInfo.value,
+            validateFlag:null,                   // 校验当前集合是否通过标识
+            name:currentNodeInfo.name,           // 节点完整名称
+            zEngineeringInfoBo:{
+              constructAddre:'',                 // 施工地址
+              constructPhone:'',                 // 施工人电话
+              constructUser:'',                  // 施工人
+              headName:'',                       // 负责人
+              headPhone:'',                      // 负责人电话
+              constructAccordingDrawings:'',     // 是否按图纸施工
+              segmentedCompressionQualified:'',  // 分段打压是否合格
+              backfillTime:'',                   // 回填时间
+              constructTime:'',                  // 施工时间
+              zEngiineeringPhotoBoList:[],              // 图片列表
+              zEngineeringMaterialBo:[],         // 用料对象
+            }
+          })
+          console.log('节点信息大集合',this.zEngineeringNodeBoList)
         },
         // 添加用料
         addMaterial(){
@@ -367,7 +434,18 @@ export default {
                     switch(this.currentType){
                         case 0 :
                             // 民用工程 新增
-                            this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+                            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
                             addEngineeringCivil(this.params).then(res => {
                               if(res.code == 200){
                                 this.$message({
@@ -399,9 +477,18 @@ export default {
                         break;
                         case 4 :
                             // 基建工程新增
-                            this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
-                            this.params.zEngineeringNodeBo.type = this.nodeType
-                            this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
+                            this.params.zEngineeringNodeBoList = []
+                            this.zEngineeringNodeBoList.forEach(e => {
+                              this.params.zEngineeringNodeBoList.push({
+                                type:e.type,
+                                zEngineeringInfoBo:e.zEngineeringInfoBo
+                              })
+                            })
+
+
+                            // this.params.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+                            // this.params.zEngineeringNodeBo.type = this.nodeType
+                            // this.params.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
                             addEngineeringInfrastructure(this.params).then(res => {
                               if(res.code == 200){
                                 this.$message({
@@ -500,12 +587,33 @@ export default {
                 // }
             // });
         },
-        open(queryParams,type = null,nodeList = []){
-            this.nodeList = []  // 节点初始化
-            // 初始化工程节点
-            this.dict.type.engineering_infrastructure.forEach(e => {
-              this.nodeList.push(e.label)
+        open(queryParams,type = null,nodeOptions = []){
+            // this.nodeList = [] 
+            this.nodeList = nodeOptions // 节点初始化
+            console.log('节点option',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)
             // end
             this.currentType = type
@@ -551,11 +659,20 @@ export default {
       display: none;
     }
 }
+
+.el-checkbox{
+  width: 200px;
+}
+::v-deep .el-dialog:not(.is-fullscreen) {
+    margin-top: 4vh !important;
+}
 ::v-deep .appendElNodeDialog{
   // width: 70%;
-  height: 80%;
-
+  height: 93%;
 
+    .el-checkbox-group{
+      padding-left: 5%;
+    }
     .el-dialog__body{
       height: 85%;
     }

+ 57 - 43
src/views/zdsz/engineeringCivil/index.vue

@@ -149,6 +149,12 @@
             v-hasPermi="['zdsz:engineeringCivil:remove']"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="addNewPipe(scope.row)"
+          >新增顶管工程</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -247,7 +253,7 @@
             ></el-option>
           </el-select>
         </el-form-item> -->
-        <el-form-item label="工程类型">
+        <!-- <el-form-item label="工程类型">
           <el-cascader
             v-model="value"
             :options="options"
@@ -266,7 +272,7 @@
               :value="e.value"
             ></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="工程周期" prop="enginCycle">
           <el-select
             v-model="queryParams.enginCycle"
@@ -317,6 +323,7 @@ import {
   putEngineeringCivil,                       // 民用工程修改
   viewEngineeringCivil,                      // 民用工程查看详情
   deleteEngineeringCivil,                    // 删除民用工程
+  getDictList
 } from "@/api/zdsz/enginee"
 import {getAreaList} from "@/api/zdsz/area";
 import {getBuildingList} from "@/api/zdsz/building";
@@ -411,8 +418,6 @@ export default {
       open: false,
       // 查询参数
       queryParams: {
-        pageNum: 1,
-        pageSize: 10,
         district: undefined,
         areaId: undefined,
         buildingId: undefined,
@@ -423,7 +428,7 @@ export default {
         enginCycle: undefined,
         completionStatus: undefined,
         imgUrl: undefined,
-        zEngineeringNodeBo: {
+        zEngineeringNodeBoList: {
           type: undefined,
           zEngineeringInfoBo: {
             constructAddre: undefined,        // 施工地址
@@ -471,6 +476,7 @@ export default {
         zEngiineeringPhotoBoList:[],              // 图片列表
         zEngineeringMaterialBo:[],// 用料对象
       },
+      nodeList:[],
       // 表单参数
       form: {},
       value: [],
@@ -534,6 +540,13 @@ export default {
   mounted() {
   },
   methods: {
+    // 新增顶管工程
+    addNewPipe(data) {
+      this.$refs.enginPipe.openDialog({
+        id: data.id,
+        type: this.form.zEngineeringNodeBo.type
+      }, 'add')
+    },
     currentEnginTypeChange(val){
       const enginDict = val[1]
       const enginType = val[0]
@@ -634,8 +647,6 @@ export default {
         updateTime: undefined
       };
       this.queryParams= {
-        pageNum: 1,
-        pageSize: 10,
         district: undefined,
         areaId: undefined,
         buildingId: undefined,
@@ -646,24 +657,24 @@ export default {
         enginCycle: undefined,
         completionStatus: undefined,
         imgUrl: undefined,
-        zEngineeringNodeBo: {
-          type: undefined,
-          zEngineeringInfoBo: {
-            constructAddre: undefined,        // 施工地址
-            constructPhone: undefined,        // 施工人电话
-            constructUser: undefined,         // 施工人
-            headName: undefined,              // 负责人
-            headPhone: undefined,             // 负责人电话
-            constructAccordingDrawings: undefined, // 是否按图纸施工
-            segmentedCompressionQualified: undefined, // 分段打压是否合格
-            selfClosingValveType: undefined,          // 自闭阀类型
-            visitType: undefined,                     // 上门类型
-            backfillTime: undefined,                  // 回填时间
-            constructTime: undefined,                  // 施工时间
-            zEngiineeringPhotoBoList: undefined,              // 图片列表
-            zEngineeringMaterialBo: undefined,// 用料对象,    //节点信息
-          }
-        }
+        // zEngineeringNodeBo: {
+        //   type: undefined,
+        //   zEngineeringInfoBo: {
+        //     constructAddre: undefined,        // 施工地址
+        //     constructPhone: undefined,        // 施工人电话
+        //     constructUser: undefined,         // 施工人
+        //     headName: undefined,              // 负责人
+        //     headPhone: undefined,             // 负责人电话
+        //     constructAccordingDrawings: undefined, // 是否按图纸施工
+        //     segmentedCompressionQualified: undefined, // 分段打压是否合格
+        //     selfClosingValveType: undefined,          // 自闭阀类型
+        //     visitType: undefined,                     // 上门类型
+        //     backfillTime: undefined,                  // 回填时间
+        //     constructTime: undefined,                  // 施工时间
+        //     zEngiineeringPhotoBoList: undefined,              // 图片列表
+        //     zEngineeringMaterialBo: undefined,// 用料对象,    //节点信息
+        //   }
+        // },
       }
       this.enginClassification=null
       this.resetForm("form");
@@ -694,26 +705,29 @@ export default {
       this.nodeDetailVisible = false
     },
     toNodeDetail(){
-      if(this.currentType == 'put'){
-        this.$refs.childNode.open(this.queryParams,16)
-        this.currentType = null
-        return
-      }
-      // 加工 enginClassification 工程节点
-      const parts = this.value[1].split('_');
-      let result = parts.slice(2).join('_');
-      console.log(result)
-      this.queryParams.zEngineeringNodeBo.type = this.enginClassification
-      this.queryParams.enginClassification = result
-      console.log(this.queryParams)
-      this.$refs.childNode.open(this.queryParams,0)
-      return
-      this.$refs['form'].validate(e => {
-        if(e){
-          this.nodeDetailVisible = true
+      getDictList({enginType:['new_built','old_renovation']}).then(res => {
+        this.nodeList = res.data
+
+        if(this.currentType == 'put'){
+          this.$refs.childNode.open(this.queryParams,16)
+          this.currentType = null
+          return
         }
+        // 加工 enginClassification 工程节点
+        // const parts = this.value[1].split('_');
+        // let result = parts.slice(2).join('_');
+        // console.log(result)
+        // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
+        // this.queryParams.enginClassification = result
+        // console.log(this.queryParams)
+        this.$refs.childNode.open(this.queryParams,0,this.nodeList)
+        return
+        this.$refs['form'].validate(e => {
+          if(e){
+            this.nodeDetailVisible = true
+          }
+        })
       })
-
     },
     /** 新增按钮操作 */
     handleAdd() {

+ 22 - 25
src/views/zdsz/engineeringInfrastructure/index.vue

@@ -79,7 +79,7 @@
             icon="el-icon-edit"
             size="mini"
             @click="viewSource(scope.row)"
-          >历史</el-button>
+          >审核</el-button>
           <el-button
             size="mini"
             type="text"
@@ -191,6 +191,7 @@ import {
   putEngineeringCivil,                       // 民用工程修改
   viewEngineeringInfrastructure,                      // 基建工程查看详情
   deleteEngineeringInfrastructure,                    // 删除民用工程
+  getDictList
 } from "@/api/zdsz/enginee"
 import EngineePipe from "@/components/EngineePipe"
 import ConstructionDetails from "@/components/ConstructionDetails" 
@@ -210,7 +211,7 @@ export default {
          "new_built_courtyard_engin",
          "new_built_overhead",
          "engin_cycle",
-         "engineering_infrastructure"
+         "engineering_infrastructure",
       ],
   components:{
     EngineePipe,
@@ -276,10 +277,10 @@ export default {
         completedTime:null,       // 竣工时间
         plannedDuration:null,     // 计划工期
         remark:null,
-        zEngineeringNodeBo:{
-          type:'',
-          zEngineeringInfoBo:{},    //节点信息
-        }
+        // zEngineeringNodeBo:{
+        //   type:'',
+        //   zEngineeringInfoBo:{},    //节点信息
+        // }
       },
       zEngineeringInfoBo:{
         constructAddre:'',        // 施工地址
@@ -500,11 +501,11 @@ export default {
   ],
   enginClassificationOption:[],          // 工程节点集合
   currentType:null,
+  nodeList:[]
     };
   },
   created() {
     this.getList();
-    // this.getAreas();
   },
   methods: {
   // 查看历史
@@ -520,7 +521,7 @@ export default {
     }).then(res => {
       console.log(res)
       try {
-        this.currentCollapses = res.data.zengineeringNodeBoList[0].zEngineeringInfoBoList
+        this.currentCollapses = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList
       } catch (error) {
         this.currentCollapses = [];
       }
@@ -583,25 +584,21 @@ export default {
       this.nodeDetailVisible = false
     },
     toNodeDetail(){   
-      if(this.currentType == 'put'){
-          this.$refs.childNode.open(this.queryParams,14)
-          this.currentType = null
-          return
-      }
-      // 加工 enginClassification 工程节点
-      // const parts = this.value[1].split('_');
-      // let result = parts.slice(2).join('_');
-      // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
-      // this.queryParams.enginClassification = result
-      // console.log(this.queryParams)
-      this.$refs.childNode.open(this.queryParams,4)
-      return
-      this.$refs['form'].validate(e => {
-        if(e){
-          this.nodeDetailVisible = true
+      getDictList({enginType:['engineering_infrastructure']}).then(res => {
+        this.nodeList = res.data
+        if(this.currentType == 'put'){
+            this.$refs.childNode.open(this.queryParams,14)
+            this.currentType = null
+            return
         }
+        // 加工 enginClassification 工程节点
+        // const parts = this.value[1].split('_');
+        // let result = parts.slice(2).join('_');
+        // this.queryParams.zEngineeringNodeBo.type = this.enginClassification
+        // this.queryParams.enginClassification = result
+        // console.log(this.queryParams)
+        this.$refs.childNode.open(this.queryParams,4,this.nodeList)
       })
-      
     },
     getUrl(url) {
       this.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList?this.$refs.obsImageUpload.fileList.map(e=>e.url):[];

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

@@ -252,6 +252,7 @@
         viewEngineeringPipeJacking,                // 顶管工程查看详情
         deleteEngineeringPipeJacking,              // 删除工程查看详情
         detailEngineeringPipeJacking,              // 历史
+        getDictList
       } from "@/api/zdsz/enginee"
 
       export default {
@@ -467,6 +468,9 @@
             this.nodeDetailVisible = false
           },
           toNodeDetail(){
+            // getDictList({enginType:['engineering_infrastructure']}).then(res => {
+
+            // })
             this.nodeDetailVisible = true
             return
             this.$refs['form'].validate(e => {