studentVip.vue 8.8 KB

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