teamAndcourse.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <div>
  3. <div class="tabTopWrap">
  4. <el-table :data="musicGroupInfo"
  5. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  6. <el-table-column align="center"
  7. prop="musicGroupId"
  8. width="180px"
  9. label="乐团编号">
  10. <template slot-scope="scope">
  11. <copy-text>{{ scope.row.musicGroupId }}</copy-text>
  12. </template>
  13. </el-table-column>
  14. <el-table-column align="center"
  15. prop="joinMusicGroupDate"
  16. label="入团时间">
  17. <template slot-scope="scope">{{ scope.row.joinMusicGroupDate | dateForMinFormat }}</template>
  18. </el-table-column>
  19. <el-table-column align="center"
  20. prop="musicGroupName"
  21. label="乐团名称">
  22. </el-table-column>
  23. <el-table-column align="center"
  24. label="乐团状态">
  25. <template slot-scope="scope">{{ scope.row.musicGroupStatus | musicGroupType }}</template>
  26. </el-table-column>
  27. <el-table-column align="center"
  28. prop="subjectName"
  29. label="专业"></el-table-column>
  30. <el-table-column align="center"
  31. prop
  32. label="乐器来源">
  33. <template slot-scope="scope">{{ scope.row.kitPurchaseMethod | instrumentType }}</template>
  34. </el-table-column>
  35. <el-table-column align="center"
  36. label="学员状态">
  37. <template slot-scope="scope">
  38. {{ scope.row.userMusicGroupStatus | musicGroupStudentType }}
  39. </template>
  40. </el-table-column>
  41. <el-table-column align="center"
  42. label="退团时间"
  43. prop="quitMusicGroupDate">
  44. <template slot-scope="scope">
  45. <span v-if="scope.row.userMusicGroupStatus == 'QUIT'">
  46. {{ scope.row.quitMusicGroupDate | formatTimer }}
  47. </span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column align="center"
  51. label="所选乐器">
  52. <template slot-scope="scope">
  53. <span v-for="good in scope.row.userGoodsDtos"
  54. :key="good.goodsId">{{ good.goodsName | joinArray(',') }}</span>
  55. {{ scope.row.kitPurchaseMethod == 'LEASE' ? '(租赁:' + scope.row.depositFee + ')' : '' }}
  56. </template>
  57. </el-table-column>
  58. <el-table-column align="center"
  59. label="操作">
  60. <template slot-scope="scope">
  61. <el-button @click="onCourse(scope.row)"
  62. v-permission="'studentAttendance/findStudentAttendance'"
  63. type="text">排课详情</el-button>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. <el-dialog
  69. :visible.sync="coursesShow"
  70. title="排课详情"
  71. width="1000px"
  72. >
  73. <template>
  74. <!-- 搜索类型 -->
  75. <el-form v-if="coursesShow"
  76. :inline="true"
  77. class="searchForm"
  78. v-model.trim="searchForm">
  79. <el-form-item>
  80. <el-select v-model.trim="searchForm.courseScheduleType"
  81. clearable
  82. filterable
  83. placeholder="请选择课程类型">
  84. <el-option v-for="(item, index) in courseArray"
  85. :key="index"
  86. :label="item.label"
  87. :value="item.value"></el-option>
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item>
  91. <el-select v-model.trim="searchForm.courseStatus"
  92. clearable
  93. filterable
  94. placeholder="课程状态">
  95. <el-option v-for="(item, index) in courseStatus"
  96. :key="index"
  97. :label="item.label"
  98. :value="item.value"></el-option>
  99. </el-select>
  100. </el-form-item>
  101. <!-- 换接口做修改 -->
  102. <el-form-item prop="teacherId">
  103. <remote-search :commit='"setTeachers"' v-model='searchForm.teacherId' />
  104. </el-form-item>
  105. <!-- <el-form-item>
  106. <el-input placeholder="班级名称"
  107. @keyup.enter.native="search"
  108. v-model.trim="searchForm.classGroupName"></el-input>
  109. </el-form-item>
  110. <el-form-item>
  111. <el-input placeholder="老师姓名"
  112. @keyup.enter.native="search"
  113. v-model.trim="searchForm.teacherName"></el-input>
  114. </el-form-item> -->
  115. <el-form-item>
  116. <el-button type="danger" @click="search">搜索</el-button>
  117. </el-form-item>
  118. </el-form>
  119. <div v-if="coursesShow"
  120. class="tableWrap">
  121. <el-table :data="coursesInfo"
  122. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  123. <el-table-column align="center"
  124. prop="courseScheduleId"
  125. label="课程编号">
  126. <template slot-scope="scope">
  127. <copy-text>{{ scope.row.courseScheduleId }}</copy-text>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="center"
  131. width="180px"
  132. label="上课时间">
  133. <template slot-scope="scope">
  134. {{ scope.row.courseSchedule.classDate | dayjsFormat }}
  135. {{
  136. scope.row.courseSchedule.startClassTime | dayjsFormatMinute
  137. }}-{{
  138. scope.row.courseSchedule.endClassTime | dayjsFormatMinute
  139. }}
  140. </template>
  141. </el-table-column>
  142. <el-table-column align="center"
  143. prop="courseSchedule.name"
  144. label="课程名称"></el-table-column>
  145. <el-table-column align="center"
  146. label="课程类型">
  147. <template slot-scope="scope">{{ scope.row.courseSchedule.type | coursesType }}</template>
  148. </el-table-column>
  149. <el-table-column align="center"
  150. label="课程状态">
  151. <template slot-scope="scope">{{ scope.row.courseSchedule.status | coursesStatus }}</template>
  152. </el-table-column>
  153. <el-table-column align="center" label="是否被合并">
  154. <template slot-scope="scope">
  155. <div>
  156. {{ scope.row.courseSchedule.newCourseId > 0 ? '是' : '否' }}
  157. </div>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="center"
  161. prop="courseSchedule.teacherName"
  162. label="老师姓名"></el-table-column>
  163. </el-table>
  164. <pagination :total="pageInfo.total"
  165. :page.sync="pageInfo.page"
  166. :limit.sync="pageInfo.limit"
  167. :page-sizes="pageInfo.page_size"
  168. @pagination="getStudentCourses" />
  169. </div>
  170. </template>
  171. </el-dialog>
  172. </div>
  173. </template>
  174. <script>
  175. import pagination from "@/components/Pagination/index";
  176. import {musicCourseType} from "@/utils/searchArray"
  177. import { findStudentAttendance } from "@/api/buildTeam";
  178. import {
  179. findStudentMusicGroups,
  180. findStudentCourses
  181. } from "@/api/studentManager";
  182. export default {
  183. name: "teamAndcourse",
  184. components: { pagination },
  185. data () {
  186. return {
  187. userId: null,
  188. musicGroupInfo: [], // 乐团列表
  189. coursesInfo: [], // 排课列表
  190. coursesShow: false, // 排课列表是否显示
  191. searchLsit: [],
  192. searchForm: {
  193. studentID: null,
  194. musicGroupId: null,
  195. courseScheduleType: null,
  196. courseStatus: null,
  197. teacherId: null
  198. },
  199. courseArray: musicCourseType,
  200. courseStatus: [
  201. { value: "NOT_START", label: "未开始" },
  202. { value: "UNDERWAY", label: "进行中" },
  203. { value: "OVER", label: "已结束" }
  204. ],
  205. pageInfo: {
  206. // 分页规则
  207. limit: 10, // 限制显示条数
  208. page: 1, // 当前页
  209. total: 0, // 总条数
  210. page_size: [10, 20, 40, 50] // 选择限制显示条数
  211. }
  212. };
  213. },
  214. mounted () {
  215. this.userId = this.$route.query.userId;
  216. this.searchForm.studentID = this.$route.query.userId;
  217. this.__init();
  218. },
  219. activated () {
  220. this.userId = this.$route.query.userId;
  221. this.searchForm.studentID = this.$route.query.userId;
  222. this.__init();
  223. },
  224. methods: {
  225. __init () {
  226. findStudentMusicGroups({ userId: this.userId }).then(res => {
  227. if (res.code == 200) {
  228. this.musicGroupInfo = res.data;
  229. }
  230. });
  231. },
  232. onCourse (row) {
  233. this.coursesShow = true;
  234. this.searchForm = {
  235. studentID: this.$route.query.userId,
  236. musicGroupId: row.musicGroupId,
  237. courseScheduleType: null,
  238. courseStatus: null,
  239. teacherId: null
  240. };
  241. this.getStudentCourses();
  242. },
  243. search () {
  244. this.pageInfo.page = 1;
  245. this.getStudentCourses();
  246. },
  247. getStudentCourses () {
  248. let params = this.searchForm;
  249. params.rows = this.pageInfo.limit;
  250. params.page = this.pageInfo.page;
  251. console.log(params)
  252. findStudentAttendance(params).then(res => {
  253. if (res.code == 200) {
  254. this.coursesInfo = res.data.rows;
  255. this.pageInfo.total = res.data.total;
  256. }
  257. });
  258. }
  259. }
  260. };
  261. </script>
  262. <style lang="scss">
  263. .tabTopWrap {
  264. margin-bottom: 30px;
  265. }
  266. </style>