studentMaster.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div>
  3. <el-form
  4. ref="searchForm"
  5. :inline="true"
  6. class="searchForm"
  7. :model="searchForm"
  8. >
  9. <el-form-item prop="search">
  10. <el-input
  11. v-model.trim="searchForm.search"
  12. clearable
  13. placeholder="学生姓名或电话"
  14. @keyup.enter.native="search"
  15. ></el-input>
  16. </el-form-item>
  17. <el-form-item prop="subjectId">
  18. <el-select
  19. v-model.trim="searchForm.subjectId"
  20. clearable
  21. filterable
  22. placeholder="请选择声部"
  23. >
  24. <el-option
  25. v-for="(item, index) in soundList"
  26. :key="index"
  27. :value="item.id"
  28. :label="item.name"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item prop="currentGradeNum">
  33. <el-select
  34. v-model.trim="searchForm.currentGradeNum"
  35. filterable
  36. clearable
  37. placeholder="请选择年级"
  38. >
  39. <el-option
  40. v-for="(item, index) in gradeList"
  41. :key="index"
  42. :label="item.label"
  43. :value="item.value"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item prop="isBuyInstrumentsInsurance">
  48. <el-select
  49. v-model="searchForm.isBuyInstrumentsInsurance"
  50. clearable
  51. filterable
  52. placeholder="是否购买月保"
  53. >
  54. <el-option label="否" value="0"></el-option>
  55. <el-option label="是" value="1"></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button type="danger" @click="search">搜索</el-button>
  60. <el-button type="primary" @click="onReSet">重置</el-button>
  61. <!-- <el-button
  62. type="primary"
  63. v-permission="'export/musicGroupStudent'"
  64. @click="onMusicGroupExport"
  65. >导出</el-button
  66. > -->
  67. </el-form-item>
  68. </el-form>
  69. <el-table
  70. :data="tableList"
  71. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  72. >
  73. <el-table-column label="学员编号" width="120px;" prop="userId">
  74. </el-table-column>
  75. <el-table-column label="学员姓名" width="120px;" prop="name">
  76. </el-table-column>
  77. <el-table-column align="center" prop="phone" label="联系电话">
  78. <template slot-scope="scope">
  79. <copy-text>
  80. {{ scope.row.phone }}
  81. </copy-text>
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" label="声部" prop="subjectName">
  85. <template slot-scope="scope">
  86. <copy-text>
  87. {{ scope.row.subjectName }}
  88. </copy-text>
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="center" label="年级">
  92. <template slot-scope="scope">
  93. <div>{{getGrade(scope.row.currentGradeNum) }}</div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="center" label="乐器品牌">
  97. <template slot-scope="scope">
  98. <div>{{ scope.row.goodsBrand }}</div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="center" label="乐器型号">
  102. <template slot-scope="scope">
  103. <div>{{ scope.row.specification }}</div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="center" label="购买日期">
  107. <template slot-scope="scope">
  108. <div>{{ scope.row.goodsBuyTime | formatTimer }}</div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="center" label="是否购买月保">
  112. <template slot-scope="scope">
  113. <div>{{ scope.row.insuranceStartTime ? "是" : "否" }}</div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" label="月保有效期" width="100px">
  117. <template slot-scope="scope">
  118. <div>{{ scope.row.insuranceStartTime | formatTimer }}~{{ scope.row.insuranceEndTime | formatTimer }}</div>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <pagination
  123. :total.sync="rules.total"
  124. :page.sync="rules.page"
  125. :limit.sync="rules.limit"
  126. :page-sizes="rules.page_size"
  127. @pagination="getList"
  128. />
  129. </div>
  130. </template>
  131. <script>
  132. import { getStudentList } from "../api"
  133. import pagination from "@/components/Pagination/index";
  134. export default {
  135. props: ["searchForm", "soundList", "gradeList","gradeMap"],
  136. components:{pagination},
  137. data() {
  138. return {
  139. tableList: [],
  140. rules: {
  141. // 分页规则
  142. limit: 10, // 限制显示条数
  143. page: 1, // 当前页
  144. total: 0, // 总条数
  145. page_size: [10, 20, 40, 50], // 选择限制显示条数
  146. },
  147. };
  148. },
  149. mounted() {
  150. this.getList()
  151. },
  152. methods: {
  153. async getList(){
  154. try{
  155. const res = await getStudentList({...this.searchForm,page:this.rules.page,rows:this.rules.limit, musicGroupId: this.$route.query.id})
  156. // res.data.rows
  157. this.tableList = res.data.rows
  158. this.rules.total = res.data.total
  159. }catch(e){
  160. }
  161. },
  162. onMusicGroupExport() {},
  163. search() {
  164. this.rules.page = 1;
  165. this.getList()
  166. },
  167. onReSet() {
  168. this.$refs.searchForm.resetFields()
  169. this.search()
  170. },
  171. getGrade(id){
  172. return this.gradeMap[id]
  173. }
  174. },
  175. };
  176. </script>