index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div id="studentMenu">
  3. <div>
  4. <el-button
  5. :size="size"
  6. :type="active === 1 ? 'primary' : ''"
  7. @click="changeActive(1)"
  8. >班级学员</el-button
  9. >
  10. <el-button
  11. :size="size"
  12. :type="active === 2 ? 'primary' : ''"
  13. @click="changeActive(2)"
  14. >学时管理</el-button
  15. >
  16. </div>
  17. <table-list
  18. :tableSets="tableSet"
  19. :tableData="tableData"
  20. :navText="navText"
  21. @addClick="addClick"
  22. :loading="loading"
  23. @editInfo="editInfo"
  24. >
  25. <template slot="btn" slot-scope="props">
  26. <el-button type="text" @click="addClick(props.scope.row, 2)"
  27. >详情</el-button
  28. >
  29. <el-button type="text" @click="addClick(props.scope.row, 3)"
  30. >学员管理</el-button
  31. >
  32. <el-button type="text" @click="del(props.scope.row)">删除</el-button>
  33. </template>
  34. </table-list>
  35. <pagination
  36. :total="total"
  37. :pageSize="formData.pageSize"
  38. :currentPage="formData.pageNum"
  39. @handleSizeChange="handleSizeChange"
  40. @handleCurrentChange="handleCurrentChange"
  41. />
  42. </div>
  43. </template>
  44. <script>
  45. import tableList from "@/components/tableList";
  46. import pagination from "@/components/pagination";
  47. export default {
  48. components: { tableList, pagination },
  49. data() {
  50. return {
  51. size: "small",
  52. active: 1,
  53. loading: false, //当前表单加载是否加载动画
  54. navText: {
  55. title: "班级管理",
  56. index: 0,
  57. ch: "条",
  58. num: false,
  59. choice: true,
  60. addHide: false,
  61. backFatherBtn: {
  62. status: false,
  63. title: "未定义",
  64. },
  65. },
  66. formData: {
  67. status: "0,1",
  68. pageSize: 10,
  69. pageNum: 1,
  70. },
  71. // 表单
  72. tableSet: [
  73. {
  74. label: "学员编码",
  75. prop: "code",
  76. hidden: true,
  77. },
  78. {
  79. label: "学员姓名",
  80. prop: "code",
  81. hidden: true,
  82. },
  83. {
  84. label: "学员身份证",
  85. prop: "code",
  86. hidden: true,
  87. },
  88. {
  89. label: "绑定手机号码",
  90. prop: "code",
  91. hidden: true,
  92. },
  93. {
  94. label: "资料变更状态",
  95. prop: "code",
  96. hidden: true,
  97. },
  98. {
  99. label: "学时",
  100. prop: "code",
  101. hidden: true,
  102. },
  103. {
  104. label: "视频学习进度(节)",
  105. prop: "code",
  106. hidden: true,
  107. },
  108. {
  109. label: "做题进度(章卷)",
  110. prop: "code",
  111. hidden: true,
  112. },
  113. {
  114. label: "学时审批状态",
  115. prop: "code",
  116. hidden: true,
  117. },
  118. {
  119. label: "学习有效期",
  120. prop: "learningStatus",
  121. prop1: "learningTimeStart",
  122. hidden: true,
  123. scope: "classTimeTypes",
  124. width: "120px",
  125. },
  126. {
  127. label: "班级有效期",
  128. prop1: "classStartTime",
  129. prop2: "classEndTime",
  130. hidden: true,
  131. Diszing: false,
  132. scope: "TimeLists",
  133. width: "120px",
  134. },
  135. {
  136. label: "结业状态",
  137. prop: "code",
  138. hidden: true,
  139. },
  140. ],
  141. tableData: [], //表单数据
  142. total: 0, //一共多少条
  143. };
  144. },
  145. methods: {
  146. editInfo(v) {
  147. this.addClick(v, 2);
  148. },
  149. addClick(v, int) {
  150. // int = 2详情 3学员管理
  151. if (v === undefined) {
  152. // 添加班级
  153. this.$router.push({
  154. path: "addClass",
  155. });
  156. } else {
  157. if (int === 2) {
  158. //班级详情
  159. this.$router.push({
  160. path:'manageClass',
  161. query:{
  162. id:v.classId
  163. }
  164. })
  165. }
  166. if (int === 3) {
  167. // 学员管理
  168. this.$router.push({
  169. path: "studentMenu",
  170. query: {
  171. id: v.classId,
  172. },
  173. });
  174. }
  175. }
  176. },
  177. changeActive(int) {
  178. this.active = int;
  179. },
  180. search(int) {
  181. this.loading = true;
  182. if (int === 1) {
  183. this.formData.pageNum = 1;
  184. }
  185. if (int === 2) {
  186. this.formData = {
  187. status: "0,1",
  188. pageSize: 10,
  189. pageNum: 1,
  190. };
  191. }
  192. this.$api.inquireGradegradeList(this.formData).then((res) => {
  193. this.tableData = res.rows;
  194. this.total = res.total;
  195. // this.navText.index = res.total;
  196. }).finally(()=>{
  197. this.loading = false;
  198. })
  199. },
  200. handleSizeChange(v) {
  201. this.formData.pageSize = v;
  202. this.formData.pageNum = 1;
  203. this.search();
  204. },
  205. handleCurrentChange(v) {
  206. this.formData.pageNum = v;
  207. this.search();
  208. },
  209. },
  210. };
  211. </script>
  212. <style lang="less" scoped>
  213. </style>