Forráskód Böngészése

整合投档线 --修复选科查询

shilipojs 2 éve
szülő
commit
3c3b39ecef

+ 5 - 5
src/components/MxCondition/condition-object/condition-shiftline-level.js

@@ -3,19 +3,19 @@ import {
   selectUniversityLevels,
 } from '@/api/webApi/shiftLine'
 
-// 院校投档线  地域
+// 院校投档线  层次
 export default {
   ...conditionObjectBase,
-  dependentKeys: ['universityLocation'],
-  key: 'universityLevel',
+  dependentKeys: ['lineYear'],
+  key: 'lineLevel',
   isDependencyReady(params) {
-    return params.universityLocation
+    return params.lineYear
   },
   title: '层次',
   getList: function(param) {
     return new Promise((resolve, reject) => {
       selectUniversityLevels({
-        location: param.universityLocation
+        year: param.lineYear
       }).then(res => resolve(res.rows))
         .catch(e => reject(e))
     })

+ 2 - 2
src/components/MxCondition/condition-object/condition-shiftline-university.js → src/components/MxCondition/condition-object/condition-shiftline-location.js

@@ -6,8 +6,8 @@ import {
 // 院校投档线  地域
 export default {
   ...conditionObjectBase,
-  key: 'universityLocation',
-  title: '地',
+  key: 'lineLocation',
+  title: '所在地',
   getList: function(param) {
     return new Promise((resolve, reject) => {
       selectUniversityLocations().then(res => resolve(res.rows))

+ 5 - 5
src/components/MxCondition/condition-object/condition-shiftline-type.js

@@ -3,19 +3,19 @@ import {
   selectUniversityTypes,
 } from '@/api/webApi/shiftLine'
 
-// 院校投档线  地域
+// 院校投档线  科类
 export default {
   ...conditionObjectBase,
-  dependentKeys: ['universityLocation'],
-  key: 'universityType',
+  dependentKeys: ['lineYear'],
+  key: 'lineType',
   isDependencyReady(params) {
-    return params.universityLocation
+    return params.lineYear
   },
   title: '科类',
   getList: function(param) {
     return new Promise((resolve, reject) => {
       selectUniversityTypes({
-        location: param.universityLocation
+        year: param.lineYear
       }).then(res => resolve(res.rows))
         .catch(e => reject(e))
     })

+ 3 - 11
src/components/MxCondition/condition-object/condition-shiftline-year.js

@@ -3,22 +3,14 @@ import {
   selectUniversityYears
 } from '@/api/webApi/shiftLine'
 
-// 院校投档线  地域
+// 院校投档线  年份
 export default {
   ...conditionObjectBase,
-  dependentKeys: ['universityLocation','universityType','universityLevel'],
-  key: 'universityYear',
-  isDependencyReady(params) {
-    return params.universityLocation && params.universityType && params.universityLevel
-  },
+  key: 'lineYear',
   title: '年份',
   getList: function(param) {
     return new Promise((resolve, reject) => {
-      selectUniversityYears({
-        location: param.universityLocation,
-        level: param.universityLevel,
-        type: param.universityType
-      }).then(res => resolve(res.rows))
+      selectUniversityYears().then(res => resolve(res.rows))
         .catch(e => reject(e))
     })
   },

+ 6 - 6
src/views/career/components/MajorChoiceDialog.vue

@@ -19,11 +19,11 @@
           <div class="popup-item">
             <div class="popup-item-title">院校特色<span>(可多选)</span></div>
             <div class="popup-item-content">
-              <el-checkbox-group v-model="selectCharacteristic">
+              <el-checkbox-group v-model="features">
                 <el-checkbox
                   class="check-box-item"
                   :label="item"
-                  v-for="(item, index) in characteristicList"
+                  v-for="(item, index) in featuresList"
                   :key="index"
                   >{{ item }}</el-checkbox
                 >
@@ -165,10 +165,10 @@ export default {
       isShowTable: true,
       locationsList: [],
       typesList: [],
-      characteristicList: [],
+      featuresList: [],
       selectLocation: [], //地区
       selectTypes: [], //类别
-      selectCharacteristic: [], //选中的特色
+      features: [], //选中的特色
       marjorsList: [],
       marjorsList2: [],
       marjorsList3: [],
@@ -278,7 +278,7 @@ export default {
       universityFilters({}).then(({ data }) => {
         this.locationsList = data.locations;
         this.typesList = data.types;
-        this.characteristicList = data.features;
+        this.featuresList = data.features;
       });
     },
     httpCollectAdd(row) {
@@ -335,7 +335,7 @@ export default {
       this.checkData();
     },
     checkData(cb) {
-      this.$emit("onMajorChoiced", {locations:this.selectLocation, ts:this.selectCharacteristic, types:this.selectTypes})
+      this.$emit("onMajorChoiced", {locations:this.selectLocation, features:this.features, types:this.selectTypes})
     },
     httpGetXkcxList() {
       xkcxlist({

+ 64 - 170
src/views/career/components/UniversitiesLine.vue

@@ -1,48 +1,10 @@
 <template>
   <div>
     <div style="background-color: #ffffff;font-size: 14px;padding:5px;">
-      <!-- 录取年份 -->
-      <el-row class="radioInput">
-        <div>
-          <span class="radiaTitle">录 取 年 份:</span>
-        </div>
-        <el-radio-group v-model="universityParams.year">
-          <el-radio-button v-for="item in years" :key="item" :label="item"
-                           style="margin-bottom:10px"></el-radio-button>
-        </el-radio-group>
-      </el-row>
-      <!-- 科类 -->
-      <el-row class="radioInput">
-        <div>
-          <span class="radiaTitle">科 类:</span>
-        </div>
-        <el-radio-group v-model="universityParams.type">
-          <el-radio-button label="">所有</el-radio-button>
-          <el-radio-button v-for="item in types" :key="item" :label="item"
-                           style="margin-bottom:10px"></el-radio-button>
-        </el-radio-group>
-      </el-row>
-      <!--层次-->
-      <el-row class="radioInput">
-        <div>
-          <span class="radiaTitle">层 次:</span>
-        </div>
-        <el-radio-group v-model="universityParams.level">
-          <el-radio-button label="">所有</el-radio-button>
-          <el-radio-button v-for="item in levels" :key="item" :label="item"
-                           style="margin-bottom:10px"></el-radio-button>
-        </el-radio-group>
-      </el-row>
-      <!--地区-->
-      <el-row class="radioInput">
-        <div>
-          <span class="radiaTitle">院校所在地:</span>
-        </div>
-        <el-radio-group v-model="universityParams.location">
-          <el-radio-button v-for="item in locations" :key="item" :label="item"
-                           style="margin-bottom:10px"></el-radio-button>
-        </el-radio-group>
-      </el-row>
+      <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
+                    @invalid="handleInvalidQuery"
+      ></mx-condition>
+      <mx-search-group :span="7" v-model="queryParams.univerName"></mx-search-group>
       <mx-search-group class="mb10" justify="end" :span="6" v-model="name" placeholder="请输入名称" @search="toGetList"
       ></mx-search-group>
       <!-- 表格数据 -->
@@ -56,143 +18,75 @@
 </template>
 
 <script>
-import {
-  selectUniversityLocations,
-  selectUniversityLevels,
-  selectUniversityTypes,
-  selectUniversityYears, selectUniversityList
-} from '@/api/webApi/shiftLine'
-  import UniversitiesLineTable from '@/views/career/components/UniversitiesLineTable'
-  import MxSearchGroup from '@/components/MxSearch/mx-search-group'
+import { selectUniversityList } from '@/api/webApi/shiftLine'
+import UniversitiesLineTable from '@/views/career/components/UniversitiesLineTable'
+import MxSearchGroup from '@/components/MxSearch/mx-search-group'
+import MxCondition from '@/components/MxCondition/mx-condition'
+
 import { mapGetters } from 'vuex'
 
-  export default {
-    name: "UniversitiesLine",
-    components: {UniversitiesLineTable,MxSearchGroup},
-    data() {
-      return {
-        locations: [],//所在地
-        levels: [],
-        types: [],
-        years: [],
-        universityParams: {
-          location: '',
-          level: '',
-          type: '',
-          year: '',
-          univerName:''
-        },
-        name:'',
-        tableLoading:false,
-        total:0,
-        tableList:[],
-        pageForm:{
-          pageSize:10,
-          pageNum:1
-        }
-      }
-    },
-    watch: {
-      'universityParams.year': {
-        immediate: false,
-        handler(val) {
-          this.getUniversityLevels()
-          this.getUniversityTypes()
-        }
+export default {
+  name: 'UniversitiesLine',
+  components: { UniversitiesLineTable, MxSearchGroup, MxCondition },
+  data() {
+    return {
+      requireFields: ['lineYear', 'lineLocation'],
+      queryParams: {
+        lineYear: '',
+        lineLevel: '',
+        lineType: '',
+        lineLocation: '',
+        univerName: ''
       },
-      universityParams:{
-        immediate: true,
-        deep:true,
-        handler(val) {
-          if(val.year && val.location){
-            this.getUniversityList()
-          }
-        }
+      name: '',
+      tableLoading: false,
+      total: 0,
+      tableList: [],
+      pageForm: {
+        pageSize: 10,
+        pageNum: 1
       }
+    }
+  },
+  created() {
+    this.queryParams.lineLocation = this.currentUser.provinceName
+  },
+  computed: {
+    ...mapGetters(['currentUser'])
+  },
+  methods: {
+    handleQuery() {
+      this.pageForm.pageNum = 1
+      this.getUniversityList()
     },
-    computed:{
-      ...mapGetters(['currentUser']),
+    handleInvalidQuery() {
+
     },
-    created() {
-      this.getUniversityLocations()
-      this.getUniversityYears()
+    toGetList() {
+      this.universityParams.univerName = this.name
     },
-    methods: {
-      toGetList() {
-        this.universityParams.univerName = this.name
-      },
-      getUniversityLocations() {
-        selectUniversityLocations().then(res => {
-          this.universityParams.location = this.currentUser.provinceName
-          this.locations = res.rows
-        })
-      },
-      async getUniversityLevels() {
-        const params = {
-          year: this.universityParams.year,
-        }
-        await selectUniversityLevels(params).then(res => {
-          this.levels = res.rows
-        })
-      },
-      async getUniversityTypes() {
-        const params = {
-          year: this.universityParams.year,
-        }
-          await selectUniversityTypes(params).then(res => {
-          this.types = res.rows
-        })
-      },
-      getUniversityYears() {
-        selectUniversityYears().then(res => {
-          this.universityParams.year = res.rows[0]
-          this.years = res.rows
-        })
-      },
-      async getUniversityList() {
-        this.tableLoading = true
-        await selectUniversityList({ ...this.universityParams,...this.pageForm }).then(res => {
-          console.log(res)
-          this.tableList = res.rows
-          this.total = res.total
-        }).finally(_ => {
-          this.tableLoading = false
-        })
-      }
+    async getUniversityList() {
+      this.tableLoading = true
+      await selectUniversityList({
+        year: this.queryParams.lineYear,
+        level:this.queryParams.lineLevel,
+        type:this.queryParams.lineType,
+        location:this.queryParams.lineLocation,
+        univerName: this.queryParams.univerName,
+        ...this.pageForm
+      }).then(res => {
+        this.tableList = res.rows
+        this.total = res.total
+      }).finally(_ => {
+        this.tableLoading = false
+      })
     }
   }
+}
 </script>
 
-<style lang="scss">
-  .radioInput {
-    .el-radio {
-      .el-radio__input {
-        display: none;
-      }
-    }
-  }
-
-  .radioInput {
-    display: flex;
-    margin-top: 5px;
-    .el-radio-button .el-radio-button__inner {
-      border-radius: 4px !important;
-      border: none;
-      padding: 5px 10px !important;
-      font-weight: 400;
-      font-family: PingFangSC-Regular, PingFang SC;
-    }
-
-    .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-      box-shadow: none;
-    }
-
-    .radiaTitle {
-      display: inline-block;
-      width: 130px;
-      font-size: 14px;
-      text-align: right;
-      margin-top: 2px;
-    }
-  }
+<style scoped>
+/*>>> .el-form-item__label{*/
+/*  width: 120px !important;*/
+/*}*/
 </style>

+ 115 - 99
src/views/career/subject/majorChoice.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="major-page">
-      <evaluation-title class="mt10  box-card"
-                        navBackButton
-                        title="由专业选科目"
-                        :navAction="back"
-      ></evaluation-title>
+    <evaluation-title class="mt10  box-card"
+                      navBackButton
+                      title="由专业选科目"
+                      :navAction="back"
+    ></evaluation-title>
     <div class="content-box">
       <div class="xkcx-input-box">
         <div>
@@ -47,7 +47,8 @@
         </div>
       </div>
 
-      <major-choice-dialog :isShowSchoolPopup="isShowSchoolPopup" v-on:onMajorChoiced="onMajorChoiced"></major-choice-dialog>
+      <major-choice-dialog :isShowSchoolPopup="isShowSchoolPopup" v-on:onMajorChoiced="onMajorChoiced"
+      ></major-choice-dialog>
 
       <div class="popup-box major-box">
         <div class="popup-select">
@@ -138,9 +139,10 @@
 </template>
 
 <script>
-import {xkcxYears, collectAdd, collectRemove, marjorsList, xkcxlistByMarjors} from "@/api/webApi/webQue";
+import { collectAdd, collectRemove, marjorsList, xkcxlistByMarjors, xkcxYears } from '@/api/webApi/webQue'
+
+import MajorChoiceDialog from '../components/MajorChoiceDialog.vue'
 
-import MajorChoiceDialog from "../components/MajorChoiceDialog.vue";
 export default {
   components: { MajorChoiceDialog },
   data() {
@@ -148,53 +150,52 @@ export default {
       selected: {
         yearList: [],
         selectNian: '',
-        marjorsType: "本科",
+        marjorsType: '本科',
         marjorsLevel: 1,
-        marjorsCode: "",
+        marjorsCode: '',
         marjorsList: {
           one: [], two: [], three: []
         },
         curMarjors: {
-          one: "", two: "", three: []
+          one: '', two: '', three: []
         },
         locations: [],
-        ts: [],
+        features: [],
         types: []
       },
-      dataList: [
-      ],
+      dataList: [],
       propDefines: {
         universityName: {
-          label: "院校名称",
+          label: '院校名称'
         },
         marjorName: {
-          label: "专业(类)名称",
+          label: '专业(类)名称'
         },
         marjorBelongs: {
-          label: "专业备注",
-          align: "left",
+          label: '专业备注',
+          align: 'left'
         },
         level: {
-          label: "专业层次",
+          label: '专业层次'
         },
         courseRemark0: {
-          label: "首选科目范围",
-          align: "left",
+          label: '首选科目范围',
+          align: 'left'
         },
         courseRemark1: {
-          label: "再选科目范围",
-          align: "left",
+          label: '再选科目范围',
+          align: 'left'
         },
         year: {
-          label: "年份",
-          align: "left",
+          label: '年份',
+          align: 'left'
         },
         collect: {
-          label: "选择",
-          align: "left",
-          slot: "select",
-          width: "100px",
-        },
+          label: '选择',
+          align: 'left',
+          slot: 'select',
+          width: '100px'
+        }
       },
       selectIds: [],
       pageNum: 1,
@@ -203,11 +204,11 @@ export default {
       keyword: '',
       isShowSchoolPopup: false,
       isShowMajorPopup: false
-    };
+    }
   },
   created() {
-    this.httpGetXkcxYears();
-    this.httpGetMarjorsList();
+    this.httpGetXkcxYears()
+    this.httpGetMarjorsList()
   },
   methods: {
     back() {
@@ -215,138 +216,138 @@ export default {
     },
     httpGetXkcxYears() {
       xkcxYears().then((res) => {
-        this.selected.yearList = res.data || [];
+        this.selected.yearList = res.data || []
         this.selected.selectNian = this.selected.yearList[0]
-      });
+      })
     },
     onChangeYear(res) {
       //切换学年时,取第1页
-      this.pageNum = 1;
-      this.httpGetMarjorsList();
+      this.pageNum = 1
+      this.httpGetMarjorsList()
     },
     onChangeSchoolPopup() {
-      this.isShowSchoolPopup = !this.isShowSchoolPopup;
+      this.isShowSchoolPopup = !this.isShowSchoolPopup
     },
     onChangeMajorPopup() {
-      this.isShowMajorPopup = !this.isShowMajorPopup;
+      this.isShowMajorPopup = !this.isShowMajorPopup
     },
     onMajorChoiced(choice) {
-      console.log(choice);
-      this.isShowSchoolPopup = false;
+      console.log(choice)
+      this.isShowSchoolPopup = false
 
-      this.selected.locations = choice.locations;
-      this.selected.ts = choice.ts;
-      this.selected.types = choice.types;
+      this.selected.locations = choice.locations
+      this.selected.features = choice.features
+      this.selected.types = choice.types
 
-      this.httpGetXkcxList();
+      this.httpGetXkcxList()
     },
 
     clickMarjorsType(type) {
-      this.selected.marjorsType = type;
-      this.selected.marjorsLevel = 1;
-      this.selected.marjorsCode = "";
-      this.httpGetMarjorsList();
+      this.selected.marjorsType = type
+      this.selected.marjorsLevel = 1
+      this.selected.marjorsCode = ''
+      this.httpGetMarjorsList()
     },
     onSelectMarjorsAll(res) {
       if (res) {
-        this.selected.curMarjors.three.push('全选');
-        let len = this.selected.marjorsList.three.length;
+        this.selected.curMarjors.three.push('全选')
+        let len = this.selected.marjorsList.three.length
         for (let i = 0; i < len; i++) {
-          let name = this.selected.marjorsList.three[i]["name"];
-          let index = this.selected.curMarjors.three.indexOf(name);
+          let name = this.selected.marjorsList.three[i]['name']
+          let index = this.selected.curMarjors.three.indexOf(name)
           if (index < 0) {
-            this.selected.curMarjors.three.push(name);
+            this.selected.curMarjors.three.push(name)
           }
         }
       } else {
-        this.selected.curMarjors.three = [];
+        this.selected.curMarjors.three = []
       }
     },
     changeMajor(res) {
-      this.selected.curMarjors.three = [];
+      this.selected.curMarjors.three = []
       switch (res.level) {
         case 1:
-          this.selected.curMarjors.one = res;
-          break;
+          this.selected.curMarjors.one = res
+          break
         case 2:
-          this.selected.curMarjors.two = res;
-          break;
+          this.selected.curMarjors.two = res
+          break
       }
-      this.selected.marjorsCode = res.code;
-      this.selected.marjorsLevel = res.level + 1;
-      this.httpGetMarjorsList();
+      this.selected.marjorsCode = res.code
+      this.selected.marjorsLevel = res.level + 1
+      this.httpGetMarjorsList()
     },
     httpGetMarjorsList() {
       marjorsList({
         type: this.selected.marjorsType,
         level: this.selected.marjorsLevel,
-        code: this.selected.marjorsCode,
+        code: this.selected.marjorsCode
       }).then((res) => {
         switch (this.selected.marjorsLevel) {
           case 2:
-            this.selected.marjorsList.two = res.rows;
-            this.changeMajor(res.rows[0]);
-            break;
+            this.selected.marjorsList.two = res.rows
+            this.changeMajor(res.rows[0])
+            break
           case 3:
-            this.selected.marjorsList.three = res.rows;
-            this.onSelectMarjorsAll(res.rows);
-            this.httpGetXkcxList();
-            break;
+            this.selected.marjorsList.three = res.rows
+            this.onSelectMarjorsAll(res.rows)
+            this.httpGetXkcxList()
+            break
           default:
-            this.selected.marjorsList.one = res.rows;
-            this.changeMajor(res.rows[0]);
-            break;
+            this.selected.marjorsList.one = res.rows
+            this.changeMajor(res.rows[0])
+            break
         }
-      });
+      })
     },
     // 查询结果
     httpGetXkcxList() {
-      if (this.selected.curMarjors.three.length<1) return;
-
+      if (this.selected.curMarjors.three.length < 1) return
+      console.log(this.selected)
       //console.log(this.selected);return;
       xkcxlistByMarjors({
-        level:this.selected.marjorsType.toString(),
+        level: this.selected.marjorsType.toString(),
         keyword: this.keyword,
         year: this.selected.selectNian.toString(),
-        marjors: this.selected.curMarjors.one.name + "," + this.selected.curMarjors.two.name + "," + this.selected.curMarjors.three.join(","),
+        marjors: this.selected.curMarjors.one.name + ',' + this.selected.curMarjors.two.name + ',' + this.selected.curMarjors.three.join(','),
         locations: this.selected.locations.toString(),
-        ts: this.selected.ts.toString(),
+        features: this.selected.features.toString(),
         types: this.selected.types.toString(),
         pageNum: this.pageNum,
-        pageSize: this.pageSize,
+        pageSize: this.pageSize
       })
         .then((res) => {
-          this.dataList = res.rows;
-          this.total = res.total;
-          this.isShowTable = true;
+          this.dataList = res.rows
+          this.total = res.total
+          this.isShowTable = true
         })
         .catch((err) => {
-          console.log("请求出错!");
-          this.cleanSchoolSelect();
-        });
+          console.log('请求出错!')
+          this.cleanSchoolSelect()
+        })
     },
 
     onChangePage(page) {
-      this.pageSize = page.limit;
-      this.pageNum = page.page;
-      this.httpGetXkcxList();
+      this.pageSize = page.limit
+      this.pageNum = page.page
+      this.httpGetXkcxList()
     },
     // 收藏
     httpCollectAdd(row) {
-      row.collect = true;
+      row.collect = true
       collectAdd({
-        refId: row.id,
-      });
+        refId: row.id
+      })
     },
     // 取消收藏
     httpCollectRemove(row) {
-      row.collect = false;
+      row.collect = false
       collectRemove({
-        refId: row.id,
-      });
-    },
-  },
-};
+        refId: row.id
+      })
+    }
+  }
+}
 </script>
 
 
@@ -359,9 +360,11 @@ export default {
   background-color: #fff;
   box-shadow: 0 1px 2px 0 rgb(0 0 0);
 }
+
 .content-box {
   padding: 10px 40px 10px 50px;
 }
+
 .major-list-title span {
   color: #d28140;
 }
@@ -369,9 +372,11 @@ export default {
 el-button {
   padding: 9px 20px;
 }
+
 .button-school {
   margin: 0 10px;
 }
+
 .el-icon-my-button {
   background: url(../../../assets/images/subject/icon_shaixuan.png) center no-repeat;
   background-size: cover;
@@ -388,22 +393,27 @@ el-button {
   display: flex;
   margin-bottom: 30px;
 }
+
 .popup-select {
   border-right: 1px solid #d7d7d7;
 }
+
 .popup-select-item {
   cursor: pointer;
   line-height: 30px;
   width: 100px;
   padding: 0 20px 0 30px;
 }
+
 .popup-select-item.active {
   color: #47c6a2;
   border-right: 2px solid #47c6a2;
 }
+
 .choice-box {
   display: flex;
 }
+
 .choice-item {
   margin: 0 10px;
   min-width: 300px;
@@ -412,13 +422,16 @@ el-button {
   overflow-x: hidden;
   overflow-y: auto;
 }
+
 .choice-item-menv {
   margin: 15px 20px;
   cursor: pointer;
 }
+
 .choice-item-menv.active {
   color: #47c6a2;
 }
+
 .choice-item-checkbox {
   padding: 10px 20px;
   width: 100%;
@@ -432,6 +445,7 @@ el-button {
   margin-bottom: 20px;
   border-bottom: 2px solid #47c6a2;
 }
+
 .search_header {
   margin-left: auto;
   display: flex;
@@ -441,12 +455,14 @@ el-button {
   position: relative;
   margin-right: 20px;
 }
+
 .search_header img {
   position: absolute;
   right: 20px;
   cursor: pointer;
   top: 6px;
 }
+
 .search_header input {
   background: #f7f7ff;
   border-radius: 20px;

+ 2 - 1
src/views/career/zhiyuan/batch.vue

@@ -89,7 +89,8 @@ export default {
   },
   methods: {
     handleQuery() {
-        this.getBatchList()
+      this.pageForm.pageNum = 1;
+      this.getBatchList()
     },
     handleInvalidQuery() {
       console.log('query出错')