瀏覽代碼

zhiyuan - record detail page

hare8999@163.com 2 年之前
父節點
當前提交
74d6a86343
共有 2 個文件被更改,包括 23 次插入18 次删除
  1. 18 17
      src/views/career/zhiyuan/RecordDetail.vue
  2. 5 1
      src/views/career/zhiyuan/components/zhiyuan-list.vue

+ 18 - 17
src/views/career/zhiyuan/RecordDetail.vue

@@ -1,21 +1,22 @@
 <template>
   <div>
-    <zhiyuan-list @expand="expand" :tableList="rows"  :loading="loading" :cols="cols"></zhiyuan-list>
+    <zhiyuan-list @expand="expand" :tableList="rows" :loading="loading" :cols="cols" readonly></zhiyuan-list>
   </div>
 </template>
 <script>
-import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list';
+import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list'
 import { getRecommendVoluntary, getVoluntaryHeaders, getVoluntaryMarjors } from '@/api/webApi/professlib'
+
 export default {
-  components:{
+  components: {
     ZhiyuanList
   },
   data() {
     return {
-      cols:[],
-      rows:[],
-      data:{},
-      loading:false
+      cols: [],
+      rows: [],
+      data: {},
+      loading: false
     }
   },
   created() {
@@ -23,10 +24,10 @@ export default {
     this.getCols()
     this.getList()
   },
-  methods:{
+  methods: {
     getCols() {
       getVoluntaryHeaders({
-        mode:this.data.mode,
+        mode: this.data.mode
         // year: this.batch.year
       }).then(res => {
         this.cols = res.data
@@ -34,10 +35,10 @@ export default {
     },
     expand(item) {
       console.log(item)
-      if(item.isExpand) {
+      if (item.isExpand) {
         // 取消
         return
-      }else {
+      } else {
         item.isExpand = true
         this.getVoluntaryMarjors(item)
       }
@@ -46,11 +47,11 @@ export default {
       getVoluntaryMarjors(
         {
           batchName: this.data.name,
-          // // collegeCode: item.recruitPlan.collegeCode,
+          collegeCode: item.recruitPlan.collegeCode,
           mode: this.data.mode,
           // // universityId: item.recruitPlan.universityId,
           // // year: item.recruitPlan.year,
-          wishResId:this.data.id
+          wishResId: this.data.id
         }
       ).then(res => {
         item.majors = res.data.map(item => {
@@ -69,18 +70,18 @@ export default {
       }
       const pageForm = {
         pageSize: 10,
-        pageNum:1
+        pageNum: 1
       }
-      getRecommendVoluntary({ ...data }, { ...pageForm }).then(res =>{
+      getRecommendVoluntary({ ...data }, { ...pageForm }).then(res => {
         console.log(res)
         const rows = res.rows.map(item => {
           item.isExpand = false
           item.majors = []
           return item
         })
-          this.rows = rows
+        this.rows = rows
       })
-    },
+    }
   }
 }
 </script>

+ 5 - 1
src/views/career/zhiyuan/components/zhiyuan-list.vue

@@ -99,7 +99,7 @@
               <p>{{ row.history ? row.history.seat || '-' : '-' }}</p>
             </div>
           </template>
-          <template #t7="{row}">
+          <template #t7="{row}" v-if="!readonly">
             <el-button :type="row.selected ? 'danger' : 'primary'" @click="apply(row,recommend)">
               {{ row.selected ? '取消' : '填报' }}
             </el-button>
@@ -128,6 +128,10 @@ export default {
     loading: {
       type: Boolean,
       default: []
+    },
+    readonly: {
+      type: Boolean,
+      default: false
     }
   },
   data() {