dedsudiyu преди 5 месеца
родител
ревизия
c5a6a29c92
променени са 2 файла, в които са добавени 69 реда и са изтрити 26 реда
  1. 35 13
      src/views/safetyCheck/collegeInspect/selfInspectionManage/index.vue
  2. 34 13
      src/views/safetyCheck/schoolInspect/inspectManage/index.vue

+ 35 - 13
src/views/safetyCheck/collegeInspect/selfInspectionManage/index.vue

@@ -76,15 +76,25 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item label="" prop="buildId">
-              <el-select v-model="queryParams.buildId" placeholder="楼栋" style="width:150px;">
-                <el-option
-                  v-for="dict in buildOption"
-                  :key="dict.id"
-                  :label="dict.name"
-                  :value="dict.id"
-                />
-              </el-select>
+            <el-form-item label="" prop="floorId">
+              <!--<el-select v-model="queryParams.floorId" placeholder="楼栋" style="width:150px;">-->
+                <!--<el-option-->
+                  <!--v-for="dict in buildOption"-->
+                  <!--:key="dict.id"-->
+                  <!--:label="dict.name"-->
+                  <!--:value="dict.id"-->
+                <!--/>-->
+              <!--</el-select>-->
+
+              <el-cascader
+                style="width: 150px"
+                placeholder="楼栋"
+                v-model="queryParams.floorId"
+                filterable
+                :show-all-levels="false"
+                :options="buildOption"
+                :props="{ value: 'id', label: 'name',emitPath:false }"
+              ></el-cascader>
             </el-form-item>
             <el-form-item label="" prop="typeId" v-if="advancedType">
               <el-select v-model="queryParams.typeId" placeholder="安全分类" style="width:175px;">
@@ -223,7 +233,7 @@
           pageSize:20,
           myRelated:1,
           deptId:null,
-          buildId:null,
+          floorId:null,
           typeId :null,
           levelId :null,
           searchValue:'',
@@ -306,7 +316,7 @@
           page:1,
           pageSize:20,
           deptId:null,
-          buildId:null,
+          floorId:null,
           typeId :null,
           levelId :null,
           searchValue:'',
@@ -347,7 +357,7 @@
           pageSize:this.queryParams.pageSize,
           manageStatus:this.tableButtonCheckType,
           deptId:this.queryParams.deptId,
-          buildId:this.queryParams.buildId,
+          floorId:this.queryParams.floorId,
         }
         if(this.advancedType){
           obj.searchValue = this.queryParams.searchValue;
@@ -410,7 +420,19 @@
       //楼栋下拉列表
       systemBuildingGetOptList(){
         systemBuildingGetOptList({}).then(response => {
-          this.$set(this,'buildOption',response.data);
+          let list = this.handleTree(response.data);
+          pushNode(list)
+          function pushNode(list){
+            for(let i=0;i<list.length;i++){
+              if(!list[i].children && list[i].type!= 3){
+                list.splice(i,1)
+                i--
+              }if(list[i].children){
+                pushNode(list[i].children)
+              }
+            }
+          }
+          this.$set(this,'buildOption',list);
         });
       },
       //分级下拉列表

+ 34 - 13
src/views/safetyCheck/schoolInspect/inspectManage/index.vue

@@ -76,15 +76,24 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item label="" prop="buildId">
-              <el-select v-model="queryParams.buildId" placeholder="楼栋" style="width:150px;">
-                <el-option
-                  v-for="dict in buildOption"
-                  :key="dict.id"
-                  :label="dict.name"
-                  :value="dict.id"
-                />
-              </el-select>
+            <el-form-item label="" prop="floorId">
+              <!--<el-select v-model="queryParams.floorId" placeholder="楼栋" style="width:150px;">-->
+                <!--<el-option-->
+                  <!--v-for="dict in buildOption"-->
+                  <!--:key="dict.id"-->
+                  <!--:label="dict.name"-->
+                  <!--:value="dict.id"-->
+                <!--/>-->
+              <!--</el-select>-->
+              <el-cascader
+                style="width: 150px"
+                placeholder="楼栋"
+                v-model="queryParams.floorId"
+                filterable
+                :show-all-levels="false"
+                :options="buildOption"
+                :props="{ value: 'id', label: 'name',emitPath:false }"
+              ></el-cascader>
             </el-form-item>
             <el-form-item label="" prop="typeId" v-if="advancedType">
               <el-select v-model="queryParams.typeId" placeholder="安全分类" style="width:175px;">
@@ -222,7 +231,7 @@
           pageSize:20,
           myRelated:1,
           deptId:null,
-          buildId:null,
+          floorId:null,
           typeId :null,
           levelId :null,
           searchValue:'',
@@ -305,7 +314,7 @@
           page:1,
           pageSize:20,
           deptId:null,
-          buildId:null,
+          floorId:null,
           typeId :null,
           levelId :null,
           searchValue:'',
@@ -346,7 +355,7 @@
           pageSize:this.queryParams.pageSize,
           manageStatus:this.tableButtonCheckType,
           deptId:this.queryParams.deptId,
-          buildId:this.queryParams.buildId,
+          floorId:this.queryParams.floorId,
         }
         if(this.advancedType){
           obj.searchValue = this.queryParams.searchValue;
@@ -409,7 +418,19 @@
       //楼栋下拉列表
       systemBuildingGetOptList(){
         systemBuildingGetOptList({}).then(response => {
-          this.$set(this,'buildOption',response.data);
+          let list = this.handleTree(response.data);
+          pushNode(list)
+          function pushNode(list){
+            for(let i=0;i<list.length;i++){
+              if(!list[i].children && list[i].type!= 3){
+                list.splice(i,1)
+                i--
+              }if(list[i].children){
+                pushNode(list[i].children)
+              }
+            }
+          }
+          this.$set(this,'buildOption',list);
         });
       },
       //分级下拉列表