accountManager.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 prop="organId">
  31. <el-select
  32. style="width: 180px !important"
  33. class="multiple"
  34. v-model.trim="searchForm.organId"
  35. filterable
  36. clearable
  37. placeholder="请选择分部"
  38. >
  39. <el-option
  40. v-for="(item, index) in selects.branchs"
  41. :key="index"
  42. :label="item.name"
  43. :value="item.id"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item prop="search">
  48. <el-select
  49. v-model.trim="searchForm.search"
  50. :disabled="!searchForm.organId"
  51. filterable
  52. clearable
  53. placeholder="请选择合作单位"
  54. >
  55. <el-option
  56. v-for="(item, index) in cooperationList"
  57. :key="index"
  58. :label="item.name"
  59. :value="item.id"
  60. ></el-option>
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item>
  64. <el-button native-type="submit" type="primary">搜索</el-button>
  65. <el-button native-type="reset" type="danger">重置</el-button>
  66. </el-form-item>
  67. </save-form>
  68. <div class="tableWrap">
  69. <el-table
  70. style="width: 100%"
  71. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  72. :data="tableList"
  73. >
  74. <el-table-column align="center" prop="studentId" label="编号"></el-table-column>
  75. <el-table-column align="center" prop="studentId" label="分部"></el-table-column>
  76. <el-table-column
  77. align="center"
  78. prop="studentId"
  79. label="合作单位"
  80. ></el-table-column>
  81. <el-table-column
  82. align="center"
  83. prop="studentId"
  84. label="老师姓名"
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="studentId"
  89. label="账号类型"
  90. ></el-table-column>
  91. <el-table-column
  92. align="center"
  93. prop="studentId"
  94. label="账号状态"
  95. ></el-table-column>
  96. <el-table-column
  97. align="center"
  98. prop="studentId"
  99. label="联系电话"
  100. ></el-table-column>
  101. <el-table-column
  102. align="center"
  103. prop="studentId"
  104. label="注册日期"
  105. ></el-table-column>
  106. <el-table-column align="center" prop="studentId" label="操作"></el-table-column>
  107. </el-table>
  108. <pagination
  109. sync
  110. :total.sync="rules.total"
  111. :page.sync="rules.page"
  112. :limit.sync="rules.limit"
  113. :page-sizes="rules.page_size"
  114. @pagination="getList"
  115. />
  116. </div>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import axios from "axios";
  122. import { getToken } from "@/utils/auth";
  123. import pagination from "@/components/Pagination/index";
  124. import load from "@/utils/loading";
  125. import { getTimes } from "@/utils";
  126. import { queryByOrganId } from "@/api/systemManage";
  127. import { courseType, courseListType } from "@/utils/searchArray";
  128. export default {
  129. components: { pagination },
  130. data() {
  131. return {
  132. searchForm: {
  133. search: null,
  134. organId: null,
  135. courseType: null,
  136. },
  137. courseType,
  138. tableList: [],
  139. organList: [],
  140. cooperationList: [],
  141. rules: {
  142. // 分页规则
  143. limit: 10, // 限制显示条数
  144. page: 1, // 当前页
  145. total: 0, // 总条数
  146. page_size: [10, 20, 40, 50], // 选择限制显示条数
  147. },
  148. };
  149. },
  150. //生命周期 - 创建完成(可以访问当前this实例)
  151. created() {},
  152. //生命周期 - 挂载完成(可以访问DOM元素)
  153. mounted() {
  154. // 获取分部
  155. this.$store.dispatch("setBranchs");
  156. this.init();
  157. },
  158. methods: {
  159. init() {},
  160. getList() {
  161. let { timer, ...rest } = this.searchForm;
  162. let params = {
  163. ...rest,
  164. page: this.rules.page,
  165. rows: this.rules.limit,
  166. ...getTimes(timer, ["startTime", "endTime"]),
  167. };
  168. },
  169. search() {
  170. this.rules.page = 1;
  171. this.getList();
  172. },
  173. onReSet() {},
  174. },
  175. watch: {
  176. "searchForm.organId"(val) {
  177. if (val) {
  178. queryByOrganId({ organId: val }).then((res) => {
  179. if (res.code == 200) {
  180. this.cooperationList = res.data;
  181. }
  182. });
  183. }
  184. },
  185. // "searchForm.cooperationId"(val) {
  186. // if (val) {
  187. // getMusicGroup({ cooperationId: val }).then((res) => {
  188. // this.musicList = res.data;
  189. // });
  190. // }
  191. // },
  192. },
  193. };
  194. </script>
  195. <style lang="scss" scoped></style>