Pārlūkot izejas kodu

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

付宇航 1 gadu atpakaļ
vecāks
revīzija
f5fbd40dff

+ 1 - 20
src/api/rules.js

@@ -10,8 +10,7 @@ export function validPhoneMobile(rule, value, callback){
       callback(new Error('请输入11位手机号'));
     } else {
       let regPone;
-      let mobile = /^1([3456789])\d{9}$/; //最新16手机正则
-      regPone = mobile;
+      regPone = /^1([3456789])\d{9}$/; //最新16手机正则
       if (!regPone.test(value)) {
         callback(new Error("请填写11位手机号"))
       }
@@ -41,21 +40,3 @@ export function checkPositiveDecimal(rule, value, callback) {
     callback()
   }
 }
-/**
- * 验证正整数(不包含0的正整数)
- * @param {*} rule
- * @param {*} value
- * @param {*} callback
- */
-export function checkPositiveInteger(rule, value, callback) {
-  if (value) {
-    value += ''
-    if(/(^[1-9]\d*$)/.test(value)) {
-      callback()
-    } else {
-      callback(new Error('只能输入数字,数值不能为负数或0,且不能为小数'))
-    }
-  } else {
-    callback()
-  }
-}

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

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

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

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

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

@@ -110,6 +110,7 @@
     <!-- 节点信息dialog -->
     <enginee-node
       @closeToSucceed="closeToSucceed"
+      @files="getFiles"
       ref="childNode"
     />
   </div>
