teamAndcourse.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <div>
  3. <div class="tabTopWrap">
  4. <el-table :data="musicGroupInfo" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  5. <el-table-column align="center" prop="musicGroupId" label="乐团编号"></el-table-column>
  6. <el-table-column align="center" prop="joinMusicGroupDate" label="入团时间">
  7. <template slot-scope="scope">{{ scope.row.joinMusicGroupDate | dateForMinFormat }}</template>
  8. </el-table-column>
  9. <el-table-column align="center" prop="musicGroupName" label="乐团名称"></el-table-column>
  10. <el-table-column align="center" label="乐团状态">
  11. <template slot-scope="scope">{{ scope.row.musicGroupStatus | musicGroupType }}</template>
  12. </el-table-column>
  13. <el-table-column align="center" prop="subjectName" label="专业"></el-table-column>
  14. <el-table-column align="center" prop label="乐器来源">
  15. <template slot-scope="scope">{{ scope.row.kitPurchaseMethod | instrumentType }}</template>
  16. </el-table-column>
  17. <el-table-column align="center" label="学员状态">
  18. <template slot-scope="scope">{{ scope.row.userMusicGroupStatus | musicGroupStudentType }}</template>
  19. </el-table-column>
  20. <el-table-column align="center" label="退团时间" prop="quitMusicGroupDate">
  21. </el-table-column>
  22. <el-table-column align="center" label="所选乐器">
  23. <template slot-scope="scope">
  24. <span
  25. v-for="good in scope.row.userGoodsDtos"
  26. :key="good.goodsId"
  27. >{{ good.goodsName | joinArray(',') }}</span>
  28. {{ scope.row.kitPurchaseMethod == 'LEASE' ? '(租赁:' + scope.row.depositFee + ')' : '' }}
  29. </template>
  30. </el-table-column>
  31. <el-table-column align="center" label="操作">
  32. <template slot-scope="scope">
  33. <el-button
  34. @click="onCourse(scope.row)"
  35. v-permission="'studentManage/findStudentCourses'"
  36. type="text"
  37. >排课详情</el-button>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. <!-- 搜索类型 -->
  43. <el-form v-if="coursesShow" :inline="true" class="searchForm" v-model.trim="searchForm">
  44. <el-form-item>
  45. <el-select v-model.trim="searchForm.classGroupType" clearable filterable placeholder="课程类型">
  46. <el-option
  47. v-for="(item, index) in courseArray"
  48. :key="index"
  49. :label="item.label"
  50. :value="item.value"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-select v-model.trim="searchForm.courseStatus" clearable filterable placeholder="课程状态">
  56. <el-option
  57. v-for="(item, index) in courseStatus"
  58. :key="index"
  59. :label="item.label"
  60. :value="item.value"
  61. ></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item>
  65. <el-input
  66. placeholder="班级名称"
  67. @keyup.enter.native="search"
  68. v-model.trim="searchForm.classGroupName"
  69. ></el-input>
  70. </el-form-item>
  71. <el-form-item>
  72. <el-input
  73. placeholder="老师姓名"
  74. @keyup.enter.native="search"
  75. v-model.trim="searchForm.teacherName"
  76. ></el-input>
  77. </el-form-item>
  78. <el-form-item>
  79. <div @click="search" class="searchBtn">搜索</div>
  80. </el-form-item>
  81. </el-form>
  82. <!-- 查询列表 -->
  83. <!-- <div v-if="coursesShow" class="searchWrap">
  84. <p>查询条件:</p>
  85. <div class="searchItem"
  86. @click="closeSearch(item)"
  87. v-for="(item,index) in searchLsit" :key="index">
  88. {{ item.key }}
  89. <i class="el-icon-close"></i>
  90. </div>
  91. </div>-->
  92. <div v-if="coursesShow" class="tableWrap">
  93. <el-table :data="coursesInfo" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  94. <el-table-column align="center" prop="classGroupId" label="编号"></el-table-column>
  95. <el-table-column align="center" prop="courseDate" label="时间">
  96. <template slot-scope="scope">{{ scope.row.courseDate | dateForMinFormat }}</template>
  97. </el-table-column>
  98. <el-table-column align="center" prop="classGroupName" label="班级名称"></el-table-column>
  99. <el-table-column align="center" label="课程类型">
  100. <template slot-scope="scope">{{ scope.row.classGroupType | coursesType }}</template>
  101. </el-table-column>
  102. <el-table-column align="center" label="课程状态">
  103. <template slot-scope="scope">{{ scope.row.courseStatus | coursesStatus }}</template>
  104. </el-table-column>
  105. <el-table-column align="center" prop="teacherName" label="老师姓名"></el-table-column>
  106. </el-table>
  107. <pagination
  108. :total="pageInfo.total"
  109. :page.sync="pageInfo.page"
  110. :limit.sync="pageInfo.limit"
  111. :page-sizes="pageInfo.page_size"
  112. @pagination="getStudentCourses"
  113. />
  114. </div>
  115. </div>
  116. </template>
  117. <script>
  118. import pagination from "@/components/Pagination/index";
  119. import {
  120. findStudentMusicGroups,
  121. findStudentCourses
  122. } from "@/api/studentManager";
  123. export default {
  124. name: "teamAndcourse",
  125. components: { pagination },
  126. data() {
  127. return {
  128. userId: null,
  129. musicGroupInfo: [], // 乐团列表
  130. coursesInfo: [], // 排课列表
  131. coursesShow: false, // 排课列表是否显示
  132. searchLsit: [],
  133. searchForm: {
  134. studentId: null,
  135. musicGroupId: null,
  136. classGroupType: null,
  137. courseStatus: null,
  138. classGroupName: null,
  139. teacherName: null
  140. },
  141. courseArray: [
  142. { label: "单技课", value: "NORMAL" },
  143. { label: "合奏课", value: "MIX" },
  144. { label: "基础技能班", value: "HIGH" },
  145. { label: "VIP课", value: "VIP" },
  146. { label: "试听课", value: "DEMO" }
  147. ],
  148. courseStatus: [
  149. { value: "NOT_START", label: "未开始" },
  150. { value: "UNDERWAY", label: "进行中" },
  151. { value: "OVER", label: "已结束" }
  152. ],
  153. pageInfo: {
  154. // 分页规则
  155. limit: 10, // 限制显示条数
  156. page: 1, // 当前页
  157. total: 0, // 总条数
  158. page_size: [10, 20, 40, 50] // 选择限制显示条数
  159. }
  160. };
  161. },
  162. mounted() {
  163. this.userId = this.$route.query.userId;
  164. this.searchForm.studentId = this.$route.query.userId;
  165. this.__init();
  166. },
  167. activated() {
  168. this.userId = this.$route.query.userId;
  169. this.searchForm.studentId = this.$route.query.userId;
  170. this.__init();
  171. },
  172. methods: {
  173. __init() {
  174. findStudentMusicGroups({ userId: this.userId }).then(res => {
  175. if (res.code == 200) {
  176. this.musicGroupInfo = res.data;
  177. }
  178. });
  179. },
  180. onCourse(row) {
  181. this.coursesShow = true;
  182. this.searchForm = {
  183. studentId: this.$route.query.userId,
  184. musicGroupId: row.musicGroupId,
  185. classGroupType: null,
  186. courseStatus: null,
  187. classGroupName: null,
  188. teacherName: null
  189. };
  190. this.getStudentCourses();
  191. },
  192. search() {
  193. this.pageInfo.page = 1;
  194. this.getStudentCourses();
  195. },
  196. getStudentCourses() {
  197. let params = this.searchForm;
  198. params.rows = this.pageInfo.limit;
  199. params.page = this.pageInfo.page;
  200. findStudentCourses(params).then(res => {
  201. if (res.code == 200) {
  202. this.coursesInfo = res.data.rows;
  203. this.pageInfo.total = res.data.total;
  204. }
  205. });
  206. }
  207. }
  208. };
  209. </script>
  210. <style lang="scss">
  211. .tabTopWrap {
  212. margin-bottom: 30px;
  213. }
  214. </style>