notClassStudent.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. @submit="search"
  12. @reset="onReSet"
  13. ref="searchFrom"
  14. :model="searchForm"
  15. >
  16. <el-form-item prop="musicGroupSearch">
  17. <el-input
  18. v-model.trim="searchForm.musicGroupSearch"
  19. clearable
  20. @keyup.enter.native="
  21. (e) => {
  22. e.target.blur();
  23. $refs.searchForm.save();
  24. search();
  25. }
  26. "
  27. placeholder="乐团名称/编号"
  28. ></el-input>
  29. </el-form-item>
  30. <el-form-item prop="studentSearch">
  31. <el-input
  32. v-model.trim="searchForm.studentSearch"
  33. clearable
  34. @keyup.enter.native="
  35. (e) => {
  36. e.target.blur();
  37. $refs.searchForm.save();
  38. search();
  39. }
  40. "
  41. placeholder="学员姓名/编号"
  42. ></el-input>
  43. </el-form-item>
  44. <el-form-item prop="organIds">
  45. <el-select
  46. placeholder="请选择分部"
  47. v-model="searchForm.organIds"
  48. clearable
  49. >
  50. <el-option
  51. v-for="(item, index) in selects.branchs"
  52. :label="item.name"
  53. :value="item.id"
  54. :key="index"
  55. ></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button type="danger" native-type="submit">搜索</el-button>
  60. <el-button native-type="reset" type="primary">重置</el-button>
  61. <auth :auths="['export/noClassGroupStudentList']">
  62. <el-button @click="onExport" type="primary">导出</el-button>
  63. </auth>
  64. </el-form-item>
  65. </save-form>
  66. <div class="tableWrap">
  67. <el-table
  68. style="width: 100%"
  69. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  70. :data="tableList"
  71. >
  72. <el-table-column align="center" label="分部">
  73. <template slot-scope="scope">
  74. <copy-text>{{ scope.row.organName }}</copy-text>
  75. </template>
  76. </el-table-column>
  77. <el-table-column align="center" label="乐团编号">
  78. <template slot-scope="scope">
  79. <copy-text>{{ scope.row.groupId }}</copy-text>
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center" label="乐团名称">
  83. <template slot-scope="scope">
  84. <copy-text>{{ scope.row.groupName }}</copy-text>
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="center" label="学员编号">
  88. <template slot-scope="scope">
  89. <copy-text>{{ scope.row.studentId }}</copy-text>
  90. </template>
  91. </el-table-column>
  92. <el-table-column align="center" label="学员姓名">
  93. <template slot-scope="scope">
  94. <copy-text>{{ scope.row.studentName }}</copy-text>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="center" label="学员声部" prop="subjectName">
  98. </el-table-column>
  99. <el-table-column align="center" label="操作">
  100. <template slot-scope="scope">
  101. <auth :auths="['notClassStudent/nowLook', '/resetTeaming']" mulit>
  102. <el-button type="text" @click="showDetail(scope.row)"
  103. >立即处理</el-button
  104. >
  105. </auth>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <pagination
  110. sync
  111. :total.sync="rules.total"
  112. :page.sync="rules.page"
  113. :limit.sync="rules.limit"
  114. :page-sizes="rules.page_size"
  115. @pagination="getList"
  116. />
  117. </div>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import pagination from "@/components/Pagination/index";
  123. import { queryNoClassMusicStudentInfo } from "./api.js";
  124. import { Export } from "@/utils/downLoadFile";
  125. import cleanDeep from "clean-deep";
  126. import qs from "qs";
  127. export default {
  128. components: { pagination },
  129. data() {
  130. return {
  131. searchForm: {
  132. musicGroupSearch: null,
  133. studentSearch: null,
  134. organIds: null,
  135. },
  136. rules: {
  137. // 分页规则
  138. limit: 10, // 限制显示条数
  139. page: 1, // 当前页
  140. total: 0, // 总条数
  141. page_size: [10, 20, 40, 50], // 选择限制显示条数
  142. },
  143. tableList: [],
  144. };
  145. },
  146. //生命周期 - 挂载完成(可以访问DOM元素)
  147. mounted() {
  148. const { query } = this.$route;
  149. if (query.organId) {
  150. this.searchForm.organIds = Number(query.organId);
  151. }
  152. this.$store.dispatch("setBranchs");
  153. this.getList();
  154. },
  155. methods: {
  156. search() {
  157. this.rules.page = 1;
  158. this.getList();
  159. },
  160. onReSet() {
  161. this.$refs["searchFrom"].resetFields();
  162. this.getList();
  163. },
  164. async getList() {
  165. try {
  166. const { ...search } = this.searchForm;
  167. const params = {
  168. ...search,
  169. page: this.rules.page,
  170. rows: this.rules.limit,
  171. };
  172. let res = await queryNoClassMusicStudentInfo(params);
  173. this.tableList = res.data.rows;
  174. this.rules.total = res.data.total;
  175. } catch (err) {
  176. //
  177. }
  178. },
  179. showDetail(item) {
  180. // ?status=PROGRESS&id=21040114171500001&name=0401莫莫2&organId=1&type=resetTeam&team_status=PROGRESS&tabrouter=5
  181. this.$router.push({
  182. path: "/business/resetTeaming",
  183. query: {
  184. type: "resetTeam",
  185. status: "PROGRESS",
  186. team_status: "PROGRESS",
  187. id: item.groupId,
  188. name: item.groupName,
  189. organId: item.organId,
  190. tabrouter: 5,
  191. },
  192. });
  193. },
  194. onExport() {
  195. Export(
  196. this,
  197. {
  198. url: "/api-web/export/noClassGroupStudentList",
  199. fileName: "未在班级学员.xls",
  200. method: "post",
  201. params: qs.stringify(cleanDeep(this.searchForm)),
  202. },
  203. "您确定导出未在班级学员?"
  204. );
  205. },
  206. },
  207. };
  208. </script>
  209. <style lang='scss' scoped>
  210. </style>