Kaynağa Gözat

民用工程bug修复

wang_xy 1 yıl önce
ebeveyn
işleme
a19cc0f5ad

+ 8 - 8
src/views/zdsz/enginSpecifications/index.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="材质" prop="materId">
-        <el-select v-model="queryParams.materId" placeholder="请选择所属工程">
+        <el-select v-model="queryParams.materId" placeholder="请选择材质">
           <el-option
             v-for="dict in enginMaterialQualityList"
             :key="dict.id"
@@ -11,10 +11,10 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="材质名称" prop="name">
+      <el-form-item label="规格名称" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入材质名称"
+          placeholder="请输入规格名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -79,7 +79,7 @@
       <el-table-column type="selection" width="55" align="center"/>
 <!--      <el-table-column label="id" align="center" prop="id" v-if="true"/>-->
       <el-table-column label="材质名称" align="center" prop="materName"/>
-      <el-table-column label="材质名称" align="center" prop="name"/>
+      <el-table-column label="规格名称" align="center" prop="name"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -114,7 +114,7 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="材质" prop="materId">
-          <el-select v-model="form.materId" placeholder="请选择所属工程" style="width: 100%">
+          <el-select v-model="form.materId" placeholder="请选择材质" style="width: 100%">
             <el-option
               v-for="dict in enginMaterialQualityList"
               :key="dict.id"
@@ -123,8 +123,8 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="材质名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入材质名称"/>
+        <el-form-item label="规格名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入规格名称"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -185,7 +185,7 @@ export default {
           {required: true, message: "不能为空", trigger: "blur"}
         ],
         materId: [
-          {required: true, message: "材质id不能为空", trigger: "blur"}
+          {required: true, message: "材质不能为空", trigger: "blur"}
         ],
         name: [
           {required: true, message: "材质名称不能为空", trigger: "blur"}

+ 45 - 33
src/views/zdsz/engineeringCivil/index.vue

@@ -945,16 +945,16 @@ export default {
           {required: true, message: "行政区不能为空", trigger: "change"}
         ],
         areaId: [
-          {required: true, message: "小区id不能为空", trigger: "change"}
+          {required: true, message: "小区不能为空", trigger: "change"}
         ],
         buildingId: [
-          {required: true, message: "楼宇id不能为空", trigger: "change"}
+          {required: true, message: "楼宇不能为空", trigger: "change"}
         ],
         unitId: [
-          {required: true, message: "单元id不能为空", trigger: "change"}
+          {required: true, message: "单元不能为空", trigger: "change"}
         ],
         houseId: [
-          {required: true, message: "房间id不能为空", trigger: "change"}
+          {required: true, message: "房间不能为空", trigger: "change"}
         ],
         enginType: [
           {required: true, message: "工程类型不能为空", trigger: "change"}
@@ -1210,6 +1210,10 @@ export default {
       this.queryParams.areaId = null
       this.queryParams.buildingId = null
       this.queryParams.unitId = null
+      this.communityOptions = [];
+      this.buildingOptions = [];
+      this.unitOptions=[];
+      this.houseOptions=[];
       getAreaList({district}).then(res => {
         this.communityOptions = res.data
       })
@@ -1218,18 +1222,23 @@ export default {
     communityHasChanged(areaId) {
       this.queryParams.buildingId = null
       this.queryParams.unitId = null
+      this.buildingOptions = [];
+      this.unitOptions=[];
+      this.houseOptions=[];
       getBuildingList({areaId}).then(res => {
         this.buildingOptions = res.data
       })
     },
     buildingHasChanged(buildingId, areaId) {
-      console.log(buildingId)
+      this.unitOptions=[];
+      this.houseOptions=[];
       this.queryParams.unitId = null
       getUnits(buildingId).then(res => {
         this.unitOptions = res.data
       })
     },
     unitHasChanged(unitId) {
+      this.houseOptions=[];
       getHousesList({unitId}).then(res => {
         console.log(res)
         this.houseOptions = res.data
@@ -1376,24 +1385,26 @@ export default {
       // 收集节点信息
       this.currentCheckList.forEach((e, idx) => {
         let nodeItem = this.$refs['EnginNodeInfo' + idx][0].infoCollection()
-        //  console.log(nodeItem)
         nodeCollection.push(nodeItem)
       })
       this.queryParams.zEngineeringNodeBoList = nodeCollection
       if (this.enginNodeStatus == '修改') {
-        putEngineeringCivil(this.queryParams).then(res => {
-          if (res.code == 200) {
-            this.$message({
-              message: '添加成功',
-              type: 'success'
-            });
-            this.open = false
-            console.log('选中节点集合', this.currentCheckList)
-            this.currentCheckList = []
-            this.getList()
-            // this.$emit('closeToSucceed')
-          }
-        })
+        this.$refs["form"].validate(valid => {
+            if (valid) {
+              putEngineeringCivil(this.queryParams).then(res => {
+                if (res.code == 200) {
+                  this.$message({
+                    message: '添加成功',
+                    type: 'success'
+                  });
+                  this.open = false
+                  console.log('选中节点集合', this.currentCheckList)
+                  this.currentCheckList = []
+                  this.getList()
+                }
+              })
+            }
+        });
       } else if (this.enginNodeStatus == '添加用料') {
         addEngineeringCivil(this.queryParams).then(res => {
           if (res.code == 200) {
@@ -1405,7 +1416,6 @@ export default {
             console.log('选中节点集合', this.currentCheckList)
             this.currentCheckList = []
             this.getList()
-            // this.$emit('closeToSucceed')
           }
         })
       } else if (this.enginNodeStatus == '添加用料') {
@@ -1418,24 +1428,26 @@ export default {
             this.open = false
             console.log('选中节点集合', this.currentCheckList)
             this.currentCheckList = []
-            // this.$emit('closeToSucceed')
           }
         })
       } else {
-        addEngineeringCivil(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')
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            addEngineeringCivil(this.queryParams).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '新增成功',
+                  type: 'success'
+                });
+                this.open = false
+                console.log('选中节点集合', this.currentCheckList)
+                this.currentCheckList = []
+              }
+            })
           }
-        })
+        });
       }
-
+      this.getList();
       return
       getDictList({enginType: ['new_built', 'old_renovation']}).then(res => {
         this.nodeList = res.data

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

@@ -350,6 +350,16 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams= {
+        pageNum: 1,
+          pageSize: 10,
+          areaId: undefined,
+          buildingId: undefined,
+          unitId: undefined,
+          name: undefined,
+      };
+      this.builds = []
+      this.units = []
       this.resetForm("queryForm");
       this.handleQuery();
     },