Przeglądaj źródła

Merge branch 'zdsz3.0' of http://192.168.10.18:3000/sunwei/zdsz_vue into zdsz3.0

付宇航 1 rok temu
rodzic
commit
9b23f36a52

+ 1 - 0
package.json

@@ -51,6 +51,7 @@
     "quill": "1.3.7",
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",
+    "uuid": "^9.0.1",
     "vue": "2.6.12",
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.5.5",

+ 6 - 0
src/api/zdsz/overhead.js

@@ -29,3 +29,9 @@ export function getEnginSpecificationsList(materId) {
      params: {materId:materId}
   })
 }
+export function getsumStatus(materId) {
+  return request({
+    url: `/zdsz/engineeringCivil/getsumStatus?enginCycle=${materId}`,
+    method: 'get',
+  })
+}

+ 6 - 0
src/router/index.js

@@ -186,6 +186,12 @@ export const dynamicRoutes = [
         component: () => import('@/views/zdsz/enginee/material/progres_visual/index'),
         name: 'progres_visual',
         meta: { title: '可视化进度'}
+      },
+      {
+        path: '/echarts_statistics',
+        component: () => import('@/views/zdsz/enginee/material/echarts_statistics/index'),
+        name: 'echarts_statistics',
+        meta: { title: '可视化统计'}
       }
     ]
   }

+ 295 - 0
src/views/zdsz/enginee/material/echarts_statistics/index.vue

