studentAndTeacher.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div>
  3. <el-alert title="" :closable="false" class="alert marginBtm22" type="info">
  4. <template slot="title">
  5. <div class="shapeWrap">
  6. <span class="shape"></span>
  7. <p style="margin-right:5px">学员分布</p>
  8. <span v-if="graduateNums>0" style="color: red; font-weight: bold"
  9. >该乐团当前有{{graduateNums}}名学员在毕业年级</span
  10. >
  11. </div>
  12. </template>
  13. </el-alert>
  14. <p class="title">声部分布</p>
  15. <el-divider class="divider"></el-divider>
  16. <div>
  17. <el-row class="row">
  18. <el-col
  19. class="col"
  20. :span="6"
  21. v-for="(item, index) in subject"
  22. :key="index"
  23. >
  24. <span class="col-title">{{ item.key }}:</span>
  25. <span class="col-value" @click="getSoundInfo(item.courseScheduleId)"
  26. >{{ item.value }}人</span
  27. >
  28. </el-col>
  29. </el-row>
  30. </div>
  31. <p class="title">年级分布</p>
  32. <el-divider class="divider"></el-divider>
  33. <el-row class="row">
  34. <el-col class="col" :span="6" v-for="(item, index) in grade" :key="index">
  35. <span class="col-title">{{ gradeMap[item.key ]}}:</span>
  36. <span class="col-value" @click="getGradeInfo(gradeMap[item.key ])"
  37. >{{ item.value }}人</span
  38. >
  39. </el-col>
  40. </el-row>
  41. <el-alert :closable="false" class="alert marginBtm22" type="info">
  42. <template slot="title">
  43. <div class="shapeWrap">
  44. <span class="shape"></span>
  45. <p style="margin-right:5px">师资安排</p>
  46. <el-tooltip placement="top" popper-class="mTooltip">
  47. <div slot="content">师资安排中第一位为主教老师</div>
  48. <i
  49. class="el-icon-question micon el-tooltip"
  50. style="font-size: 18px; color: #f56c6c"
  51. v-permission="'export/teacherSalary'"
  52. ></i>
  53. </el-tooltip>
  54. </div>
  55. </template>
  56. </el-alert>
  57. <el-row class="row">
  58. <el-col
  59. class="col"
  60. :span="6"
  61. v-for="(item, index) in teacher"
  62. :key="index"
  63. >
  64. <span class="col-title">{{ item.key }}:</span>
  65. <span>{{ item.value }}</span>
  66. </el-col>
  67. </el-row>
  68. <!-- studentMaster -->
  69. <el-dialog
  70. width="1200px"
  71. title="学员列表"
  72. :visible.sync="studentVisible"
  73. v-if="studentVisible"
  74. >
  75. <studentMaster
  76. :searchForm="searchForm"
  77. :soundList="soundList"
  78. :gradeList="gradeList"
  79. />
  80. <div slot="footer" class="dialog-footer">
  81. <el-button type="primary" @click="studentVisible = false"
  82. >确 定</el-button
  83. >
  84. </div>
  85. </el-dialog>
  86. </div>
  87. </template>
  88. <script>
  89. import { getStudentAndTeacher } from "./api";
  90. import studentMaster from "./modals/studentMaster";
  91. import { getMusicGroupGradeList, findSound } from "@/api/buildTeam";
  92. export default {
  93. props:['graduateNum'],
  94. components: { studentMaster },
  95. data() {
  96. return {
  97. grade: [],
  98. subject: [],
  99. teacher: [],
  100. studentVisible: false,
  101. searchForm: {
  102. search: "",
  103. subjectId: "",
  104. currentGrade: "",
  105. oweFlag: "",
  106. },
  107. teamid: this.$route.query.id,
  108. soundList: [],
  109. gradeList: [],
  110. };
  111. },
  112. async mounted() {
  113. findSound({ musicGroupId: this.teamid }).then((res) => {
  114. if (res.code == 200) {
  115. this.soundList = res.data;
  116. }
  117. });
  118. getMusicGroupGradeList({ musicGroupId: this.teamid }).then((res) => {
  119. let result = res.data;
  120. if (res.code == 200 && result) {
  121. for (let i in result) {
  122. this.gradeList.push({
  123. value: i,
  124. label: result[i],
  125. });
  126. }
  127. }
  128. });
  129. try {
  130. const res = await getStudentAndTeacher({
  131. musicGroupId: this.$route.query.id,
  132. });
  133. this.grade = res.data.grade;
  134. this.gradeMap = res.data.gradeMap
  135. this.subject = res.data.subject;
  136. this.teacher = res.data.teacher;
  137. } catch (e) {
  138. console.log(e);
  139. }
  140. },
  141. methods: {
  142. getSoundInfo(val) {
  143. this.searchForm = {
  144. search: "",
  145. subjectId: val,
  146. currentGrade: "",
  147. oweFlag: "",
  148. };
  149. this.studentVisible = true;
  150. },
  151. getGradeInfo(val) {
  152. this.searchForm = {
  153. search: "",
  154. subjectId: "",
  155. currentGrade: val,
  156. oweFlag: "",
  157. };
  158. this.studentVisible = true;
  159. },
  160. },
  161. computed: {
  162. graduateNums(){
  163. return this.graduateNum
  164. }
  165. },
  166. };
  167. </script>
  168. <style lang="scss" scoped="scoped">
  169. .title {
  170. padding: 8px 16px;
  171. }
  172. .divider {
  173. margin-top: 0 !important;
  174. }
  175. .marginBtm22 {
  176. margin-bottom: 22px;
  177. }
  178. .row {
  179. padding: 8px 16px;
  180. margin-bottom: 30px;
  181. .col {
  182. margin-bottom: 20px;
  183. .col-title {
  184. display: inline-block;
  185. width: 150px;
  186. text-align: right;
  187. }
  188. .col-value {
  189. color: #14928a;
  190. cursor: pointer;
  191. }
  192. }
  193. }
  194. .shapeWrap {
  195. display: flex;
  196. flex-direction: row;
  197. justify-content: flex-start;
  198. align-items: center;
  199. .shape {
  200. position: relative;
  201. top: -1px;
  202. display: block;
  203. margin-right: 10px;
  204. height: 14px;
  205. width: 4px;
  206. background-color: #14928a;
  207. z-index: 500;
  208. }
  209. }
  210. </style>