forecast-list.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="forecastName">
  3. <div class="m-core">
  4. <save-form
  5. :inline="true"
  6. @reset="onReSet"
  7. @submit="search"
  8. :model="searchForm"
  9. ref="searchForm"
  10. >
  11. <el-form-item>
  12. <el-input
  13. v-model.trim="searchForm.name"
  14. clearable
  15. @keyup.enter.native="search"
  16. placeholder="学生编号/姓名/手机号"
  17. ></el-input>
  18. </el-form-item>
  19. <el-form-item prop="isAllowAdjust">
  20. <el-select
  21. v-model.trim="searchForm.isAllowAdjust"
  22. clearable
  23. placeholder="是否允许调剂"
  24. >
  25. <el-option label="是" :value="1"></el-option>
  26. <el-option label="否" :value="0"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-select clearable v-model="searchForm.subjectId" placeholder="所选专业">
  31. <el-option v-for="item in selects.subjects" :value="item.id" :label="item.name" :key="item.id"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="danger" native-type="seach">搜索</el-button>
  36. <el-button native-type="reset" type="primary">重置</el-button>
  37. </el-form-item>
  38. </save-form>
  39. <div class="tableWrap">
  40. <el-table
  41. style="width: 100%"
  42. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  43. :data="tableList"
  44. >
  45. <el-table-column
  46. align="center"
  47. prop="userId"
  48. label="学员编号"
  49. >
  50. <template slot-scope="scope">
  51. <copy-text>{{ scope.row.userId }}</copy-text>
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. align="center"
  56. prop="userName"
  57. label="学员姓名"
  58. ></el-table-column>
  59. <el-table-column
  60. align="center"
  61. prop="gender"
  62. label="性别"
  63. >
  64. <template slot-scope="scope">
  65. {{ scope.row.gender ? '男' : '女' }}
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. align="center"
  70. prop="phone"
  71. label="联系电话"
  72. >
  73. <template slot-scope="scope">
  74. <copy-text>{{ scope.row.phone }}</copy-text>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. align="center"
  79. label="年级班级"
  80. >
  81. <template slot-scope="scope">
  82. {{ scope.row.currentGrade }}{{ scope.row.currentClass }}
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. align="center"
  87. prop="subjectFirstName"
  88. label="选报声部"
  89. >
  90. <template slot-scope="scope">
  91. {{ scope.row.subjectFirstName }},{{ scope.row.subjectSecondName }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. align="center"
  96. prop="isAllowAdjust"
  97. label="是否服从调剂"
  98. >
  99. <template slot-scope="scope">
  100. {{ scope.row.isAllowAdjust ? '是' : '否' }}
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. align="center"
  105. prop="realName"
  106. label="乐器准备方式"
  107. >
  108. <template slot-scope="scope">
  109. {{ scope.row.kitPurchaseMethod == 1 ? '参与团购' : '自行准备' }}
  110. </template>
  111. </el-table-column>
  112. <el-table-column
  113. align="center"
  114. prop="isRegistered"
  115. label="是否已报名"
  116. >
  117. <template slot-scope="scope">
  118. {{ scope.row.isRegistered ? '是' : '否' }}
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <pagination
  123. sync
  124. :total.sync="pageInfo.total"
  125. :page.sync="pageInfo.page"
  126. :limit.sync="pageInfo.limit"
  127. :page-sizes="pageInfo.page_size"
  128. @pagination="getList"
  129. />
  130. </div>
  131. </div>
  132. </div>
  133. </template>
  134. <script>
  135. import pagination from "@/components/Pagination/index";
  136. import { queryPreApplyList } from '../api'
  137. export default {
  138. name: 'forecastName',
  139. components: { pagination },
  140. data() {
  141. const query = this.$route.query
  142. return {
  143. musicGroupId: query.id,
  144. searchForm: {
  145. name: null,
  146. subjectId: null,
  147. isAllowAdjust: null,
  148. },
  149. tableList: [],
  150. pageInfo: {
  151. // 分页规则
  152. limit: 10, // 限制显示条数
  153. page: 1, // 当前页
  154. total: 0, // 总条数
  155. page_size: [10, 20, 40, 50], // 选择限制显示条数
  156. },
  157. }
  158. },
  159. mounted() {
  160. this.$store.dispatch('setSubjects')
  161. this.getList()
  162. },
  163. methods: {
  164. onReSet() {
  165. this.$refs['searchForm'].resetFields()
  166. this.search()
  167. },
  168. search() {
  169. this.pageInfo.page = 1
  170. this.getList()
  171. },
  172. async getList() {
  173. try {
  174. const result = await queryPreApplyList({
  175. ...this.searchForm,
  176. musicGroupId: this.musicGroupId,
  177. page: this.pageInfo.page,
  178. rows: this.pageInfo.limit
  179. })
  180. this.tableList = result.data.rows
  181. this.pageInfo.total = result.data.total
  182. } catch (error) {}
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="less" scoped>
  188. </style>