RecordDetail.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="app-container" style="margin:0 10%">
  3. <evaluation-title
  4. navBackButton
  5. title="志愿详情"
  6. ></evaluation-title>
  7. <el-card class="box-card">
  8. <zhiyuan-list @expand="expand" :tableList="rows" :loading="loading" :cols="cols" readonly></zhiyuan-list>
  9. </el-card>
  10. </div>
  11. </template>
  12. <script>
  13. import ZhiyuanList from '@/views/career/zhiyuan/components/zhiyuan-list'
  14. import { getRecommendVoluntary, getVoluntaryHeaders, getVoluntaryMarjors } from '@/api/webApi/professlib'
  15. export default {
  16. components: {
  17. ZhiyuanList
  18. },
  19. data() {
  20. return {
  21. cols: [],
  22. rows: [],
  23. data: {},
  24. loading: false
  25. }
  26. },
  27. created() {
  28. this.data = JSON.parse(this.$route.query.data)
  29. this.getCols()
  30. this.getList()
  31. },
  32. methods: {
  33. getCols() {
  34. getVoluntaryHeaders({
  35. mode: this.data.mode
  36. // year: this.batch.year
  37. }).then(res => {
  38. this.cols = res.data
  39. })
  40. },
  41. expand(item) {
  42. console.log(item)
  43. if (item.isExpand) {
  44. // 取消
  45. return
  46. } else {
  47. item.isExpand = true
  48. this.getVoluntaryMarjors(item)
  49. }
  50. },
  51. getVoluntaryMarjors(item) {
  52. getVoluntaryMarjors(
  53. {
  54. batchName: this.data.name,
  55. collegeCode: item.recruitPlan.collegeCode,
  56. mode: this.data.mode,
  57. // // universityId: item.recruitPlan.universityId,
  58. // // year: item.recruitPlan.year,
  59. wishResId: this.data.id
  60. }
  61. ).then(res => {
  62. item.majors = res.data.map(item => {
  63. item.selected = false
  64. return item
  65. })
  66. console.log(res)
  67. })
  68. },
  69. getList() {
  70. const data = {
  71. batchName: this.data.batchName,
  72. mode: this.data.mode,
  73. score: this.data.score,
  74. wishResId: this.data.id
  75. }
  76. const pageForm = {
  77. pageSize: 10,
  78. pageNum: 1
  79. }
  80. getRecommendVoluntary({ ...data }, { ...pageForm }).then(res => {
  81. console.log(res)
  82. const rows = res.rows.map(item => {
  83. item.isExpand = false
  84. item.majors = []
  85. item.recruitPlan = item.recruitPlan || {}
  86. return item
  87. })
  88. this.rows = rows
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped>
  95. </style>