dedsudiyu před 2 týdny
rodič
revize
0a4a7baf7b

+ 15 - 16
src/views/safetyEducationExaminationNew/examManagement/examinationResult/academicPerformance.vue

@@ -11,21 +11,15 @@
           <!--</el-select>-->
         <!--</el-form-item>-->
         <el-form-item label="" prop="deptId" v-if="adminType == 1">
-          <el-cascader
-            style="width: 180px"
-            v-model="queryParams.deptId"
-            :options="optionListA"
-            :props="{
-                    emitPath:false,
-                    checkStrictly: true,
-                    value: 'deptId',
-                    label: 'deptName',
-                    children: 'child',
-                  }"
-            :show-all-levels="false"
-            filterable
-            placeholder="学院单位"
-          ></el-cascader>
+          <el-select @change="queryParamsChange"
+                     clearable v-model="queryParams.deptId" placeholder="学院单位" style="width: 180px">
+            <el-option
+              v-for="dict in optionListA"
+              :key="dict.deptId"
+              :label="dict.deptName"
+              :value="dict.deptId"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="" prop="keyword">
           <el-input
@@ -107,6 +101,7 @@
 
     },
     mounted() {
+      this.$set(this.queryParams,'deptId',this.drawerPropsData.deptId);
       this.systemUserGetPost();
     },
     methods: {
@@ -179,7 +174,11 @@
         systemDeptCurrentDept({}).then(response => {
           const list = response.data || [];
           this.formatTreeData(list);
-          this.$set(this,'optionListA',list);
+          if(list[0]){
+            this.$set(this,'optionListA',list[0].child);
+          }else{
+            this.$set(this,'optionListA',[]);
+          }
         });
       },
     }

+ 23 - 19
src/views/safetyEducationExaminationNew/examManagement/examinationResult/index.vue

@@ -16,21 +16,15 @@
             </el-select>
           </el-form-item>
           <el-form-item label="" prop="deptId" v-if="adminType == 1">
-            <el-cascader
-              style="width: 180px"
-              v-model="queryParams.deptId"
-              :options="optionListB"
-              :props="{
-                    emitPath:false,
-                    checkStrictly: true,
-                    value: 'deptId',
-                    label: 'deptName',
-                    children: 'child',
-                  }"
-              :show-all-levels="false"
-              filterable
-              placeholder="学院单位"
-            ></el-cascader>
+            <el-select @change="queryParamsChange"
+                       clearable v-model="queryParams.deptId" placeholder="学院单位" style="width: 180px">
+              <el-option
+                v-for="dict in optionListB"
+                :key="dict.deptId"
+                :label="dict.deptName"
+                :value="dict.deptId"
+              />
+            </el-select>
           </el-form-item>
           <el-form-item label="" prop="examTypeId">
             <el-select v-model="queryParams.examTypeId" placeholder="考试类型" style="width: 160px">
@@ -180,6 +174,7 @@
         drawerType: '',
         drawer: false,
         drawerPropsData:{},
+        checkDeptId:'',
       }
     },
     created () {
@@ -253,12 +248,13 @@
           makeup :null,
           searchValue :'',
         });
+        this.$set(this,'checkDeptId','');
         this.getList();
       },
       //获取数据列表
       getList(){
-
         let obj = JSON.parse(JSON.stringify(this.queryParams))
+        this.$set(this,'checkDeptId',this.queryParams.deptId);
         if(this.dateRange[0]){
           obj.startTime = this.dateRange[0]+'T00:00:00'
           obj.endTime = this.dateRange[1]+'T23:59:59'
@@ -285,13 +281,17 @@
           this.$set(this, 'drawerTitle', '查看成绩-'+row.examName)
           this.$set(this, 'drawerType', 1)
           this.$set(this, 'drawer', true)
-          this.$set(this, 'drawerPropsData', row)
+          let obj = row
+          obj.deptId = this.checkDeptId;
+          this.$set(this, 'drawerPropsData', obj)
         }else if(type == 2){
           // TODO: 学习情况
           this.$set(this, 'drawerTitle', '学习情况-'+row.examName)
           this.$set(this, 'drawerType', 2)
           this.$set(this, 'drawer', true)
-          this.$set(this, 'drawerPropsData', row)
+          let obj = row
+          obj.deptId = this.checkDeptId;
+          this.$set(this, 'drawerPropsData', obj)
         }
       },
       //学年下拉列表
@@ -311,7 +311,11 @@
         systemDeptCurrentDept({}).then(response => {
           const list = response.data || [];
           this.formatTreeData(list);
-          this.$set(this,'optionListB',list);
+          if(list[0]){
+            this.$set(this,'optionListB',list[0].child);
+          }else{
+            this.$set(this,'optionListB',[]);
+          }
         });
       },
     },

+ 15 - 16
src/views/safetyEducationExaminationNew/examManagement/examinationResult/viewGrades.vue

@@ -5,21 +5,15 @@
       <el-form :model="queryParams" class="form-box" ref="queryForm"
                :inline="true" style="width:100%;">
         <el-form-item label="" prop="deptId" v-if="adminType == 1">
-          <el-cascader
-            style="width: 180px"
-            v-model="queryParams.deptId"
-            :options="optionListA"
-            :props="{
-                    emitPath:false,
-                    checkStrictly: true,
-                    value: 'deptId',
-                    label: 'deptName',
-                    children: 'child',
-                  }"
-            :show-all-levels="false"
-            filterable
-            placeholder="学院单位"
-          ></el-cascader>
+          <el-select @change="queryParamsChange"
+                     clearable v-model="queryParams.deptId" placeholder="学院单位" style="width: 180px">
+            <el-option
+              v-for="dict in optionListA"
+              :key="dict.deptId"
+              :label="dict.deptName"
+              :value="dict.deptId"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="" prop="academicYear">
           <el-select v-model="queryParams.academicYear" placeholder="年级" style="width: 120px">
@@ -178,6 +172,7 @@
 
     },
     mounted() {
+      this.$set(this.queryParams,'deptId',this.drawerPropsData.deptId);
       this.systemUserGetPost();
     },
     methods: {
@@ -269,7 +264,11 @@
         systemDeptCurrentDept({}).then(response => {
           const list = response.data || [];
           this.formatTreeData(list);
-          this.$set(this,'optionListA',list);
+          if(list[0]){
+            this.$set(this,'optionListA',list[0].child);
+          }else{
+            this.$set(this,'optionListA',[]);
+          }
         });
       },
       //学年下拉列表