@@ -163,8 +164,7 @@ export default {
         enginCode: '',       // 工程编码
         constructQuality: '',      // 施工质量
         constructSchedule: "",       // 施工进度
-        type: null,                // 类型  01工业工程 02市政工程
-        enginType: '',             // 工程类型  民用工程 0 ,市政工程 1,工业工程 2 ,顶管工程 3,危险作业工程 4,基建工程 5
+        type: null,                // 类型
         remark: '',                // 备注
         constructUnit: null,
         zEngineeringNodeBo: {
@@ -228,6 +228,11 @@ export default {
         remark: [
           {required: false, message: "备注不能为空", trigger: "blur"}
         ],
+        files: [
+          { required: false, message: '必须上传文件!', trigger: 'change' },
+        ]
+
+
       },
       currentType: null, // 组件类型 put修改 add新增
     };
@@ -257,7 +262,13 @@ export default {
       this.open = false
       this.nodeDetailVisible = false
     },
-    openDialog(data, type) {
+    getFiles(flag){
+      if (flag){
+        this.$refs.obsFileUpload.fileList=this.queryParams.files
+      }
+    },
+    async openDialog(data, type,sata) {
+      await this.reset();
       this.currentType = type
       if (this.currentType == 'add') {
         this.title = '新增顶管信息'
@@ -266,25 +277,35 @@ export default {
       }
       this.queryParams.enginId = data.id
       this.queryParams.type = data.type
+      //带值
+      this.queryParams.enginName = sata.enginName?sata.enginName:'';
       this.open = true
     },
     nodeCancel() {
       this.nodeDetailVisible = false
     },
     toNodeDetail() {
-      getDictList({enginType:['pipe_jack']}).then(res => {
-        this.nodeList = res.data
-        this.nodeList.forEach(e => {
-          e.name = e.value
-        })
-        if (this.currentType == 'put') {
-          this.queryParams.files = this.$refs.obsFileUpload.fileList
-          this.$refs.childNode.open(this.queryParams, 15,this.nodeList)
-        } else if (this.currentType == 'add') {
-          this.queryParams.files = this.$refs.obsFileUpload.fileList
-          this.$refs.childNode.open(this.queryParams, 10,this.nodeList)
+      if (this.$refs.obsFileUpload.fileList==null||this.$refs.obsFileUpload.fileList.length===0){
+        this.$message.warning('必须上传文件!')
+        return
+      }
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          getDictList({enginType:['pipe_jack']}).then(res => {
+            this.nodeList = res.data
+            this.nodeList.forEach(e => {
+              e.name = e.value
+            })
+            if (this.currentType == 'put') {
+              this.queryParams.files = this.$refs.obsFileUpload.fileList;
+              this.$refs.childNode.open(this.queryParams, 15,this.nodeList)
+            } else if (this.currentType == 'add') {
+              this.queryParams.files = this.$refs.obsFileUpload.fileList;
+              this.$refs.childNode.open(this.queryParams, 10,this.nodeList)
+            }
+          })
         }
-      })
+      });
     },
     // 取消按钮
     cancel() {
@@ -299,6 +320,7 @@ export default {
       // })
       this.resetForm("form");
       this.resetForm("nodeForm");
+      this.queryParams.files=[]
     },
     /** 提交按钮 */
     submitForm() {

+ 146 - 25
src/views/zdsz/engineeringDangerous/index.vue

@@ -154,13 +154,13 @@
             @click="addNewPipe(scope.row)"
           >新增顶管工程
           </el-button>
-          <el-button
+<!--          <el-button
             type="text"
             icon="el-icon-edit"
             size="mini"
             @click="viewSource(scope.row)"
           >历史
-          </el-button>
+          </el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -415,16 +415,38 @@
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer" style="margin-top: 20%;">
-        <!-- <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="submitForm">提交</el-button>
+<!--         <el-button :loading="buttonLoading" type="primary" @click="openNode">填写节点信息</el-button>-->
+<!--        <el-button :loading="buttonLoading" type="primary" @click="toNodeDetail">填写节点信息</el-button>-->
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
     <!-- 节点信息dialog -->
-    <enginee-node
+<!--    <el-dialog :visible="openNodeForm" :rules="nodesRule" title="节点信息" append-to-body customClass="appendElNodeDialog" width="70% !important">
+    <el-form ref="nodeForm" :model="zEngineeringInfoBo" :rules="nodeRules" label-width="200px">
+      <el-form-item label="施工时间" prop="constructTime">
+        <el-date-picker
+          v-model="zEngineeringInfoBo.constructTime"
+          value-format="yyyy-MM-dd hh:mm:ss"
+          type="datetime"
+          placeholder="请选择施工时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="照片" prop="zEngiineeringPhotoBoList" style="width: 100%;">
+        <ObsImageUpload ref="obsImageUpload" :limit="9999" :fileType="['png', 'jpg', 'jpeg']" :value="zEngineeringInfoBo.zEngiineeringPhotoBoList"
+                        @input="getUrl"></ObsImageUpload>
+      </el-form-item>
+      <div style="display: flex;margin-top: 3%;">
+        <div style="width: 80%;"></div>
+        <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
+        <el-button @click="nodeCancel">取 消</el-button>
+      </div>
+    </el-form>
+    </el-dialog>-->
+<!--    <enginee-node
       ref="childNode"
       @closeToSucceed="closeToSucceed"
-    />
+    />-->
     <EngineePipe ref="enginPipe"/>
     <ConstructionDetails
       ref="ConstructionDetails"
@@ -437,7 +459,7 @@
 import {
   listEngineeringDangerous,
   getEngineeringDangerous,
-  delEngineeringDangerous, queryEngineeringDangerous,
+  delEngineeringDangerous, queryEngineeringDangerous, updateEngineeringDangerous, addEngineeringDangerous,
 } from "@/api/zdsz/engineeringDangerous";
 import EngineeNode from "@/components/EngineeNode/index";
 import data from "@/views/system/dict/data.vue";
@@ -446,6 +468,7 @@ import ConstructionDetails from "@/components/ConstructionDetails/index.vue";
 import {validPhoneMobile, checkPositiveDecimal} from "@/api/rules";
 
 
+
 export default {
   name: "EngineeringDangerous",
   computed: {
@@ -458,6 +481,9 @@ export default {
   },
   data() {
     return {
+      //备用
+     // openNodeForm:false,
+      //备用
       currentCollapses: [],
       nodeType: "危险作业工程",
       nodeDetailVisible: false,
@@ -519,10 +545,10 @@ export default {
         backfill: undefined,
         tamp: undefined,
         levelingTheSite: undefined,
-        zEngineeringNodeBo: {
+      /*  zEngineeringNodeBo: {
           type: "危险作业工程",
           zEngineeringInfoBo: {}  //节点信息
-        }
+        }*/
       },
       zEngineeringInfoBo: {
         constructAddre: '',        // 施工地址
@@ -563,9 +589,6 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        id: [
-          {required: true, message: "不能为空", trigger: "blur"}
-        ],
         basicInformation: [
           {required: true, message: "作业基本信息不能为空", trigger: "blur"}
         ],
@@ -575,9 +598,9 @@ export default {
         enginAddre: [
           {required: true, message: "工程地点不能为空", trigger: "blur"}
         ],
-        enginTime: [
+      /*  enginTime: [
           {required: true, message: "工程时间不能为空", trigger: "blur"}
-        ],
+        ],*/
         hazardousWorkPitsLong: [
           //{required: true, message: "危险作业坑大小(长)不能为空", trigger: "blur"},
           {validator: checkPositiveDecimal, trigger: 'blur'},
@@ -683,7 +706,7 @@ export default {
            ],*/
       },
       // 节点规则校验
-      nodeRules: {
+     /* nodeRules: {
         type: [
           {required: true, message: "节点类型不能为空", trigger: 'blur'}
         ],
@@ -703,7 +726,17 @@ export default {
           {required: true, message: "负责人电话不能为空", trigger: 'blur'}
         ],
 
-      },
+      },*/
+      //备用
+  /*    nodesRule:{
+        zEngiineeringPhotoBoList: [
+          {required: true, message: "图片不能为空", trigger: 'blur'}
+        ],
+        constructTime: [
+          {required: true, message: "施工时间不能为空", trigger: 'blur'}
+        ],
+      },*/
+      //备用
       currentType: null, // 组件类型 put修改 add新增
     };
   },
@@ -711,6 +744,92 @@ export default {
     this.getList();
   },
   methods: {
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.buttonLoading = true;
+          if (this.form.id != null) {
+            this.form.files = this.$refs.obsFileUpload.fileList
+            updateEngineeringDangerous(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          } else {
+            this.form.files = this.$refs.obsFileUpload.fileList
+            addEngineeringDangerous(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          }
+        }
+      });
+    },
+    //备用
+   /* openNode(){
+      this.$refs["form"].validate(valid => {
+        if (valid){
+          this.openNodeForm=true
+          console.log(this.form.id)
+          if (this.form.id !== undefined){
+            getEngineeringDangerous(this.form.id).then((res)=>{
+              console.log(res.data)
+              this.zEngineeringInfoBo = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList[0]
+              this.nodeType = res.data.zEngineeringNodeBoList[0].type
+            })
+          }
+        }
+
+      })
+    },
+    nodeCancel(){
+      this.resetNodeForm()
+      this.openNodeForm = false
+    },
+    resetNodeForm(){
+      this.$refs['nodeForm'].resetFields()
+      this.resetForm("nodeForm");
+    },
+
+    submitForm() {
+      this.$refs["nodeForm"].validate(valid => {
+        if (valid) {
+          if (this.form.id == null) {
+            this.form.zEngineeringNodeBo = {}
+            this.form.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+            this.form.zEngineeringNodeBo.type = this.nodeType
+            this.form.files = this.$refs.obsFileUpload.fileList
+            this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
+            console.log(this.form)
+            addEngineeringDangerous(this.form).then(res => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.openNodeForm = false
+              this.getList();
+            })
+          } else {
+            // 危险修改
+            this.form.zEngineeringNodeBo = {}
+            this.form.zEngineeringNodeBo.zEngineeringInfoBo = this.zEngineeringInfoBo
+            this.form.zEngineeringNodeBo.type = this.nodeType
+            this.form.files = this.$refs.obsFileUpload.fileList
+            this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = []
+            updateEngineeringDangerous(this.form).then(res => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.openNodeForm = false
+              this.getList();
+            })
+          }
+        }
+      });
+    },*/
+    //备用
     viewSource(e) {
       this.currentId = e.id
       this.$refs.ConstructionDetails.open(_, "危险作业工程")
@@ -739,12 +858,6 @@ export default {
             this.$refs.childNode.open(this.form, 37, [{name: "危险作业工程"}])
             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)
           if (this.currentType === 'add') {
             this.form.files = this.$refs.obsFileUpload.fileList
             this.$refs.childNode.open(this.form, 3, [{name: "危险作业工程"}])
@@ -767,13 +880,13 @@ export default {
       this.$refs.enginPipe.openDialog({
         id: data.id,
         type: "危险作业工程"
-      }, 'add')
+      }, 'add',data)
     },
     getUrl(url) {
       this.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.$refs.obsImageUpload.fileList ? this.$refs.obsImageUpload.fileList.map(e => e.url) : [];
     },
     /** 查询危险工程列表 */
-    getList() {
+   /* getList() {
       this.loading = true;
       listEngineeringDangerous({
         basicInformation: this.queryParams.basicInformation,
@@ -785,6 +898,14 @@ export default {
         this.total = res.total;
         this.loading = false;
       });
+    },*/
+    getList() {
+      this.loading = true;
+      listEngineeringDangerous(this.queryParams).then(response => {
+        this.engineeringDangerousList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
     },
     // 取消按钮
     cancel() {
@@ -878,7 +999,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除危险工程编号为"' + ids + '"的数据项?').then(() => {
+      this.$modal.confirm('是否确认删除所选的数据项?').then(() => {
         this.loading = true;
         return delEngineeringDangerous(ids);
       }).then(() => {

+ 76 - 51
src/views/zdsz/engineeringIndustry/index.vue

@@ -213,25 +213,15 @@
                             @input="getUrl"></ObsImageUpload>
           </el-form-item>
         </el-row>
-        <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index">
-          <!-- 在此处添加默认的行内容 -->
-          <template v-if="index === null">
-            <div>默认的行内容</div>
-          </template>
-          <!-- 循环输出的行内容 -->
-          <template v-else>
-            <div>{{ item }}</div>
-          </template>
-          <el-col :span="7">
+        <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index" >
+          <el-col :span="7" >
             <el-form-item
-              :prop="'zEngineeringMaterialBo.' + index + '.materialQuality'"
-              label-width="50px"
+              :prop="`zEngineeringMaterialBo.${index}.materialQuality`"
+              :rules="{ required:true, validator: validateState, trigger: 'blur', index:index }"
+              label-width="auto"
               label="材质"
-
             >
-              <!--                  :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
-              <!--                  <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
-              <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 100%" @change="getEnginSpecificationsList(item, index)">
+              <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 70%" @change="getEnginSpecificationsList(item, index)">
                 <el-option
                   v-for="e in materialQualityList"
                   :key="e.id"
@@ -241,16 +231,14 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="7">
+          <el-col :span="7" >
             <el-form-item
-              :prop="'zEngineeringMaterialBo.' + index + '.specifications'"
-              label-width="50px"
+              :prop="`zEngineeringMaterialBo.${index}.specifications`"
+              :rules="{ required:true, validator: validateSize, trigger: 'blur', index:index }"
+              label-width="auto"
               label="规格"
-
             >
-              <!--                  :rules="{required: true, message: '请输入规格', trigger: 'blur'}"-->
-              <!--                  <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>-->
-              <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 100%">
+              <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 70%">
                 <el-option
                   v-for="e in specificationsList"
                   :key="e.id"
@@ -260,14 +248,13 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="7">
+          <el-col :span="7" >
             <el-form-item
-              :prop="'zEngineeringMaterialBo.' + index + '.number'"
-              label-width="50px"
+              :prop="`zEngineeringMaterialBo.${index}.number`"
+              :rules="{ required:true, validator: validateNumber, trigger: 'blur', index:index }"
+              label-width="auto"
               label="数量"
-
             >
-              <!--                  :rules="[{required: true, message: '请输入数量', trigger: 'change'},{validator: [checkPositiveInteger], trigger: 'blur'}]"-->
               <div class="block" style="display: inline-block; margin-right: 20px;">
                 <el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
               </div>
@@ -304,7 +291,7 @@ import {
   QueryEngineeIndustry
 } from '@/api/zdsz/engineeringIndustry'
 import EngineePipe from '@/components/EngineePipe'
-import { checkPositiveInteger, validPhoneMobile } from '@/api/rules'
+import { validPhoneMobile } from '@/api/rules'
 import ConstructionDetails from '@/components/ConstructionDetails/index.vue'
 import { getEnginMaterialQualityList } from '@/api/zdsz/enginee'
 import { getEnginSpecificationsList } from '@/api/zdsz/enginSpecifications'
@@ -320,10 +307,9 @@ export default {
     // 自定义校验
     const validatePicPass = (rule, value, callback) => {
       return new Promise((resolve, reject) => {
-        // 至少有一个图片、一个用料信息、一个创建时间
+        // 至少有一个图片、一个创建时间
         if (this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList.length !== 0
-          && (this.form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime !== null || undefined)
-          && this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.length !== 0) {
+          && (this.form.zEngineeringNodeBo.zEngineeringInfoBo.constructTime !== null || undefined)) {
           resolve(true)
         } else {
           reject(new Error('no pass'))
@@ -479,16 +465,48 @@ export default {
     },500)
   },
   methods: {
-    // 验证正整数(不包含0的正整数)
-    checkPositiveInteger,
+    validateState(rule,value,callback){
+      return new Promise((resolve, reject) => {
+        if (value !==null && value !== undefined && value !== '' && value !== 0)
+          {
+          resolve(true)
+        } else {
+          return callback(new Error('材质不能为空'))
+        }
+      })
+    },
+    validateSize(rule,value,callback){
+      return new Promise((resolve, reject) => {
+        if (value !==null && value !== undefined && value !== '' && value !== 0)
+        {
+          resolve(true)
+        } else {
+          return callback(new Error('规格不能为空'))
+        }
+      })
+    },
+    validateNumber(rule,value,callback){
+      return new Promise((resolve, reject) => {
+        console.log("·························")
+        console.log(value);
+        // 至少有一个图片、一个用料信息、一个创建时间
+        if (value !==null && value !== undefined && value !== '' && value !== 0 && !isNaN(value))
+        {
+          resolve(true)
+        } else {
+          return callback(new Error('数量不能为空且只能为数字'))
+        }
+      })
+    },
+    // 根据所选材质获取对应规格
     getEnginSpecificationsList(item, index){
-      let materialId = item.materialQuality
       this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo[index].specifications = null
       // 根据材质ID获取材质规格
-      getEnginSpecificationsList({ materialId }).then(res => {
+      getEnginSpecificationsList(item.materialQuality).then(res => {
         this.specificationsList = res.data
       })
     },
+    // 添加用料信息
     addzEngineeringMaterialBo(){
       this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.push({
         materialQuality: '', // 用料材质
@@ -496,6 +514,7 @@ export default {
         number: '' // 用料数量
       })
     },
+    // 删除用料信息
     removezEngineeringMaterialBo(index){
       this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.splice(index, 1)
     },
@@ -516,7 +535,7 @@ export default {
       this.$refs.enginPipe.openDialog({
         id: data.id,
         type: this.form.zEngineeringNodeBo.type
-      }, 'add')
+      }, 'add',data)
     },
     // 历史查询
     viewSource(e){
@@ -530,20 +549,31 @@ export default {
       }).then(res => {
         try {
           this.currentCollapses = res.data.zEngineeringNodeBoList[0].zEngineeringInfoBoList
-          console.log('当前历史数据',this.currentCollapses)
         } catch (error) {
           this.currentCollapses = [];
         }
-        console.log(this.currentCollapses)
       })
     },
     nodeCancel() {
       this.nodeDetailVisible = false
+      // 反向赋值 - 为了让附件回显
+      this.$refs.obsFileUpload.fileList =this.form.files
     },
+    // 填写施工信息
     toNodeDetail() {
+      this.form.files = this.$refs.obsFileUpload.fileList;
+      if (this.form.files.length === 0){
+        this.$message.warning(  '必须上传附件!')
+        return
+      }
+      // 根据材质id查询对应规格回显
+      this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo.forEach(item =>{
+        getEnginSpecificationsList(item.materialQuality).then(res => {
+          this.specificationsList = res.data
+        })
+      })
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.files = this.$refs.obsFileUpload.fileList
           this.nodeDetailVisible = true
         }
       })
@@ -630,11 +660,6 @@ export default {
       this.$refs["nodeForm"].validate(valid => {
         if (valid) {
           if (this.form.id == null) {
-            console.log(this.form)
-            // this.form.zEngineeringNodeBo = this.zEngineeringInfoBo
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.form.zEngineeringNodeBo.zEngiineeringPhotoBoList
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.form.zEngineeringNodeBo.zEngineeringMaterialBo
             addEngineeEngineeIndustry(this.form).then(res => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
@@ -642,10 +667,6 @@ export default {
               this.getList();
             })
           } else {
-            // this.form.zEngineeringNodeBo = this.zEngineeringInfoBo
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo = {}
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngiineeringPhotoBoList = this.form.zEngineeringNodeBo.zEngiineeringPhotoBoList
-            // this.form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo = this.form.zEngineeringNodeBo.zEngineeringMaterialBo
             EditEngineeEngineeIndustry(this.form).then(res => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -683,6 +704,8 @@ export default {
 
 
 <style lang="scss" scoped>
+
+
 ::v-deep .appendElDialog {
   width: 70%;
   height: 80%;
@@ -718,14 +741,16 @@ export default {
   // width: 70%;
   height: 80%;
 
-
+  .el-select{
+    width:70%
+  }
   .el-dialog__body {
     height: 85%;
   }
 
   .el-form-item {
     margin-bottom: 22px;
-    width: 44%;
+    width: 100%;
     display: inline-block;
   }
 

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

@@ -578,7 +578,7 @@ export default {
     addNewPipe(data){
       this.$refs.enginPipe.openDialog({
         id:data.id
-      },'add')
+      },'add',data)
     },
     nodeCancel(){
       this.nodeDetailVisible = false

+ 6 - 0
src/views/zdsz/house/index.vue

@@ -363,6 +363,12 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getHouse(id).then(response => {
+        getBuildings(response.data.areaId).then(res => {
+          this.builds = res.data
+        })
+        getUnits(response.data.areaId,response.data.buildingId).then(res => {
+          this.units = res.data
+        })
         this.loading = false;
         this.form = response.data;
         this.open = true;