Explorar el Código

基建批量新增 添加用料

付宇航 hace 1 año
padre
commit
ba8a474214

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

@@ -197,6 +197,14 @@ export function putEngineeringCivil(data) {
     })
 }
 
+// 历史民用工程
+export function viewEngineeringCivilSource({id,type}) {
+    return request({
+      url: `/zdsz/engineeringCivil/${id}/${type}`,
+      method: 'get',
+    })
+}
+
 // 查询民用工程详情
 export function viewEngineeringCivil(id) {
     return request({

+ 14 - 6
src/components/EnginNodeInfo/index.vue

@@ -135,10 +135,10 @@
                     <!--                  <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>-->
                     <el-select v-model="item.corrosionLevel" placeholder="请选择腐蚀等级" style="width: 100%">
                         <el-option
-                        v-for="e in specificationsList"
-                        :key="e.id"
-                        :label="e.name"
-                        :value="e.id"
+                        v-for="e in corrosionLevelList"
+                        :key="e.dictValue"
+                        :label="e.dictLabel"
+                        :value="e.dictValue"
                         ></el-option>
                     </el-select>
                     </el-form-item>
@@ -202,6 +202,7 @@
 import { 
     getEnginMaterialQualityList,                    // 材质
     getEnginSpecificationsList,                     // 规格
+    getDictType,                                    // 腐蚀程度
 
 } from '@/api/zdsz/enginee'
 export default {
@@ -216,11 +217,11 @@ export default {
         return {
             constructAccordingDrawingsOption:[
               {
-                value:'1',
+                value:'Y',
                 label:'是'
               },
               {
-                value:'0',
+                value:'N',
                 label:'否'
               }
             ],
@@ -234,6 +235,7 @@ export default {
                 label:'不合格'
               }
             ],
+            corrosionLevelList:[],                      // 腐蚀等级option
             materialQualityList:[],                     // 材质
             specificationsList:[],                      // 规格
             materialComponList:[],
@@ -260,8 +262,14 @@ export default {
     created(){
         // 获取材质
         getEnginMaterialQualityList({enginType:this.enginType}).then(res => {
+            console.log('材质',res)
             this.materialQualityList = res.data
         })
+        // 获取腐蚀等级
+        getDictType({dictType:'corrosion_level'}).then(res => {
+            console.log('腐蚀等级',res)
+            this.corrosionLevelList = res.data
+        })
         console.log('update',this.updateOption)
     },
     mounted(){

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

@@ -131,15 +131,15 @@
         </template>
       </el-table-column>
       <el-table-column label="完工状态" align="center" prop="completionStatus"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="400">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            @click="addNodeInfo(scope.row)"
             v-hasPermi="['zdsz:engineeringCivil:edit']"
-          >修改
+          >填写节点信息
           </el-button>
           <el-button
             size="mini"
@@ -161,7 +161,7 @@
             type="text"
             icon="el-icon-edit"
             @click="addMaterial(scope.row)"
-          >新增物
+          >添加用
           </el-button>
         </template>
       </el-table-column>
@@ -356,6 +356,12 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 历史 -->
+    <ConstructionDetails
+      ref="ConstructionDetails"
+      :currentCollapses="currentCollapses"
+    />
   </div>
 </template>
 
@@ -373,7 +379,8 @@ import {
   putEngineeringCivil,                       // 民用工程修改
   viewEngineeringCivil,                      // 民用工程查看详情
   deleteEngineeringCivil,                    // 删除民用工程
-  getDictList
+  getDictList,                               
+  viewEngineeringCivilSource                 // 民用历史
 } from "@/api/zdsz/enginee"
 import {getAreaList} from "@/api/zdsz/area";
 import {getBuildingList} from "@/api/zdsz/building";
@@ -381,10 +388,13 @@ import {getUnits} from "@/api/zdsz/unit";
 import {resetForm} from "@/utils/ruoyi";
 import {getDicts} from "@/api/system/dict/data";
 import EnginNodeInfo from "@/components/EnginNodeInfo/index";
+import ConstructionDetails from '@/components/ConstructionDetails/index.vue'
+
 
 export default {
   components: {
-    EnginNodeInfo
+    EnginNodeInfo,
+    ConstructionDetails
   },
 
   name: "EngineeringCivil",
@@ -403,9 +413,33 @@ export default {
     "engin_cycle"],
   data() {
     return {
+      currentCollapses:[],
       updateOption:[],
       listContain:[
         {
+          name:'拆旧管',
+          components:[
+              [
+                'corrosionLevel',                        // 腐蚀等级
+              ],
+              'constructTime',                           // 施工时间
+              'zEngiineeringPhotoBoList',                // 照片
+            ]
+        },
+        {
+          name:'警器切断阀',
+          components:[
+              [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+              ],
+              'constructTime',                           // 施工时间
+              'zEngiineeringPhotoBoList',                // 照片
+              'remark',                                  // 施工内容
+            ]
+        },
+        {
           name:'放线',
           components:[
               [
@@ -751,6 +785,13 @@ export default {
     }
   },
   methods: {
+    // 填写节点信息
+    addNodeInfo(data){
+      this.$refs.ConstructionDetails.open(this.dict.type.engineering_infrastructure)
+      // viewEngineeringCivilSource().then(res => {
+      //   console.log('历史',res)
+      // })
+    },
     // 新增顶管工程
     addNewPipe(data) {
       this.$refs.enginPipe.openDialog({
@@ -761,7 +802,7 @@ export default {
     // 新增物料
     addMaterial(data){
       this.title = "添加用料";
-      // this.enginNodeStatus = '修改'
+      this.enginNodeStatus = '添加用料'
       this.loading = true;
       this.reset();
       const id = data.id || this.ids
@@ -968,11 +1009,11 @@ export default {
          nodeCollection.push(nodeItem)
       })
       this.queryParams.zEngineeringNodeBoList = nodeCollection
-      if(this.enginNodeStatus == '修改'){
-        putEngineeringCivil(this.queryParams).then(res => {
+      if(this.enginNodeStatus == '添加用料'){
+        addEngineeringCivil(this.queryParams).then(res => {
           if(res.code == 200){
             this.$message({
-              message: '修改成功',
+              message: '添加成功',
               type: 'success'
             });
             this.open = false
@@ -993,7 +1034,7 @@ export default {
             this.currentCheckList = []
             // this.$emit('closeToSucceed')
           }
-      })
+        })
       }
       
       return

+ 348 - 53
src/views/zdsz/engineeringInfrastructure/index.vue

@@ -72,7 +72,7 @@
       <el-table-column label="建设单位" align="center" prop="constructUnit" />
       <el-table-column label="开工时间" align="center" prop="startTime" />
       <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="400">
         <template slot-scope="scope">
           <el-button
             type="text"
@@ -100,6 +100,13 @@
             icon="el-icon-edit"
             @click="addNewPipe(scope.row)"
           >新增顶管工程</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="addMaterial(scope.row)"
+          >添加用料
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -114,7 +121,7 @@
     <!-- 顶管工程新增 -->
     <EngineePipe ref="enginPipe"/>
     <!-- 添加或修改开栓|安检|维修对话框 -->
-    <el-dialog :title="title" :visible.sync="open" append-to-body customClass="appendElDialog">
+    <el-dialog :title="title" ref="nodeForm" :visible.sync="open" append-to-body customClass="appendElDialog" @close="onClose">
       <el-form ref="form" :model="queryParams" :rules="rules" label-width="110px">
         <el-form-item label="工程名称" prop="enginName">
           <el-input v-model="queryParams.enginName" placeholder="请输入工程名称"></el-input>
@@ -144,7 +151,11 @@
         <el-form-item label="计划工期" prop="plannedDuration">
           <el-input v-model="queryParams.plannedDuration" placeholder="请输入计划工期"></el-input>
         </el-form-item>
-        <el-form-item label="备注" prop="remark">
+        <el-form-item label="文件" prop="">
+          <ObsFileUpload ref="obsFileUpload" :file-size="100" :file-type="['dwg','dwt','doc','docx','xls','xlsx','png', 'jpg', 'jpeg']" :limit="9999"  :value="queryParams.files"
+          ></ObsFileUpload>
+        </el-form-item>
+        <el-form-item label="工程内容" prop="remark">
           <el-input
             v-model="queryParams.remark"
             type="textarea"
@@ -152,10 +163,29 @@
             class="remark_input"
             />
         </el-form-item>
+        <el-form-item label="节点" style="width: 100%;margin-left: 0;">
+          <el-checkbox-group v-model="currentCheckList" @change="console.log(currentCheckList)">
+            <el-checkbox 
+              :label="item.label" 
+              v-for="item in checkList"
+              :key="item.label"
+              ></el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+        <EnginNodeInfo 
+          v-for="(e,idx) in currentCheckList"
+          :key="idx"
+          :name="e"
+          :ref="'EnginNodeInfo'+idx"
+          :currentContain="(listContain.find(i => i.name == e)).components"
+          :types="currentCheckList"
+          :status="enginNodeStatus"
+          enginType="基建工程"
+        />
       </el-form>
       <div slot="footer" class="dialog-footer">
         <!-- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确定</el-button> -->
-        <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">填写节点信息</el-button>
+        <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">添加</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -181,6 +211,7 @@ import {getUnits} from "@/api/zdsz/unit";
 import {getAreas} from "@/api/zdsz/area";
 import {getHouses, listHouse} from "@/api/zdsz/house";
 import EngineeNode from '@/components/EngineeNode/index'
+import EnginNodeInfo from "@/components/EnginNodeInfo/index";
 import {
   getEngineeringInfrastructure,              // 查询基建工程列表
   addEngineeringInfrastructure,              // 新增基建工程
@@ -216,7 +247,8 @@ export default {
   components:{
     EngineePipe,
     EngineeNode,
-    ConstructionDetails
+    ConstructionDetails,
+    EnginNodeInfo
   },
   data() {
     var validatePicPass = (rule, value, callback) => {
@@ -231,6 +263,153 @@ export default {
         }
     };
     return {
+      listContain:[
+        {
+          name:'施工进场',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'水电施工',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'瓦工',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'木工',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'防水',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'门窗',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'地板',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'油工',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'设备',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'灯具',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'保洁',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+        {
+          name:'竣工',
+          components:[
+            [
+                'materialQuality',                       // 材质
+                'specifications',                        // 规格
+                'number',                                // 数量
+            ],
+            'constructTime',                           // 施工时间
+            'zEngiineeringPhotoBoList',                // 照片
+          ]
+        },
+      ],
+      enginNodeStatus:null,
       currentCollapses:[],
       searchParams:{
         enginName:''
@@ -277,6 +456,7 @@ export default {
         completedTime:null,       // 竣工时间
         plannedDuration:null,     // 计划工期
         remark:null,
+        files:[],
         // zEngineeringNodeBo:{
         //   type:'',
         //   zEngineeringInfoBo:{},    //节点信息
@@ -459,55 +639,76 @@ export default {
           },
       ],
       value: [],
-  options: [
-      {
-    value: 'old_renovation',
-    label: '旧改',
-    children: [
+      options: [
           {
-              value: 'old_renovation_indoor_engin',
-              label: '室内',
+        value: 'old_renovation',
+        label: '旧改',
+        children: [
+              {
+                  value: 'old_renovation_indoor_engin',
+                  label: '室内',
 
-          },
-          {
-              value: 'old_renovation_courtyard',
-              label: '庭院',
-          },
-          {
-              value: 'old_renovation_overhead',
-              label: '架空',
-          }
-      ]
-  },
-  {
-    value: 'new_built',
-    label: '新建',
-    children: [
-          {
-              value: 'new_built_indoor_engin',
-              label: '室内',
+              },
+              {
+                  value: 'old_renovation_courtyard',
+                  label: '庭院',
+              },
+              {
+                  value: 'old_renovation_overhead',
+                  label: '架空',
+              }
+          ]
+      },
+      {
+        value: 'new_built',
+        label: '新建',
+        children: [
+              {
+                  value: 'new_built_indoor_engin',
+                  label: '室内',
 
-          },
-          {
-              value: 'new_built_courtyard',
-              label: '庭院',
-          },
-          {
-              value: 'new_built_overhead',
-              label: '架空',
-          }
-      ]
-  },
-  ],
-  enginClassificationOption:[],          // 工程节点集合
-  currentType:null,
-  nodeList:[]
+              },
+              {
+                  value: 'new_built_courtyard',
+                  label: '庭院',
+              },
+              {
+                  value: 'new_built_overhead',
+                  label: '架空',
+              }
+          ]
+      },
+      ],
+      enginClassificationOption:[],          // 工程节点集合
+      currentType:null,
+      nodeList:[],
+      currentCheckList:[],
+      checkList:[],
     };
   },
   created() {
     this.getList();
   },
+  mounted(){
+    console.log(this.dict.type.engineering_infrastructure)
+    this.checkList = this.dict.type.engineering_infrastructure
+  },
   methods: {
+  // 添加用料
+  addMaterial(data){
+    this.title = "添加用料";
+    this.enginNodeStatus = '添加用料'
+    this.loading = true;
+    this.reset();
+    const id = data.id || this.ids
+    viewEngineeringInfrastructure(id).then(res => {
+      this.loading = false;
+      let newData = res.data
+      this.queryParams = newData
+      this.currentType = 'addMaterial'
+      this.open = true
+    })
+  },
   // 查看历史
   viewSource(e){
     console.log(e)
@@ -528,6 +729,12 @@ export default {
       console.log('折叠面板info',this.currentCollapses)
     })
   },
+  onClose(){
+    console.log(this.currentCheckList)
+    this.currentCheckList = []
+    this.checkList =[]
+    this.$refs.nodeForm.resetFields()
+  },
   closeToSucceed(){
     this.open = false;
     this.getList()
@@ -584,6 +791,45 @@ export default {
       this.nodeDetailVisible = false
     },
     toNodeDetail(){
+      let nodeCollection = []
+      // 收集节点信息
+      this.currentCheckList.forEach((e,idx) => {
+         let nodeItem = this.$refs['EnginNodeInfo'+ idx][0].infoCollection()
+        //  console.log(nodeItem)
+         delete nodeItem.zEngiineeringPhotoBoList
+         nodeCollection.push(nodeItem)
+      })
+      this.queryParams.zEngineeringNodeBoList = nodeCollection
+
+      if(this.enginNodeStatus == '添加用料'){
+        delete this.queryParams.id
+        addEngineeringInfrastructure(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')
+          }
+        })
+      }else{
+        addEngineeringInfrastructure(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
       getDictList({enginType:['engineering_infrastructure']}).then(res => {
         this.nodeList = res.data
         if(this.currentType == 'put'){
@@ -687,12 +933,58 @@ export default {
     },
     // 表单重置
     reset() {
-      this.$nextTick(() => {
-        this.$refs['form'].resetFields()
-        this.$refs['nodeForm'].resetFields()
-      })
+      this.form = {
+        id: undefined,
+        district: undefined,
+        areaId: undefined,
+        buildingId: undefined,
+        unitId: undefined,
+        houseId: undefined,
+        enginType: undefined,
+        enginClassification: undefined,
+        enginCycle: undefined,
+        completionStatus: undefined,
+        version: undefined,
+        imgUrl: undefined,
+        remark: undefined,
+        delFlag: undefined,
+        createBy: undefined,
+        createTime: undefined,
+        updateBy: undefined,
+        updateTime: undefined
+      };
+      this.queryParams = {
+        district: undefined,
+        areaId: undefined,
+        buildingId: undefined,
+        unitId: undefined,
+        houseId: undefined,
+        enginType: undefined,
+        enginClassification: undefined,
+        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,// 用料对象,    //节点信息
+        //   }
+        // },
+      }
+      this.enginClassification = null
       this.resetForm("form");
-      this.resetForm("nodeForm");
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -714,6 +1006,7 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
+      this.enginNodeStatus == '新增'
       this.title = "新增工程";
     },
     /** 修改按钮操作 */
@@ -774,7 +1067,9 @@ height: 80%;
 
 
 .el-dialog__body{
-height: 85%;
+  overflow: hidden;
+  overflow-y: scroll;
+  height: 85%;
 }
 
 .el-form-item{
@@ -790,8 +1085,8 @@ margin-top: 0.5%;
 }
 .remark_input{
 .el-textarea__inner{
-  width: 238%;
-  height: 190px;
+  width: 100%;
+  height: 140px;
 }
 }
 }