forecast-list.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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.subjectFirstName : null }}
  92. {{ !scope.row.subjectFirstName && scope.row.subjectFirst == 999 ? '听从老师安排' : null }},
  93. {{ scope.row.subjectSecondName ? scope.row.subjectSecondName : null }}
  94. {{ !scope.row.subjectSecondName && scope.row.subjectSecond == 999 ? '听从老师安排' : null }}
  95. <!-- {{ scope.row.subjectFirstName }},{{ scope.row.subjectSecondName }} -->
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. align="center"
  100. prop="isAllowAdjust"
  101. label="是否服从调剂"
  102. >
  103. <template slot-scope="scope">
  104. {{ scope.row.isAllowAdjust ? '是' : '否' }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. align="center"
  109. prop="realName"
  110. label="乐器准备方式"
  111. >
  112. <template slot-scope="scope">
  113. {{ scope.row.kitPurchaseMethod == 1 ? '参与团购' : '自行准备' }}
  114. </template>
  115. </el-table-column>
  116. <el-table-column
  117. align="center"
  118. prop="isRegistered"
  119. label="是否已报名"
  120. >
  121. <template slot-scope="scope">
  122. {{ scope.row.isRegistered ? '是' : '否' }}
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <pagination
  127. sync
  128. :total.sync="pageInfo.total"
  129. :page.sync="pageInfo.page"
  130. :limit.sync="pageInfo.limit"
  131. :page-sizes="pageInfo.page_size"
  132. @pagination="getList"
  133. />
  134. </div>
  135. </div>
  136. </div>
  137. </template>
  138. <script>
  139. import pagination from "@/components/Pagination/index";
  140. import { queryPreApplyList } from '../api'
  141. export default {
  142. name: 'forecastName',
  143. components: { pagination },
  144. data() {
  145. const query = this.$route.query
  146. return {
  147. musicGroupId: query.id,
  148. searchForm: {
  149. name: null,
  150. subjectId: null,
  151. isAllowAdjust: null,
  152. },
  153. tableList: [],
  154. pageInfo: {
  155. // 分页规则
  156. limit: 10, // 限制显示条数
  157. page: 1, // 当前页
  158. total: 0, // 总条数
  159. page_size: [10, 20, 40, 50], // 选择限制显示条数
  160. },
  161. }
  162. },
  163. mounted() {
  164. this.$store.dispatch('setSubjects')
  165. this.getList()
  166. },
  167. methods: {
  168. onReSet() {
  169. this.$refs['searchForm'].resetFields()
  170. this.search()
  171. },
  172. search() {
  173. this.pageInfo.page = 1
  174. this.getList()
  175. },
  176. async getList() {
  177. try {
  178. const result = await queryPreApplyList({
  179. ...this.searchForm,
  180. musicGroupId: this.musicGroupId,
  181. page: this.pageInfo.page,
  182. rows: this.pageInfo.limit
  183. })
  184. this.tableList = result.data.rows
  185. this.pageInfo.total = result.data.total
  186. } catch (error) {}
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="less" scoped>
  192. </style>