Browse Source

专业、院校投档线

shilipojs 2 years ago
parent
commit
9c0cd92a44

+ 18 - 14
src/views/career/components/CollegesLine.vue

@@ -19,9 +19,9 @@
     </el-form>
     <el-form label-width="100px" id="universityText">
       <el-form-item label="院校名称:">
-        <div @click="dialongParams.visible=true">
+        <div >
           <el-badge type="info" value="X" class="item" style="cursor: pointer">
-            <el-button>{{formParams.universityRes.name || '添加院校'}}</el-button>
+            <el-button @click="dialongParams.visible=true">{{formParams.universityRes.name || '添加院校'}}</el-button>
           </el-badge>
         </div>
       </el-form-item>
@@ -43,7 +43,7 @@
             <template  slot-scope="scope">
               <div>{{scope.row.marjorName}}</div>
               <div style="color:#9DA0B4;font-size:12px">{{scope.row.marjorDirection}}</div>
-            </template>  
+            </template>
         </el-table-column>
         <el-table-column prop="scoreRealTop" width="90" label="专业最高分" align="center"></el-table-column>
         <el-table-column prop="seatRealTop" label="专业最高分位次" align="center"></el-table-column>
@@ -82,16 +82,11 @@
         examRecordTotal:0,
         year: [],
         types: [],
-        marjorBatchs: [
-          {
-            label:'不限',
-            value:''
-          }
-        ],
+        marjorBatchs: [],
         formParams: {
           year: '2018',
           marjorBatchsRes: '',
-          typeRes: '文科',
+          typeRes: '',
           universityRes:{}
         },
         tableParams:{
@@ -102,10 +97,16 @@
         tableData:[]
       }
     },
+    watch: {
+      'formParams.year':{
+        handler(val) {
+          this.getMarjorTypes()
+          this.getMarjorBatchs()
+        }
+      }
+    },
     created() {
       this.getMarjorYears()
-      this.getMarjorTypes()
-      this.getMarjorBatchs()
     },
     methods: {
       sizeChange(e){
@@ -149,18 +150,21 @@
       },
       getMarjorYears() {
         selectMarjorYears().then(res => {
+          this.formParams.year =res.rows[0]
           this.year = res.rows
         })
       },
       getMarjorTypes() {
         selectMarjorTypes().then(res => {
+          this.formParams.typeRes = res.rows[0]
           this.types = res.rows
         })
       },
       getMarjorBatchs() {
         selectMarjorBatchs().then(res => {
-          // this.marjorBatchs = res.rows
-          this.marjorBatchs =this.marjorBatchs.concat(res.rows)
+          this.formParams.marjorBatchsRes = res.rows[0].value
+          this.marjorBatchs = res.rows
+          // this.marjorBatchs =this.marjorBatchs.concat(res.rows)
         })
       }
     }

+ 5 - 4
src/views/career/components/UniversitiesLine.vue

@@ -78,6 +78,7 @@
     },
     watch: {
       'universityParams.yearRes': {
+        immediate: false,
         handler(val) {
           console.log(val)
           this.getUniversityLevels()
@@ -131,10 +132,10 @@
         selectUniversityYears(params).then(res => {
           this.universityParams.yearRes = res.rows[0]
           this.years = res.rows
-          this.$nextTick(_ => {
-            this.getUniversityTypes()
-            this.getUniversityLevels()
-          })
+          // this.$nextTick(_ => {
+          //   this.getUniversityTypes()
+          //   this.getUniversityLevels()
+          // })
         })
       }
     }

+ 3 - 0
src/views/career/components/UniversitiesLineTable.vue

@@ -65,6 +65,9 @@ export default {
       immediate: true,
       deep: true,
       handler(val) {
+        if (val.levelsRes == '' || val.locationsRes == '' || val.typeRes == '' || val.yearRes == '' ) {
+          return
+        }
         this.tableParams.level = val.levelsRes
         this.tableParams.location = val.locationsRes
         this.tableParams.type = val.typeRes