teamAndcourse.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. {{ scope.row.courseSchedule.newCourseId > 0 && scope.row.courseSchedule.newCourseId == scope.row.courseScheduleId ? '合并课' : null }}
  158. {{ scope.row.courseSchedule.newCourseId > 0 && scope.row.courseSchedule.newCourseId != scope.row.courseScheduleId ? '被合并课' : null }}
  159. </div>
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="center"
  163. prop="courseSchedule.teacherName"
  164. label="老师姓名"></el-table-column>
  165. </el-table>
  166. <pagination :total="pageInfo.total"
  167. :page.sync="pageInfo.page"
  168. :limit.sync="pageInfo.limit"
  169. :page-sizes="pageInfo.page_size"
  170. @pagination="getStudentCourses" />
  171. </div>
  172. </template>
  173. </el-dialog>
  174. </div>
  175. </template>
  176. <script>
  177. import pagination from "@/components/Pagination/index";
  178. import {musicCourseType} from "@/utils/searchArray"
  179. import { findStudentAttendance } from "@/api/buildTeam";
  180. import {
  181. findStudentMusicGroups,
  182. findStudentCourses
  183. } from "@/api/studentManager";
  184. export default {
  185. name: "teamAndcourse",
  186. components: { pagination },
  187. data () {
  188. return {
  189. userId: null,
  190. musicGroupInfo: [], // 乐团列表
  191. coursesInfo: [], // 排课列表
  192. coursesShow: false, // 排课列表是否显示
  193. searchLsit: [],
  194. searchForm: {
  195. studentID: null,
  196. musicGroupId: null,
  197. courseScheduleType: null,
  198. courseStatus: null,
  199. teacherId: null
  200. },
  201. courseArray: musicCourseType,
  202. courseStatus: [
  203. { value: "NOT_START", label: "未开始" },
  204. { value: "UNDERWAY", label: "进行中" },
  205. { value: "OVER", label: "已结束" }
  206. ],
  207. pageInfo: {
  208. // 分页规则
  209. limit: 10, // 限制显示条数
  210. page: 1, // 当前页
  211. total: 0, // 总条数
  212. page_size: [10, 20, 40, 50] // 选择限制显示条数
  213. }
  214. };
  215. },
  216. mounted () {
  217. this.userId = this.$route.query.userId;
  218. this.searchForm.studentID = this.$route.query.userId;
  219. this.__init();
  220. },
  221. activated () {
  222. this.userId = this.$route.query.userId;
  223. this.searchForm.studentID = this.$route.query.userId;
  224. this.__init();
  225. },
  226. methods: {
  227. __init () {
  228. findStudentMusicGroups({ userId: this.userId }).then(res => {
  229. if (res.code == 200) {
  230. this.musicGroupInfo = res.data;
  231. }
  232. });
  233. },
  234. onCourse (row) {
  235. this.coursesShow = true;
  236. this.searchForm = {
  237. studentID: this.$route.query.userId,
  238. musicGroupId: row.musicGroupId,
  239. courseScheduleType: null,
  240. courseStatus: null,
  241. teacherId: null
  242. };
  243. this.getStudentCourses();
  244. },
  245. search () {
  246. this.pageInfo.page = 1;
  247. this.getStudentCourses();
  248. },
  249. getStudentCourses () {
  250. let params = this.searchForm;
  251. params.rows = this.pageInfo.limit;
  252. params.page = this.pageInfo.page;
  253. console.log(params)
  254. findStudentAttendance(params).then(res => {
  255. if (res.code == 200) {
  256. this.coursesInfo = res.data.rows;
  257. this.pageInfo.total = res.data.total;
  258. }
  259. });
  260. }
  261. }
  262. };
  263. </script>
  264. <style lang="scss">
  265. .tabTopWrap {
  266. margin-bottom: 30px;
  267. }
  268. </style>