Browse Source

开栓修改回显

qinhouyu 1 year ago
parent
commit
55e461b0b7
2 changed files with 49 additions and 29 deletions
  1. 21 6
      src/views/zdsz/openbolt/index.vue
  2. 28 23
      src/views/zdsz/opencheck/index.vue

+ 21 - 6
src/views/zdsz/openbolt/index.vue

@@ -100,7 +100,6 @@
       <el-table-column label="楼栋" align="center" prop="buildingName" />
       <el-table-column label="单元" align="center" prop="unitName" />
       <el-table-column label="房间" align="center" prop="houseName" />
-      <el-table-column label="类型" align="center" prop="type" />
       <el-table-column label="安检是否合格" align="center" prop="isQualified">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.pass_check" :value="scope.row.isQualified"/>
@@ -257,7 +256,7 @@ export default {
         buildingId: undefined,
         unitId: undefined,
         houseId: undefined,
-        type: 2,
+        type: 1,
         isQualified: undefined,
         isMaintenance: undefined,
       },
@@ -315,6 +314,7 @@ export default {
     getUnits(id) {
       this.houses = []
       this.queryParams.unitId = undefined
+      this.queryParams.houseId = undefined
       getUnits(this.queryParams.areaId,id).then(res => {
         this.units = res.data
       })
@@ -335,6 +335,7 @@ export default {
     },
     getHouses() {
       this.houses = []
+      this.queryParams.houseId = undefined
       getHouses(this.queryParams.unitId).then(res => {
         this.houses = res.data;
       });
@@ -352,12 +353,14 @@ export default {
     getUnits1(id) {
       this.houses = []
       this.form.unitId = undefined
+      this.form.houseId = undefined
       getUnits(this.form.areaId,id).then(res => {
         this.units = res.data
       })
     },
     getHouses1() {
       this.houses = []
+      this.form.houseId = undefined
       getHouses(this.form.unitId).then(res => {
         this.houses = res.data;
       });
@@ -375,6 +378,9 @@ export default {
     cancel() {
       this.open = false;
       this.reset();
+      this.houses = []
+      this.units = []
+      this.builds = []
     },
     // 表单重置
     reset() {
@@ -384,7 +390,7 @@ export default {
         buildingId: undefined,
         unitId: undefined,
         houseId: undefined,
-        type: 2,
+        type: 1,
         isQualified: undefined,
         isMaintenance: undefined,
         remark: undefined,
@@ -416,10 +422,19 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加安检";
+      this.title = "添加开栓";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      getBuildings(row.areaId).then(res => {
+        this.builds = res.data
+      });
+      getUnits(row.areaId,row.buildingId).then(res => {
+        this.units = res.data
+      })
+      getHouses(row.unitId).then(res => {
+        this.houses = res.data;
+      });
       this.loading = true;
       this.reset();
       const id = row.id || this.ids
@@ -427,7 +442,7 @@ export default {
         this.loading = false;
         this.form = response.data;
         this.open = true;
-        this.title = "修改安检";
+        this.title = "修改开栓";
       });
     },
     /** 提交按钮 */
@@ -458,7 +473,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除安检为"' + ids + '"的数据项?').then(() => {
+      this.$modal.confirm('是否确认删除开栓为"' + ids + '"的数据项?').then(() => {
         this.loading = true;
         return delComprehensive(ids);
       }).then(() => {

+ 28 - 23
src/views/zdsz/opencheck/index.vue

@@ -80,27 +80,26 @@
           v-hasPermi="['zdsz:openbolt:remove']"
         >删除</el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['zdsz:openbolt:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="warning"-->
+      <!--          plain-->
+      <!--          icon="el-icon-download"-->
+      <!--          size="mini"-->
+      <!--          @click="handleExport"-->
+      <!--          v-hasPermi="['zdsz:openbolt:export']"-->
+      <!--        >导出</el-button>-->
+      <!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="comprehensiveList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-<!--      <el-table-column label="" align="center" prop="id" v-if="true"/>-->
+      <!--      <el-table-column label="" align="center" prop="id" v-if="true"/>-->
       <el-table-column label="小区" align="center" prop="areaName" />
       <el-table-column label="楼栋" align="center" prop="buildingName" />
       <el-table-column label="单元" align="center" prop="unitName" />
       <el-table-column label="房间" align="center" prop="houseName" />
-      <el-table-column label="类型" align="center" prop="type" />
       <el-table-column label="安检是否合格" align="center" prop="isQualified">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.pass_check" :value="scope.row.isQualified"/>
@@ -184,7 +183,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="安检是否合格" prop="isQualified">
-<!--          <el-input v-model="form.isQualified" placeholder="请输入安检是否合格" />-->
+          <!--          <el-input v-model="form.isQualified" placeholder="请输入安检是否合格" />-->
           <el-select v-model="form.isQualified" placeholder="请选择安检是否合格" filterable>
             <el-option
               v-for="obj in dict.type.pass_check"
@@ -195,7 +194,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="是否维修" prop="isMaintenance">
-<!--          <el-input v-model="form.isMaintenance" placeholder="请输入是否维修" />-->
+          <!--          <el-input v-model="form.isMaintenance" placeholder="请输入是否维修" />-->
           <el-select v-model="form.isMaintenance" placeholder="请选择是否维修" filterable>
             <el-option
               v-for="obj in dict.type.is_repair"
@@ -225,7 +224,7 @@ import {getAreas} from "@/api/zdsz/area";
 import {getHouses, listHouse} from "@/api/zdsz/house";
 
 export default {
-  name: "openbolt",
+  name: "opencheck",
   dicts:['pass_check','is_repair'],
   data() {
     return {
@@ -305,6 +304,7 @@ export default {
     getBuildings(id) {
       this.units = []
       this.houses = []
+      this.queryParams.buildingId = undefined
       this.queryParams.unitId = undefined
       this.queryParams.houseId = undefined
       getBuildings(id).then(res => {
@@ -314,6 +314,7 @@ export default {
     getUnits(id) {
       this.houses = []
       this.queryParams.unitId = undefined
+      this.queryParams.houseId = undefined
       getUnits(this.queryParams.areaId,id).then(res => {
         this.units = res.data
       })
@@ -334,6 +335,7 @@ export default {
     },
     getHouses() {
       this.houses = []
+      this.queryParams.houseId = undefined
       getHouses(this.queryParams.unitId).then(res => {
         this.houses = res.data;
       });
@@ -341,6 +343,7 @@ export default {
     getBuildings1(id) {
       this.units = []
       this.houses = []
+      this.form.buildingId = undefined
       this.form.unitId = undefined
       this.form.houseId = undefined
       getBuildings(id).then(res => {
@@ -350,12 +353,14 @@ export default {
     getUnits1(id) {
       this.houses = []
       this.form.unitId = undefined
+      this.form.houseId = undefined
       getUnits(this.form.areaId,id).then(res => {
         this.units = res.data
       })
     },
     getHouses1() {
       this.houses = []
+      this.form.houseId = undefined
       getHouses(this.form.unitId).then(res => {
         this.houses = res.data;
       });
@@ -373,9 +378,9 @@ export default {
     cancel() {
       this.open = false;
       this.reset();
-      this.builds = []
-      this.units = []
       this.houses = []
+      this.units = []
+      this.builds = []
     },
     // 表单重置
     reset() {
@@ -421,15 +426,15 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      getHouses().then(res => {
-        this.houses = res.data;
+      getBuildings(row.areaId).then(res => {
+        this.builds = res.data
       });
-      getUnits().then(res => {
+      getUnits(row.areaId,row.buildingId).then(res => {
         this.units = res.data
-      });
-      getBuildings().then(res => {
-        this.builds = res.data
       })
+      getHouses(row.unitId).then(res => {
+        this.houses = res.data;
+      });
       this.loading = true;
       this.reset();
       const id = row.id || this.ids