shilipojs 2 年之前
父節點
當前提交
95407e9a6b
共有 2 個文件被更改,包括 34 次插入5 次删除
  1. 33 4
      src/views/career/zhiyuan/RecordDetail.vue
  2. 1 1
      src/views/career/zhiyuan/components/volunteerList.vue

+ 33 - 4
src/views/career/zhiyuan/RecordDetail.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
-    <zhiyuan-list :tableList="rows" :cols="cols"></zhiyuan-list>
+    <zhiyuan-list @expand="expand" :tableList="rows"  :loading="loading" :cols="cols"></zhiyuan-list>
   </div>
 </template>
 <script>
 import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list';
-import { getRecommendVoluntary, getVoluntaryHeaders } from '@/api/webApi/professlib'
+import { getRecommendVoluntary, getVoluntaryHeaders, getVoluntaryMarjors } from '@/api/webApi/professlib'
 export default {
   components:{
     ZhiyuanList
@@ -14,11 +14,12 @@ export default {
     return {
       cols:[],
       rows:[],
-      data:{}
+      data:{},
+      loading:false
     }
   },
   created() {
-    this.data = this.$route.params.data
+    this.data = JSON.parse(this.$route.query.data)
     this.getCols()
     this.getList()
   },
@@ -31,6 +32,34 @@ export default {
         this.cols = res.data
       })
     },
+    expand(item) {
+      console.log(item)
+      if(item.isExpand) {
+        // 取消
+        return
+      }else {
+        item.isExpand = true
+        this.getVoluntaryMarjors(item)
+      }
+    },
+    getVoluntaryMarjors(item) {
+      getVoluntaryMarjors(
+        {
+          batchName: this.data.name,
+          // // collegeCode: item.recruitPlan.collegeCode,
+          mode: this.data.mode,
+          // // universityId: item.recruitPlan.universityId,
+          // // year: item.recruitPlan.year,
+          wishResId:this.data.id
+        }
+      ).then(res => {
+        item.majors = res.data.map(item => {
+          item.selected = false
+          return item
+        })
+        console.log(res)
+      })
+    },
     getList() {
       const data = {
         batchName: this.data.batchName,

+ 1 - 1
src/views/career/zhiyuan/components/volunteerList.vue

@@ -84,7 +84,7 @@ export default {
       this.$router.go(-1)
     },
     goDetails(data) {
-      this.$router.push({ name: 'RecordDetail', params: { data: data } })
+      this.$router.push({ name: 'RecordDetail', query: { data:  JSON.stringify(data) } })
     },
     delTableList(data) {
       console.log(data)