RecordDetail.vue 2.1 KB

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