templateList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 班级列表
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. @reset="onReSet"
  14. ref="saveForm"
  15. >
  16. <el-form-item>
  17. <el-input
  18. v-model.trim="searchForm.search"
  19. clearable
  20. @keyup.enter.native="
  21. (e) => {
  22. e.target.blur();
  23. $refs.saveForm.save();
  24. search();
  25. }
  26. "
  27. placeholder="请输入乐团编号"
  28. ></el-input>
  29. </el-form-item>
  30. <el-form-item>
  31. <el-input
  32. v-model.trim="searchForm.search"
  33. @keyup.enter.native="
  34. (e) => {
  35. e.target.blur();
  36. $refs.saveForm.save();
  37. search();
  38. }
  39. "
  40. placeholder="请输入乐团编号"
  41. ></el-input>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button native-type="submit" type="primary">搜索</el-button>
  45. <el-button native-type="reset" type="danger">重置</el-button>
  46. </el-form-item>
  47. </save-form>
  48. <div class="tableWrap">
  49. <el-table
  50. style="width: 100%"
  51. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  52. :data="tableList"
  53. >
  54. <el-table-column
  55. align="center"
  56. prop="studentId"
  57. label="代理商编号"
  58. ></el-table-column>
  59. <el-table-column
  60. align="center"
  61. prop="studentId"
  62. label="代理商名称"
  63. ></el-table-column>
  64. <el-table-column
  65. align="center"
  66. prop="studentId"
  67. label="机构编号"
  68. ></el-table-column>
  69. <el-table-column
  70. align="center"
  71. prop="studentId"
  72. label="机构名称"
  73. ></el-table-column>
  74. <el-table-column
  75. align="center"
  76. prop="studentId"
  77. label="激活时间"
  78. ></el-table-column>
  79. <el-table-column
  80. align="center"
  81. prop="studentId"
  82. label="激活数量"
  83. ></el-table-column>
  84. <el-table-column
  85. align="center"
  86. prop="studentId"
  87. label="推荐人"
  88. ></el-table-column>
  89. </el-table>
  90. <pagination
  91. sync
  92. :total.sync="rules.total"
  93. :page.sync="rules.page"
  94. :limit.sync="rules.limit"
  95. :page-sizes="rules.page_size"
  96. @pagination="getList"
  97. />
  98. </div>
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import axios from "axios";
  104. import { getToken } from "@/utils/auth";
  105. import pagination from "@/components/Pagination/index";
  106. import load from "@/utils/loading";
  107. import { getTimes } from "@/utils";
  108. export default {
  109. components: { pagination },
  110. data() {
  111. return {
  112. searchForm: {
  113. search: null,
  114. },
  115. tableList: [],
  116. organList: [],
  117. rules: {
  118. // 分页规则
  119. limit: 10, // 限制显示条数
  120. page: 1, // 当前页
  121. total: 0, // 总条数
  122. page_size: [10, 20, 40, 50], // 选择限制显示条数
  123. },
  124. };
  125. },
  126. //生命周期 - 创建完成(可以访问当前this实例)
  127. created() {},
  128. //生命周期 - 挂载完成(可以访问DOM元素)
  129. mounted() {
  130. // 获取分部
  131. this.init();
  132. },
  133. methods: {
  134. init() {},
  135. getList() {
  136. let { timer, ...rest } = this.searchForm;
  137. let params = {
  138. ...rest,
  139. page: this.rules.page,
  140. rows: this.rules.limit,
  141. ...getTimes(timer, ["startTime", "endTime"]),
  142. };
  143. },
  144. search() {
  145. this.rules.page = 1;
  146. this.getList();
  147. },
  148. onReSet() {},
  149. },
  150. };
  151. </script>
  152. <style lang='scss' scoped>
  153. </style>