@@ -0,0 +1,295 @@
+
+<template>
+  <div class="MaterialStatistics_Contain">
+    <el-radio-group v-model="currentMenu" style="margin-bottom: 20px;" @input="toModule">
+      <el-radio-button label="0">用料统计</el-radio-button>
+      <el-radio-button label="1">进度统计</el-radio-button>
+      <el-radio-button label="2">可视化统计</el-radio-button>
+      <el-radio-button label="3">可视化进度</el-radio-button>
+    </el-radio-group>
+    <!--        <div class="topContain">-->
+    <div style="width: 100%;height: 100%;display: flex;">
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form-item label="工程周期" prop="enginCycle">
+      <el-select v-model="queryParams.enginCycle" filterable clearable placeholder="请选择规格"
+                 @change="getsumStatus(queryParams.enginCycle)"
+      >
+        <el-option
+          v-for="dict in dict.type.engin_cycle"
+          :key="dict.value"
+          :label="dict.label"
+          :value="dict.value"
+        />
+      </el-select>
+    </el-form-item>
+      </el-form>
+  </div>
+    <div style="height: 800px;width: 1700px">
+<div id="main" style="height: 100%;width: 100%"></div>
+      </div>
+  </div>
+</template>
+
+<script>
+import * as echarts from 'echarts';
+import {getsumStatus} from "@/api/zdsz/overhead";
+export default {
+  name:'EchartsStatistics',
+  dicts:['engin_cycle'],
+  data(){
+    return {
+      currentMenu:2,   // 0:用料管理 1:进度统计 2:可视化进度
+      showSearch:true,
+      queryParams:{enginCycle:'0'},
+      option:{
+      backgroundColor: '#feffff',
+        title: {
+      text: '',
+        left: 'center',
+        top: 20,
+        textStyle: {
+        color: '#ccc'
+      }
+    },
+      tooltip: {
+        trigger: 'item'
+      },
+      visualMap: {
+        show: false,
+          min: 80,
+          max: 600,
+          inRange: {
+          colorLightness: [0, 1]
+        }
+      },
+      series: [
+        {
+          name: 'Access From',
+          type: 'pie',
+          radius: '55%',
+          center: ['50%', '50%'],
+          data: [
+            { value: 335, name: 'Direct' },
+            { value: 310, name: 'Email' },
+            { value: 274, name: 'Union Ads' },
+            { value: 235, name: 'Video Ads' },
+            { value: 400, name: 'Search Engine' }
+          ],
+          roseType: 'radius',
+          label: {
+            color: 'rgba(255, 255, 255, 0.3)'
+          },
+          labelLine: {
+            lineStyle: {
+              color: 'rgba(255, 255, 255, 0.3)'
+            },
+            smooth: 0.2,
+            length: 10,
+            length2: 20
+          },
+          itemStyle: {
+            color: '#e81610',
+            shadowBlur: 200,
+            shadowColor: 'rgba(241,9,9,0.5)'
+          },
+          animationType: 'scale',
+          animationEasing: 'elasticOut',
+          animationDelay: function (idx) {
+            return Math.random() * 200;
+          }
+        }
+      ]
+    }
+    }
+  },
+  mounted(){
+  this.getsumStatus(0)
+  },
+  methods: {
+    getsumStatus(val)
+    {
+      getsumStatus(val).then(res=>{
+        let data=[{
+          value: parseInt(res.data.done),name:'完工数量'
+        },{
+          value: parseInt(res.data.notstart),name:'未开工数量'
+        },{
+          value: parseInt(res.data.willDone),name:'未完工数量'
+        }
+        ]
+        let  option={
+          backgroundColor: '#feffff',
+          title: {
+            text: '',
+            left: 'center',
+            top: 20,
+            textStyle: {
+              color: '#dc0e0e'
+            }
+          },
+          tooltip: {
+            trigger: 'item'
+          },
+          visualMap: {
+            show: false,
+            min: 0,
+            max: 800000,
+            inRange: {
+              colorLightness: [0, 1]
+            }
+          },
+          series: [
+            {
+              name: '',
+              type: 'pie',
+              radius: '55%',
+              center: ['50%', '50%'],
+              data: data.sort(function (a, b) {
+                return a.value - b.value;
+              }),
+              roseType: 'radius',
+              label: {
+                color: 'rgb(1,11,17)'
+              },
+              labelLine: {
+                lineStyle: {
+                  color: 'rgb(32,155,229)'
+                },
+                smooth: 0.2,
+                length: 10,
+                length2: 20
+              },
+              itemStyle: {
+                color: '#98201d',
+                shadowBlur: 200,
+                shadowColor: 'rgb(254,255,255)'
+              },
+              animationType: 'scale',
+              animationEasing: 'elasticOut',
+              animationDelay: function (idx) {
+          return Math.random() * 200;
+        }
+      }
+      ]
+      }
+        this.initmian(option)
+      })
+    },
+    initmian(option)
+    {
+      console.log(option)
+      var chartDom = document.getElementById('main');
+      var myChart = echarts.init(chartDom);
+      myChart.clear()
+      myChart.setOption(option,true)
+    },
+    toModule(){
+      console.log(this.$router)
+      const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
+      this.$router.push({
+        path:`/${currentPage}`
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tags-view-container{
+  display: none;
+}
+.MaterialStatistics_Contain{
+  width: 100%;
+  height: 100%;
+  padding: 1%;
+  .topContain{
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+    height: 40px;
+
+    ::v-deep .projectSelect{
+      width: 16%;
+      .el-input__inner{
+        // font-size: 15px;
+        // height: 40px ;
+        // background-color: #1890FF;
+        background: linear-gradient(to right, #2197F2, #0BB0DE);
+        color: #fff;
+      }
+    }
+
+    ::v-deep .districtSelect{
+      width: 200px;
+    }
+    ::v-deep .communitySelect{
+      margin-left: 2%;
+      width: 200px;
+    }
+    ::v-deep .projectSelect:not(:nth-child(1)){
+      margin-left: 1%;
+    }
+    ::v-deep .projectSelect:nth-child(3){
+      width: 10%;
+    }
+    ::v-deep .projectSelect:nth-child(4){
+      width: 10%;
+    }
+    .projectDropDown{
+      background-color: #1890FF;
+      .el-select-dropdown__item{
+        background-color: #1890FF;
+        color: #fff;
+      }
+      ::v-deep .el-select-dropdown__list {
+        padding-top: 0 !important;
+        padding-bottom: 0;
+      }
+    }
+    .projectDropDown >ul{
+      padding-top: 0 ;
+      padding-bottom: 0;
+    }
+  }
+  .materialStatisticsTable{
+    margin-top: 1%;
+    border: 2px solid #000066 !important;
+
+  }
+  .materialStatisticsTable::before{
+    background-color:#000066 ;
+  }
+  .materialStatisticsTable::after{
+    background-color:#000066 ;
+  }
+}
+</style>
+
+<style lang="scss" scoped>
+.customTable{
+  .el-table__header-wrapper th{
+    background-color: #199ED8;
+  }
+  .el-table--border th.el-table__cell{
+    border: 2px solid #000066 !important;
+  }
+  .el-table__empty-block{
+    background-color: #199ED8;
+  }
+  .el-table__empty-text{
+    color: #000066;
+  }
+  .el-table__cell{
+    background-color: #199ED8 ;
+    border: 2px solid #000066 !important;
+  }
+  .el-table__cell >div{
+    text-align: center;
+  }
+  .el-button{
+    background-color: #169BD5;
+    color: #fff;
+  }
+}
+
+</style>

+ 12 - 10
src/views/zdsz/enginee/material/material_statistics/index.vue

@@ -4,7 +4,8 @@
         <el-radio-group v-model="currentMenu" style="margin-bottom: 20px;" @input="toModule">
             <el-radio-button label="0">用料统计</el-radio-button>
             <el-radio-button label="1">进度统计</el-radio-button>
-            <el-radio-button label="2">可视化进度</el-radio-button>
+          <el-radio-button label="2">可视化统计</el-radio-button>
+          <el-radio-button label="3">可视化进度</el-radio-button>
         </el-radio-group>
 <!--        <div class="topContain">-->
             <div style="width: 100%;height: 100%;display: flex;">
@@ -86,9 +87,9 @@
             <el-table
                 class="materialStatisticsTable"
                 :data="tableData"
-                header-cell-style="background-color:#199ED8;border: 2px solid #000066"
+
                 border
-                :cell-style="tableRowClassName"
+
                 style="width: 100%">
               <el-table-column
                 prop="areaName"
@@ -333,13 +334,14 @@ export default {
         tableRowClassName(){
             return "background:#199ED8;border: 2px solid #000066"
         },
-        toModule(){
-            console.log(this.$router)
-            const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' : 'progres_visual'
-            this.$router.push({
-                path:`/${currentPage}`
-            })
-        }
+      toModule(){
+        console.log(this.$router)
+        const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
+        this.$router.push({
+          path:`/${currentPage}`
+        })
+      }
+
     }
 }
 </script>

+ 9 - 8
src/views/zdsz/enginee/material/progres_statistics/progres_statistics.vue

@@ -5,7 +5,8 @@
         <el-radio-group v-model="currentMenu" style="margin-bottom: 20px;" @input="toModule">
             <el-radio-button label="0">用料统计</el-radio-button>
             <el-radio-button label="1">进度统计</el-radio-button>
-            <el-radio-button label="2">可视化进度</el-radio-button>
+          <el-radio-button label="2">可视化统计</el-radio-button>
+          <el-radio-button label="3">可视化进度</el-radio-button>
         </el-radio-group>
         <div class="topContain">
           <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  v-show="showSearch" label-width="68px">
@@ -221,14 +222,14 @@ export default {
         tableRowClassName(){
             return "background:#FFFFFF;border: 1px solid #000066"
         },
-        toModule(){
-            console.log(this.$router)
-            const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' : 'progres_visual'
-            this.$router.push({
-                path:`/${currentPage}`
-            })
-        }
+    toModule(){
+      console.log(this.$router)
+      const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
+      this.$router.push({
+        path:`/${currentPage}`
+      })
     }
+  }
 }
 </script>
 

+ 38 - 37
src/views/zdsz/enginee/material/progres_visual/index.vue

@@ -1,9 +1,9 @@
 
- <!-- 
+ <!--
     *@description: 可视化进度
     *@author: yh Fu
     *@date: 2023-12-25 13:27:19
-    *@version: V1.0.5 
+    *@version: V1.0.5
     -->
 
 <template>
@@ -11,15 +11,16 @@
         <el-radio-group v-model="currentMenu" style="margin-bottom: 20px;" @input="toModule">
             <el-radio-button label="0">用料统计</el-radio-button>
             <el-radio-button label="1">进度统计</el-radio-button>
-            <el-radio-button label="2">可视化进度</el-radio-button>
+          <el-radio-button label="2">可视化统计</el-radio-button>
+          <el-radio-button label="3">可视化进度</el-radio-button>
         </el-radio-group>
         <div class="topContain">
             <div style="width: 100%;height: 100%;">
-                <el-select 
-                    v-model="currentCommunity" 
+                <el-select
+                    v-model="currentCommunity"
                     placeholder="请选择行政区"
-                    class="projectSelect" 
-                    popper-class="projectDropDown" 
+                    class="projectSelect"
+                    popper-class="projectDropDown"
                     :popper-append-to-body="false"
                     >
                     <el-option
@@ -29,11 +30,11 @@
                         :value="e.value">
                     </el-option>
                 </el-select>
-                <el-select 
-                    v-model="currentCommunity" 
+                <el-select
+                    v-model="currentCommunity"
                     placeholder="请选择小区"
-                    class="projectSelect" 
-                    popper-class="projectDropDown" 
+                    class="projectSelect"
+                    popper-class="projectDropDown"
                     :popper-append-to-body="false"
                     >
                     <el-option
@@ -43,11 +44,11 @@
                         :value="e.value">
                     </el-option>
                 </el-select>
-                <el-select 
-                    v-model="currentType" 
-                    placeholder="请选择工程类型" 
-                    class="projectSelect" 
-                    popper-class="projectDropDown" 
+                <el-select
+                    v-model="currentType"
+                    placeholder="请选择工程类型"
+                    class="projectSelect"
+                    popper-class="projectDropDown"
                     :popper-append-to-body="false"
                     >
                     <el-option
@@ -59,8 +60,8 @@
                 </el-select>
                 <el-date-picker
                     v-model="currentDate"
-                    class="projectSelect" 
-                    popper-class="projectDropDown" 
+                    class="projectSelect"
+                    popper-class="projectDropDown"
                     :popper-append-to-body="false"
                     type="date"
                     placeholder="选择日期">
@@ -69,19 +70,19 @@
             <el-button class="searchBtn">查询</el-button>
             <el-button class="searchBtn">导出</el-button>
             <div class="unitStatus">
-                <div 
+                <div
                     v-for="(e,idx) in unitStatusOption"
                     :key="idx"
                     :style="`background-color:${e.color};width: 22%;height: 35px;position: absolute;right:${idx*130}px;box-shadow:0 5px 5px 0 #CDCDCD`"
                     >
-                    <div 
+                    <div
                         style="position: relative;left: 107%;width: 116%;top: 20%;"
                         >
                         {{ e.label }}
                     </div>
                 </div>
             </div>
-        </div>   
+        </div>
         <!-- 房间集合 -->
         <ConstructionDetails/>
     </div>
@@ -96,12 +97,12 @@ export default {
     },
     data(){
         return {
-            currentMenu:2,   // 0:用料管理 1:进度统计 2:可视化进度
+            currentMenu:3,   // 0:用料管理 1:进度统计 2:可视化进度
             typeOptions:[
                 {
                     value: '0',
                     label: '市政工程'
-                }, 
+                },
                 {
                     value: '1',
                     label: '工业工程'
@@ -109,11 +110,11 @@ export default {
                 {
                     value: '2',
                     label: '民用工程'
-                }, 
+                },
                 {
                     value: '3',
                     label: '危险作业'
-                }, 
+                },
                 {
                     value: '4',
                     label: '顶管工程'
@@ -127,7 +128,7 @@ export default {
                 {
                     value: '0',
                     label: '领秀世家'
-                }, 
+                },
                 {
                     value: '1',
                     label: '上东府里'
@@ -135,11 +136,11 @@ export default {
                 {
                     value: '2',
                     label: '清华园'
-                }, 
+                },
                 {
                     value: '3',
                     label: '万科蓝山'
-                }, 
+                },
                 {
                     value: '4',
                     label: '龙腾香格里'
@@ -164,13 +165,13 @@ export default {
         }
     },
     methods:{
-        toModule(){
-            console.log(this.$router)
-            const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' : 'progres_visual'
-            this.$router.push({
-                path:`/${currentPage}`
-            })
-        }
+      toModule(){
+        console.log(this.$router)
+        const currentPage = this.currentMenu == 0 ? 'material_statistics' : this.currentMenu == 1 ? 'progres_statistics' :this.currentMenu == 2 ? 'echarts_statistics': 'progres_visual'
+        this.$router.push({
+          path:`/${currentPage}`
+        })
+      }
     }
 }
 </script>
@@ -180,7 +181,7 @@ export default {
     width: 100%;
     height: 100%;
     padding: 1%;
-    .topContain{  
+    .topContain{
         display: flex;
         justify-content: space-between;
         width: 60%;
@@ -220,4 +221,4 @@ export default {
         }
     }
 }
-</style>
+</style>

+ 7 - 7
src/views/zdsz/engineeringDangerous/index.vue

@@ -147,13 +147,13 @@
             v-hasPermi="['zdsz:engineeringDangerous:remove']"
           >删除
           </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="addNewPipe(scope.row)"
-          >新增顶管工程
-          </el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="addNewPipe(scope.row)"-->
+<!--          >新增顶管工程-->
+<!--          </el-button>-->
           <!--          <el-button
                       type="text"
                       icon="el-icon-edit"

+ 81 - 62
src/views/zdsz/engineeringIndustry/index.vue

@@ -198,7 +198,6 @@
         </el-row>
         <div style="width: 25%; float: right">
           <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
-          <el-button type="primary" @click="toNodeDetail">填写施工信息</el-button>
           <el-button @click="cancel">取 消</el-button>
         </div>
       </el-form>
@@ -206,7 +205,6 @@
     <!-- 施工信息dialog -->
     <el-dialog :visible.sync="nodeDetailVisible" title="施工信息" append-to-body customClass="appendElNodeDialog"
                width="70% !important">
-      <!-- 节点表单 -->
       <el-form ref="nodeForm" :model="zEngineeringNodeBo.zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
         <el-form-item label="施工时间" prop="constructTime">
           <el-date-picker
@@ -217,10 +215,6 @@
             placeholder="请选择施工时间">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="施工人" prop="constructUser" v-if="form.id">
-          <el-input v-model="zEngineeringNodeBo.zEngineeringInfoBo.constructUser" placeholder="请填写施工人"
-                    maxlength="20" disabled></el-input>
-        </el-form-item>
         <el-row>
           <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
             <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']"
@@ -228,25 +222,15 @@
                             @input="getUrl"></ObsImageUpload>
           </el-form-item>
         </el-row>
-        <div style="width: 25%; float: right">
-          <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
-          <el-button @click="nodeCancel">取 消</el-button>
-        </div>
-      </el-form>
-    </el-dialog>
-    <!-- 用料信息dialog -->
-    <el-dialog :visible.sync="MaterVisible" title="用料信息" >
-      <el-form ref="MaterForm">
         <el-row v-for="(item, index) in zEngineeringMaterialBo" :key="index">
-          <el-col :span="6">
+          <el-col :span="7">
             <el-form-item
-              :prop="`zEngineeringMaterialBo.${index}.materialQuality`"
-              :rules="{ required:true, validator: validateState, trigger: 'blur', index:index }"
-              label-width="50px"
+              :prop="`${item.id}.materialQuality`"
+              style="margin-left: 120px"
+              label-width="auto"
               label="材质"
-              style="margin-right: 15px"
             >
-              <el-select v-model="item.materialQuality" placeholder="请选择材质"
+              <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 70%"
                          @change="getEnginSpecificationsList(item, index)">
                 <el-option
                   v-for="e in materialQualityList"
@@ -257,15 +241,14 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :span="7">
             <el-form-item
-              :prop="`zEngineeringMaterialBo.${index}.specifications`"
-              :rules="{ required:true, validator: validateSize, trigger: 'blur', index:index }"
-              label-width="50px"
-              style="margin-right: 15px"
+              :prop="`${item.id}.specifications`"
+              style="margin-left: 80px"
+              label-width="auto"
               label="规格"
             >
-              <el-select v-model="item.specifications" placeholder="请选择规格" >
+              <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 70%">
                 <el-option
                   v-for="e in zEngineeringMaterialBo.specifications"
                   :key="e.id"
@@ -275,39 +258,37 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :span="7">
             <el-form-item
-              :prop="`zEngineeringMaterialBo.${index}.number`"
-              :rules="{ required:true, validator: validateNumber, trigger: 'blur', index:index }"
-              label-width="50px"
-              style="margin-right: 15px"
+              :prop="`${item.id}.number`"
+              style="margin-left: 40px"
+              label-width="auto"
               label="数量"
             >
-                <el-input v-model="item.number" placeholder="请输入数量"  maxlength="8" type="number"/>
+              <div class="block" style="display: inline-block; margin-right: 20px;">
+                <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
+              </div>
             </el-form-item>
           </el-col>
           <el-col :span="3">
-            <el-form-item style="margin-left: 100px">
-              <el-button v-if="zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)" type="danger">
+            <el-form-item style="margin-left: -120px;">
+              <el-button v-if="zEngineeringMaterialBo.length > 1" @click="removezEngineeringMaterialBo(index)">
                 删除
               </el-button>
             </el-form-item>
           </el-col>
         </el-row>
-        <div style="text-align: right;">
-          <el-button
-            @click="addzEngineeringMaterialBo"
-          >新增用料信息
-          </el-button>
-          <el-button  type="primary" @click="updateMaterBo">
-          提交
-          </el-button>
+        <div style="width: 25%; float: right">
+          <el-button @click="addzEngineeringMaterialBo">新增用料信息</el-button>
+          <el-button :loading="buttonLoading" type="primary" @click="updateMaterBo">提交</el-button>
+          <el-button @click="nodeCancel">取 消</el-button>
         </div>
       </el-form>
     </el-dialog>
     <ConstructionDetails
       ref="ConstructionDetails"
       :currentCollapses="currentCollapses"
+      @updateNodeOption = "updateNodeOption"
     />
   </div>
 </template>
@@ -369,6 +350,7 @@ export default {
       comprehensiveList: [],
       // 弹出层标题
       title: "",
+      gc: true,
       nodeList: [],
       // 是否显示弹出层
       open: false,
@@ -480,10 +462,10 @@ export default {
       // 节点规则校验
       nodeRules: {
         constructTime: [
-          {required: true, message: "施工时间不能为空", trigger: ['change','blur']}
+          {required: true, message: "施工时间不能为空", trigger: ['change', 'blur']}
         ],
         zEngiineeringPhotoBoList: [
-          {required: true, message: "图片不能为空", trigger: ['change','blur'], validator: validatePicPass}
+          {required: true, message: "图片不能为空", trigger: ['change', 'blur'], validator: validatePicPass}
         ],
       },
       currentType: null, // 附件组件类型 put修改 add新增
@@ -505,6 +487,8 @@ export default {
   },
   methods: {
     validateState(rule, value, callback) {
+      console.log(rule)
+      console.log(value)
       return new Promise((resolve, reject) => {
         if (value !== null && value !== undefined && value !== '' && value !== 0) {
           resolve(true)
@@ -514,7 +498,10 @@ export default {
       })
     },
     validateSize(rule, value, callback) {
+      console.log(value)
       return new Promise((resolve, reject) => {
+        const value = this.zEngineeringMaterialBo[rule.index].specifications
+        console.log(value)
         if (value !== null && value !== undefined && value !== '' && value !== 0) {
           resolve(true)
         } else {
@@ -522,17 +509,24 @@ export default {
         }
       })
     },
-    validateNumber(rule, value, callback,index) {
+    validateNumber(rule, value, callback) {
+      console.log(value)
       return new Promise((resolve, reject) => {
         const value = this.zEngineeringMaterialBo[rule.index].number
         // 至少有一个图片、一个用料信息、一个创建时间
-        if(value){
+        if (value) {
           resolve(true)
-        }else{
-          return callback(new Error('数量不能为空'))
+        } else {
+          return reject(new Error('数量不能为空'))
         }
       })
     },
+    updateNodeOption(value){
+      UpdateEngineeIndustry(value).then(res => {
+        this.$modal.msgSuccess("修改成功");
+        this.getList();
+      })
+    },
     // 根据所选材质获取对应规格
     getEnginSpecificationsList(item, index) {
       this.zEngineeringMaterialBo[index].specifications = null
@@ -542,23 +536,45 @@ export default {
       })
     },
     //添加用料信息
-    addzEngineeringMaterBo(row){
+    addzEngineeringMaterBo(row) {
       const id = row.id
       putEngineeEngineeIndustry(id).then(response => {
         this.loading = false;
         this.form = response.data
-        this.form.zEngineeringNodeBo = response.data.zEngineeringNodeBoList[0]
-        this.form.zEngineeringNodeBo.zEngineeringInfoBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
-        this.zEngineeringMaterialBo = response.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0].zEngineeringMaterialBo
-        this.MaterVisible = true;
+        this.form.zEngineeringNodeBo = []
+        this.nodeDetailVisible = true;
       });
     },
-    updateMaterBo(){
+    updateMaterBo() {
       this.form.files = this.form.pics
-      this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
-      UpdateEngineeIndustry(this.form).then(res => {
-        this.MaterVisible = false
-      })
+      this.form.zEngineeringNodeBo = []
+      if (this.zEngineeringMaterialBo.length > 0) {
+        let valid = true;
+        if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['materialQuality'] == null) {
+          valid = false;
+        }
+        if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['specifications'] == null) {
+          valid = false;
+        }
+        if (this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == '' || this.zEngineeringMaterialBo[this.zEngineeringMaterialBo.length - 1]['number'] == null) {
+          valid = false;
+        }
+        if (valid) {
+          this.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.zEngineeringMaterialBo
+          this.form.zEngineeringNodeBo = this.zEngineeringNodeBo
+          this.$refs.nodeForm.validate(valid => {
+            if (valid) {
+              EditEngineeEngineeIndustry(this.form).then(res => {
+                this.nodeDetailVisible = false
+                this.$modal.msgSuccess("新增成功");
+              })
+            }
+          });
+        } else {
+          this.$message.warning('完善信息!')
+        }
+      }
+
     },
     //新增用料信息
     addzEngineeringMaterialBo() {
@@ -613,6 +629,7 @@ export default {
     },
     nodeCancel() {
       this.nodeDetailVisible = false
+      this.reset()
     },
     // 填写施工信息
     toNodeDetail() {
@@ -654,8 +671,8 @@ export default {
       }
       this.form.zEngineeringNodeBo = {}
       this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
-      this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
-      this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
+      this.zEngineeringMaterialBo = []
+      this.zEngineeringMaterialBo.push({
         materialQuality: '', // 用料材质
         specifications: '', // 用料规格
         number: '' // 用料数量
@@ -681,17 +698,19 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
+      this.gc = true
       this.title = (this.form.type === '1' ? "新增工业工程" : "新增市政工程");
       this.currentType = 'add'
       this.open = true;
     },
-    removeFile(val){
+    removeFile(val) {
       console.log(val)
       console.log("我是文件")
       this.form.files = val
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.gc = false
       this.loading = true;
       this.reset();
       const id = row.id || this.ids

+ 12 - 12
src/views/zdsz/engineeringInfrastructure/index.vue

@@ -40,7 +40,7 @@
           v-hasPermi="['zdsz:openbolt:edit']"
         >修改</el-button>
       </el-col>
-        
+
       <el-col :span="1.5">
         <el-button
           type="danger"
@@ -96,7 +96,7 @@
               v-hasPermi="['zdsz:engineeringCivil:edit']"
               >修改工程信息
             </el-button>
-        
+
               <el-button
               size="mini"
               type="text"
@@ -128,12 +128,12 @@
             v-hasPermi="['zdsz:engineeringCivil:remove']"
             >历史用料
           </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="addNewPipe(scope.row)"
-          >新增顶管工程</el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="addNewPipe(scope.row)"-->
+<!--          >新增顶管工程</el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -200,14 +200,14 @@
         </el-form-item>
         <el-form-item label="节点" style="width: 100%;margin-left: 0;" v-if="title!=='修改基建工程'">
           <el-checkbox-group v-model="currentCheckList" @change="console.log(currentCheckList)">
-            <el-checkbox 
-              :label="item.label" 
+            <el-checkbox
+              :label="item.label"
               v-for="item in checkList"
               :key="item.label"
               ></el-checkbox>
           </el-checkbox-group>
         </el-form-item>
-        <EnginNodeInfo 
+        <EnginNodeInfo
           v-for="(e,idx) in currentCheckList"
           :key="idx"
           :name="e"
@@ -799,7 +799,7 @@ export default {
         });
         this.$refs.ConstructionDetails.dialogVisible = false
         this.updateParams = {}
-        
+
       }
     })
   },