studentVip.vue 9.0 KB

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