studentVip.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <div class="studentvip">
  3. <!-- 搜索类型 -->
  4. <save-form
  5. :inline="true"
  6. class="searchForm"
  7. :model="searchForm"
  8. @submit="onSearch"
  9. save-key="studentDetail-studentVip"
  10. >
  11. <el-form-item>
  12. <el-input
  13. placeholder="课程名称"
  14. clearable
  15. @keyup.enter.native="onSearch"
  16. v-model.trim="searchForm.vipGroupName"
  17. ></el-input>
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button native-type="submit" type="danger">搜索</el-button>
  21. </el-form-item>
  22. </save-form>
  23. <div class="tableWrap">
  24. <el-table
  25. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  26. :data="tableList"
  27. >
  28. <el-table-column label="VIP编号" align="center" prop="vipGroupId">
  29. <template slot-scope="scope">
  30. <copy-text>{{ scope.row.vipGroupId }}</copy-text>
  31. </template>
  32. </el-table-column>
  33. <el-table-column
  34. label="VIP课名称"
  35. align="center"
  36. prop="vipGroupName"
  37. >
  38. <template slot-scope="scope">
  39. <copy-text>{{ scope.row.vipGroupName }}</copy-text>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="VIP课状态" align="center">
  43. <template slot-scope="scope">{{
  44. scope.row.vipGroupStatus | vipCourseStatus
  45. }}</template>
  46. </el-table-column>
  47. <el-table-column
  48. label="指导老师"
  49. align="center"
  50. prop="teacherName"
  51. ></el-table-column>
  52. <el-table-column
  53. label="乐团主管"
  54. align="center"
  55. prop="eduTeacherName"
  56. ></el-table-column>
  57. <el-table-column
  58. label="班级人数"
  59. align="center"
  60. prop="studentNum"
  61. ></el-table-column>
  62. <el-table-column
  63. label="活动方案"
  64. align="center"
  65. prop="activeName"
  66. ></el-table-column>
  67. <el-table-column
  68. label="开课时间"
  69. width="150"
  70. align="center"
  71. prop="courseStartDate"
  72. >
  73. <template slot-scope="scope">{{
  74. scope.row.courseStartDate | dateForMinFormat
  75. }}</template>
  76. </el-table-column>
  77. <el-table-column
  78. label="当前课次"
  79. align="center"
  80. prop="currentClassTimes"
  81. >
  82. <template slot-scope="scope"
  83. >{{ scope.row.currentClassTimes }}/{{
  84. scope.row.totalClassTimes
  85. }}</template
  86. >
  87. </el-table-column>
  88. <el-table-column label="操作" align="center">
  89. <template slot-scope="scope">
  90. <el-button
  91. @click="onCourse(scope.row)"
  92. v-permission="'studentManage/findStudentVipGroups'"
  93. type="text"
  94. >课表</el-button
  95. >
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination
  100. save-key="studentDetail-studentVip"
  101. sync
  102. :total.sync="pageInfo.total"
  103. :page.sync="pageInfo.page"
  104. :limit.sync="pageInfo.limit"
  105. :page-sizes="pageInfo.page_size"
  106. @pagination="getCourseList"
  107. />
  108. <el-dialog :title="dialogTitle" :visible.sync="dialogTableVisible">
  109. <el-table :data="gridData">
  110. <el-table-column
  111. prop="courseDate"
  112. label="时间"
  113. align="center"
  114. width="150"
  115. >
  116. <template slot-scope="scope">{{
  117. scope.row.courseDate | dateForMinFormat
  118. }}</template>
  119. </el-table-column>
  120. <el-table-column
  121. prop="classGroupName"
  122. label="课程名称"
  123. align="center"
  124. width="200"
  125. ></el-table-column>
  126. <el-table-column label="课程类型" align="center">
  127. <template slot-scope="scope">{{
  128. scope.row.teachMode == "ONLINE" ? "线上" : "线下"
  129. }}</template>
  130. </el-table-column>
  131. <el-table-column prop="courseStatus" align="center" label="课程状态">
  132. <template slot-scope="scope">{{
  133. scope.row.courseStatus | coursesStatus
  134. }}</template>
  135. </el-table-column>
  136. </el-table>
  137. </el-dialog>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import pagination from "@/components/Pagination/index";
  143. import {
  144. findStudentVipGroups,
  145. findStudentVipGroupClass,
  146. findStudentCourses,
  147. } from "@/api/studentManager";
  148. export default {
  149. name: "studentvip",
  150. components: { pagination },
  151. data() {
  152. return {
  153. searchForm: {
  154. studentId: null,
  155. vipGroupName: null
  156. },
  157. checkIndex: null, // 选中的课程
  158. dialogTableVisible: false,
  159. searchLsit: [],
  160. tableList: [],
  161. courseList: [],
  162. pageInfo: {
  163. // 分页规则
  164. limit: 10, // 限制显示条数
  165. page: 1, // 当前页
  166. total: 0, // 总条数
  167. page_size: [10, 20, 40, 50], // 选择限制显示条数
  168. },
  169. dialogTitle: "",
  170. gridData: [],
  171. userId: "",
  172. };
  173. },
  174. created() {
  175. this.userId = this.$route.query.userId || null;
  176. },
  177. mounted() {
  178. this.userId = this.$route.query.userId || null;
  179. this.searchForm.studentId = this.$route.query.userId;
  180. this.getCourseList();
  181. },
  182. activated() {
  183. this.userId = this.$route.query.userId || null;
  184. this.searchForm.studentId = this.$route.query.userId;
  185. this.getCourseList();
  186. },
  187. methods: {
  188. // onCheckCourse(item) {
  189. // this.checkIndex = item.id
  190. // this.getList()
  191. // },
  192. getCourseList() {
  193. let params = this.searchForm;
  194. params.rows = this.pageInfo.limit;
  195. params.page = this.pageInfo.page;
  196. findStudentVipGroupClass(params).then((res) => {
  197. if (res.code == 200) {
  198. this.tableList = res.data.rows;
  199. this.pageInfo.total = res.data.total;
  200. }
  201. });
  202. },
  203. onCourse(row) {
  204. findStudentVipGroups({
  205. vipGroupId: row.vipGroupId,
  206. studentId: this.userId,
  207. }).then((res) => {
  208. this.dialogTitle = row.vipGroupName;
  209. if (res.code == 200) {
  210. this.gridData = res.data.rows;
  211. this.dialogTableVisible = true;
  212. }
  213. });
  214. },
  215. onSearch() {
  216. this.pageInfo.page = 1;
  217. this.getCourseList();
  218. },
  219. // getList() {
  220. // findStudentCourses({
  221. // vipGroupId: this.checkIndex,
  222. // rows: this.pageInfo.limit,
  223. // page: this.pageInfo.page
  224. // }).then(res => {
  225. // if(res.code ==200) {
  226. // this.tableList = res.data.rows
  227. // this.pageInfo.total = res.data.total
  228. // }
  229. // })
  230. // }
  231. },
  232. };
  233. </script>
  234. <style lang="scss">
  235. .studentvip {
  236. .topCard {
  237. display: flex;
  238. flex-direction: row;
  239. justify-content: flex-start;
  240. margin-bottom: 30px;
  241. .cardItem {
  242. margin-right: 15px;
  243. width: 300px;
  244. height: 130px;
  245. padding: 20px 24px;
  246. box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.1);
  247. box-sizing: border-box;
  248. border-radius: 6px;
  249. .top {
  250. display: flex;
  251. flex-direction: row;
  252. justify-content: space-between;
  253. margin-bottom: 23px;
  254. .name {
  255. font-size: 14px;
  256. color: #323c47;
  257. font-weight: 500;
  258. }
  259. .type {
  260. font-size: 14px;
  261. color: #aaa;
  262. }
  263. }
  264. .bottom {
  265. display: flex;
  266. flex-direction: row;
  267. justify-content: space-between;
  268. text-align: center;
  269. p {
  270. font-size: 14px;
  271. color: #444;
  272. }
  273. .title {
  274. color: #aaa;
  275. margin-bottom: 8px;
  276. }
  277. }
  278. }
  279. .cardItem.active {
  280. background-color: #14928a;
  281. .name {
  282. font-size: 14px;
  283. color: #fff;
  284. font-weight: 500;
  285. }
  286. .type {
  287. font-size: 14px;
  288. color: #fff;
  289. }
  290. .bottom {
  291. p {
  292. color: #fff;
  293. }
  294. .title {
  295. color: #fff;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. </style>