elective-generation-enroll-info.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <el-card v-if="visible" shadow="never" class="mt20" :header="title">
  3. <div v-if="showForceAdjustTip">
  4. <template v-if="chartBinding.generation.status.disenrollCount">
  5. 贵校在二次补录阶段任有
  6. <span class="f-red bold">{{ chartBinding.generation.status.disenrollCount }}</span>
  7. 位学生未被录,贵校可以通过系统调剂功能,任意调剂学生去学校开设的任何组合中
  8. </template>
  9. <template v-else>
  10. 贵校学生已经全部录取完毕。在{{ this.chartBinding.generation.activeOpt.title }}阶段,贵校任可以通过系统调剂功能,任意调剂学生去学校开设的任何组合中
  11. </template>
  12. </div>
  13. <div v-else>
  14. <template v-if="showAlgorithmTip">
  15. 请先运行智能匹配算法,以获取阶段录取信息
  16. </template>
  17. <template v-else-if="hasIndicateGroups.length">
  18. <el-collapse v-model="collapseModel">
  19. <el-collapse-item v-for="g in hasIndicateGroups" :key="g.groupId" :name="g.groupId" :title="g.groupName">
  20. <div>
  21. 补录计划人数
  22. <span class="f-warning bold">{{ getIndicateCount(g) }}</span>
  23. 人,报名人数
  24. <span class="f-333 bold">{{ getActualCount(g) }}</span>
  25. <under-over-text :value="getActualCount(g)-getIndicateCount(g)"></under-over-text>
  26. ,实际录取
  27. <span class="f-primary bold">{{ getEnrollCount(g) }}</span>
  28. 人。
  29. </div>
  30. <template v-if="prevDMData">
  31. <div>
  32. 专业成绩符合学生中,按照系统推荐报名
  33. <span class="f-primary bold">{{ getMatchedAgree(g) }}</span>
  34. 人,拒绝填报
  35. <span class="f-red bold">{{ getMatchedReject(g) }}</span>
  36. 人,未填报
  37. <span class="f-red bold">{{ getMatchedNonaction(g) }}</span>
  38. 人,改出
  39. <span class="f-warning bold">{{ getMatchedApplyOut(g) }}</span>
  40. 人,改进
  41. <span class="f-primary bold">{{ getMatchedApplyIn(g) }}</span>
  42. 人。
  43. </div>
  44. <div>
  45. 成绩符合专业不符合学生中,按照系统推荐报名
  46. <span class="f-primary bold">{{ getNonMatchedAgree(g) }}</span>
  47. 人,拒绝填报
  48. <span class="f-red bold">{{ getNonMatchedReject(g) }}</span>
  49. 人,未填报
  50. <span class="f-red bold">{{ getNonMatchedNonaction(g) }}</span>
  51. 人,改出
  52. <span class="f-warning bold">{{ getNonMatchedApplyOut(g) }}</span>
  53. 人,改进
  54. <span class="f-primary bold">{{ getNonMatchedApplyIn(g) }}</span>
  55. 人。
  56. </div>
  57. </template>
  58. </el-collapse-item>
  59. </el-collapse>
  60. </template>
  61. <template v-else>
  62. 所有组合均已录取完毕
  63. </template>
  64. </div>
  65. </el-card>
  66. </template>
  67. <script>
  68. import config from '@/common/mx-config'
  69. import UnderOverText from '@/views/elective/generation/components/under-over-text'
  70. export default {
  71. name: 'elective-generation-enroll-info',
  72. components: { UnderOverText },
  73. props: ['chartBinding'],
  74. data() {
  75. return {
  76. collapseModel: []
  77. }
  78. },
  79. computed: {
  80. options() {
  81. return config.electiveGenerationOptions
  82. },
  83. title() {
  84. const activeTitle = this.chartBinding.generation?.activeOpt?.title
  85. if (this.chartBinding.generation?.active < this.options.forceAdjust.value) {
  86. const shortTitle = activeTitle.substring(0, activeTitle.length - 2)
  87. return '贵校' + shortTitle + '阶段录取情况'
  88. }
  89. return activeTitle + '阶段说明'
  90. },
  91. visible() {
  92. return !!this.chartBinding.generation?.activeOpt?.decisionMaking && this.chartBinding.tableData
  93. },
  94. showForceAdjustTip() {
  95. return this.chartBinding.generation.activeOpt == this.options.forceAdjust
  96. },
  97. showAlgorithmTip() {
  98. return this.chartBinding.generation.current == this.chartBinding.generation.active
  99. && !this.chartBinding.generation.status.doneDMAlgorithm
  100. },
  101. activeDMData() {
  102. const target = this.chartBinding.generation.active
  103. return this.chartBinding.tableData.find(t => t.generation == target)
  104. },
  105. prevApplyData() {
  106. const target = this.chartBinding.generation.active - 1
  107. return this.chartBinding.tableData.find(t => t.generation == target)
  108. },
  109. prevDMData() {
  110. const target = this.chartBinding.generation.active - 2
  111. if (target < this.options.primary.value) return null
  112. return this.chartBinding.tableData.find(t => t.generation == target)
  113. },
  114. hasIndicateGroups() {
  115. // 要解析前一阶段有指标的组合,进行致本阶段的报名与录取情况
  116. if (!this.prevDMData) return this.chartBinding.generation.roundGroups // 初录结果,全量返回
  117. const indicateData = this.prevDMData.categories.find(c => c.category == 'indicateCount')
  118. const adjustData = this.prevDMData.categories.find(c => c.category == 'adjustCount')
  119. if (!indicateData) return []
  120. return this.chartBinding.generation.roundGroups.filter(g => {
  121. const groupVal = indicateData.values.find(v => v.groupId == g.groupId)
  122. const groupAdVal = adjustData?.values?.find(v => v.groupId == g.groupId)
  123. const isBT = this.chartBinding.generation.activeOpt == this.options.backTrackingDM
  124. return isBT ? groupVal.value < 0 && groupAdVal.value > 0 : groupVal.value < 0
  125. })
  126. }
  127. },
  128. watch: {
  129. 'hasIndicateGroups': function() {
  130. this.collapseModel = this.hasIndicateGroups.map(g => g.groupId)
  131. }
  132. },
  133. methods: {
  134. getCategoryValue(tableData, category, group) {
  135. const data = tableData.categories.find(c => c.category == category)
  136. return data?.values.find(v => v.groupId == group.groupId)
  137. },
  138. getIndicateCount(group) {
  139. // 录取指标
  140. if (!this.prevDMData) return group.expectedCount
  141. const val = this.getCategoryValue(this.prevDMData, 'indicateCount', group)
  142. return Math.abs(val.value)
  143. },
  144. getActualCount(group) {
  145. if (!this.prevDMData) {
  146. // 报名人数,只取第一志愿
  147. const isMultiplePreference = this.prevApplyData.categories.some(sub => Array.isArray(sub))
  148. const tableData = isMultiplePreference ? { categories: this.prevApplyData.categories.first() } : this.prevApplyData
  149. const val = this.getCategoryValue(tableData, 'actualCount', group)
  150. return val.value
  151. } else {
  152. // 取报名代所有细分合并
  153. const subCategories = ['matchedApproved', 'matchedRankout', 'nonmatchedApproved', 'nonmatchedRankout']
  154. return subCategories.sum(c => this.getCategoryValue(this.prevApplyData, c, group)?.value)
  155. }
  156. },
  157. getEnrollCount(group) {
  158. return this.getCategoryValue(this.activeDMData, 'approvedCount', group)?.value || '-'
  159. },
  160. getMatchedAgree(group) {
  161. return this.getCategoryValue(this.prevApplyData, 'matchedApproved', group)?.value || '-'
  162. },
  163. getNonMatchedAgree(group) {
  164. return this.getCategoryValue(this.prevApplyData, 'nonmatchedApproved', group)?.value || '-'
  165. },
  166. getMatchedReject(group) {
  167. return this.getCategoryValue(this.prevApplyData, 'matchedNotOptional', group)?.value || '-'
  168. },
  169. getNonMatchedReject(group) {
  170. return this.getCategoryValue(this.prevApplyData, 'nonmatchedNotOptional', group)?.value || '-'
  171. },
  172. getMatchedNonaction(group) {
  173. return this.getCategoryValue(this.prevApplyData, 'matchedNonaction', group)?.value || '-'
  174. },
  175. getNonMatchedNonaction(group) {
  176. return this.getCategoryValue(this.prevApplyData, 'nonmatchedNonaction', group)?.value || '-'
  177. },
  178. getMatchedApplyIn(group) {
  179. return this.getCategoryValue(this.prevApplyData, 'matchedRankout', group)?.value || '-'
  180. },
  181. getNonMatchedApplyIn(group) {
  182. return this.getCategoryValue(this.prevApplyData, 'nonmatchedRankout', group)?.value || '-'
  183. },
  184. getMatchedApplyOut(group) {
  185. return this.getCategoryValue(this.prevApplyData, 'matchedRejected', group)?.value || '-'
  186. },
  187. getNonMatchedApplyOut(group) {
  188. return this.getCategoryValue(this.prevApplyData, 'nonmatchedRejected', group)?.value || '-'
  189. }
  190. }
  191. }
  192. </script>
  193. <style scoped>
  194. </style>