Procházet zdrojové kódy

模拟志愿列表

shilipojs před 2 roky
rodič
revize
344722c6b1

+ 18 - 0
src/api/webApi/professlib.js

@@ -47,3 +47,21 @@ export function getProfesslibDetails(params) {
     params:params
   })
 }
+
+// 获取推荐志愿
+export function getRecommendVoluntary(data) {
+  return request({
+    url: 'front/syzy/zytb/getRecommendVoluntary',
+    method: 'post',
+    data:data
+  })
+}
+
+// 获取推荐志愿明细
+export function getVoluntaryMarjors(data) {
+  return request({
+    url: 'front/syzy/zytb/getVoluntaryMarjors',
+    method: 'post',
+    data:data
+  })
+}

+ 58 - 24
src/views/career/zhiyuan/components/recommend.vue

@@ -58,13 +58,14 @@
       </div>
     </div>
     <div class="zhiyuan-list">
-      <mx-table :propDefines="propDefines" :rows="rows"></mx-table>
+      <zhiyuan-list :tableList="rows" @expand="expand"></zhiyuan-list>
     </div>
   </div>
 </template>
 <script>
 import FilterForm from '@/views/career/components/FilterForm';
-import { allMajor } from '@/api/webApi/professlib'
+import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list';
+import { allMajor,getRecommendVoluntary,getVoluntaryMarjors } from '@/api/webApi/professlib'
 export default {
   props: {
     formSubject: {
@@ -77,7 +78,8 @@ export default {
     }
   },
   components:{
-    FilterForm
+    FilterForm,
+    ZhiyuanList
   },
   data() {
     return {
@@ -100,32 +102,13 @@ export default {
           { label: '保守型', value: '2' }
         ]
       },
-      rows: [{}],
-      propDefines: {
-        name: {
-          label: '院校名称'
-        },
-        local: {
-          label: '所在地'
-        },
-        subject: {
-          label: '选科要求'
-        },
-        count: {
-          label: '招生人数'
-        },
-        year: {
-          label: '年份'
-        },
-        action: {
-          label: '填报'
-        }
-      },
+      rows: [],
     }
   },
   created() {
     this.$nextTick(_ => {
       this.getAllMajor()
+      this.getList()
     })
   },
   computed: {
@@ -167,6 +150,57 @@ export default {
     },
   },
   methods: {
+    expand(item) {
+      if(item.isExpand) {
+        // 取消
+        return
+      }
+      this.getVoluntaryMarjors(item)
+    },
+    getList() {
+      const params = {
+        batchName: this.batch.name,
+        majors: this.checkedList,
+        mode: this.formSubject.firstSubject,
+        // "mode1": "string",
+        pickType:  this.filter_form.pickType,
+        // "rank": 0,
+        score: this.formSubject.score,
+        university: {
+          // "code": "string",
+          features: this.filter_form.features,
+          level: this.filter_form.level,
+          location: this.filter_form.location,
+          type: this.filter_form.type,
+          natureTypeCN: this.filter_form.natureTypeCN,
+          // "status": 0,
+          // "type": "string"
+        },
+      }
+      getRecommendVoluntary(params).then(res =>{
+        console.log(res)
+        const rows = res.data.map(item => {
+          item.isExpand = false
+          item.majors = []
+          return item
+        })
+        this.rows = rows
+      })
+    },
+    getVoluntaryMarjors(item) {
+      getVoluntaryMarjors(
+        {
+          batchName: this.batch.name,
+          collegeCode: item.recruitPlan.collegeCode,
+          mode: this.formSubject.firstSubject,
+          universityId: item.recruitPlan.universityId,
+          wishOnly: true,
+          year: item.recruitPlan.year,}
+      ).then(res => {
+        item.majors = res.data
+        console.log(res)
+      })
+    },
     handleClose(item) {
       const index = this.checkedList.findIndex(code => code == item.code)
       this.checkedList.splice(index,1)

+ 132 - 0
src/views/career/zhiyuan/components/zhiyuan-list.vue

@@ -0,0 +1,132 @@
+<template>
+  <el-table
+    :data="tableList"
+    @expand-change="expand"
+  >
+    <el-table-column
+      type="expand"
+    >
+      <template scope="scope">
+        <el-table
+          :data="scope.row.majors"
+          :show-header="false"
+        >
+          <el-table-column>
+                  <template scope="major">
+                    <div>
+                      <p class="mb10"><span class="pointer">{{major.row.marjorName}}</span></p>
+                           <p class="f-9b f12">代码 {{major.row.marjorBelongs}}</p>
+                    </div>
+                  </template>
+          </el-table-column>
+          <el-table-column>
+            <template scope="major">
+              <div>
+                <p><span class="f18">{{ major.row.planCount || '-'}}</span>人</p>
+                          <p class="f-9b f12">{{`${major.row.xuezhi} ¥${major.row.xuefei}`}}</p>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+
+      </template>
+    </el-table-column>
+<!--    <el-table-column-->
+<!--      prop="date"-->
+<!--      label="录取概率"-->
+<!--      width="150"-->
+<!--    >-->
+<!--      <template scope="scope">-->
+<!--        <div>-->
+<!--          <p class="mb10"><span class="f18">{{ scope.row.enrollRatio }}</span>%</p>-->
+<!--          <p class="mb10 f-9b f12">{{scope.row.enrollRatioText}}</p>-->
+<!--          <p><el-tag type="success">冲</el-tag></p>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-table-column>-->
+<!--    <el-table-column-->
+<!--      label="院校"-->
+<!--    >-->
+<!--      <template scope="scope">-->
+<!--        <div>-->
+<!--          <p class="mb10"><span class="pointer">{{scope.row.university.name}}</span></p>-->
+<!--          <p class="mb5 f-9b f12">{{scope.row.university.features.split(',').join(' ')}}</p>-->
+<!--          <p class="mb5 f-9b f12">{{scope.row.university.location}} {{scope.row.university.cityName}} 排名{{scope.row.university.ranking}}</p>-->
+<!--          <p class="f-9b f12">代码 {{scope.row.university.code}}</p>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-table-column>-->
+<!--    <el-table-column-->
+<!--      label="招生计划"-->
+<!--      align="center"-->
+<!--    >-->
+<!--      <template scope="scope">-->
+<!--        <div>-->
+<!--          <p><span class="f18">{{ scope.row.recruitPlan.planCount}}</span>人</p>-->
+<!--          <p class="f-9b f12">{{scope.row.recruitPlan.course}}</p>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-table-column>-->
+<!--    <el-table-column-->
+<!--      label="历年"-->
+<!--    >-->
+<!--      <template scope="scope">-->
+<!--        <div class="f14">-->
+<!--          <p>录取人数</p>-->
+<!--          <p>线差</p>-->
+<!--          <p>最低分</p>-->
+<!--          <p>最低位次</p>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-table-column>-->
+<!--    <el-table-column-->
+<!--       :label="`${item.year}年 ${item.type}`"-->
+<!--       v-for="item in tableList.length ?  tableList[0].histories : []"-->
+<!--    >-->
+<!--      <template scope="scope">-->
+<!--        <div class="f14">-->
+<!--          <p>{{ scope.row.histories.find(his => his.year == item.year).numReal || '-'}}</p>-->
+<!--          <p>{{ scope.row.histories.find(his => his.year == item.year).lineDiff || '-'}}</p>-->
+<!--          <p>{{ scope.row.histories.find(his => his.year == item.year).score || '-'}}</p>-->
+<!--          <p>{{ scope.row.histories.find(his => his.year == item.year).seat|| '-' }}</p>-->
+<!--        </div>-->
+<!--      </template>-->
+<!--    </el-table-column>-->
+    <el-table-column
+    label="填报"
+     >
+      <template scope="scope">
+        <span type="primary" > {{`专业${scope.row.recruitPlan.majorCount}`}}</span>
+      </template>
+    </el-table-column>
+  </el-table>
+</template>
+<script>
+ export default {
+   props:{
+     tableList:{
+       type:Array,
+       default:[]
+     }
+   },
+   data() {
+     return {
+       propDefines:{
+
+       }
+     }
+   },
+   computed:{
+   },
+   methods:{
+     expand(item,expandedRows) {
+        this.$emit('expand',item)
+     }
+   }
+ }
+</script>
+<style scoped lang="scss">
+.f-9b{
+  color: #9b9b9b;
+}
+</style>