school-pay-user-list.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <div>
  3. <el-form :inline="true" :model="searchForm">
  4. <el-form-item>
  5. <el-input
  6. v-model.trim="searchForm.search"
  7. @keyup.enter.native="FetchList"
  8. placeholder="学生编号"
  9. clearable
  10. ></el-input>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-select
  14. v-model.trim="searchForm.subjectId"
  15. style="width: 180px"
  16. clearable
  17. filterable
  18. placeholder="请选择声部"
  19. >
  20. <el-option
  21. v-for="(item, index) in storeState.sounds"
  22. :key="index"
  23. :label="item.name"
  24. :value="item.id"
  25. ></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-button @click="FetchList" type="danger">搜索</el-button>
  30. <el-button @click="onReSet" type="primary">重置</el-button>
  31. <el-button
  32. type="primary"
  33. :disabled="!activeChiose.length"
  34. @click="deleteUser"
  35. v-permission="'musicGroupPaymentCalenderDetail/batchDel'"
  36. >删除学员</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <el-table
  40. :data="list"
  41. @selection-change="handleSelectionChange"
  42. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  43. >
  44. <el-table-column type="selection" width="55"> </el-table-column>
  45. <el-table-column
  46. align="center"
  47. prop="userId"
  48. label="学员编号"
  49. width="100"
  50. >
  51. <template slot-scope="scope">
  52. <copy-text>{{ scope.row.userId }}</copy-text>
  53. </template>
  54. </el-table-column>
  55. <el-table-column
  56. width="100"
  57. align="center"
  58. prop="studentId"
  59. label="学员姓名"
  60. >
  61. <template slot-scope="scope">
  62. <div v-if="scope.row.sysUser">
  63. <copy-text>{{ scope.row.sysUser.username }}</copy-text>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column align="center" label="学员声部">
  68. <template slot-scope="scope">
  69. <overflow-text
  70. width="100%"
  71. :text="
  72. scope.row.studentRegistration &&
  73. scope.row.studentRegistration.subjectName
  74. "
  75. ></overflow-text>
  76. </template>
  77. </el-table-column>
  78. <el-table-column align="center" label="学员状态">
  79. <template slot-scope="scope">
  80. <div v-if="scope.row.studentRegistration">
  81. {{
  82. scope.row.studentRegistration.musicGroupStatus | studentTeamStatus
  83. }}
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. width="130"
  89. align="center"
  90. prop="studentId"
  91. label="手机号"
  92. >
  93. <template slot-scope="scope">
  94. <div v-if="scope.row.sysUser">
  95. <copy-text>{{ scope.row.sysUser.phone }}</copy-text>
  96. </div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column width="110" align="center" label="是否开启缴费">
  100. <template slot-scope="scope">
  101. <div>
  102. {{ scope.row.open ? "是" : "否" }}
  103. </div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="center" label="缴费状态">
  107. <template slot-scope="scope">
  108. <div>
  109. {{ scope.row.paymentStatus | paymentStatusDetall }}
  110. </div>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <pagination
  115. :total="rules.total"
  116. :page.sync="rules.page"
  117. :limit.sync="rules.limit"
  118. :page-sizes="rules.page_size"
  119. @pagination="FetchList"
  120. />
  121. </div>
  122. </template>
  123. <script>
  124. import store from '../store'
  125. const initSearchForm = {
  126. search: '',
  127. subjectId: ''
  128. }
  129. import pagination from "@/components/Pagination/index";
  130. import { getmusicGroupPaymentCalenderDetail, delMusicGroupPaymentCalenderStudent } from "@/api/buildTeam";
  131. export default {
  132. props: ['detail'],
  133. components: {
  134. pagination,
  135. },
  136. data() {
  137. return {
  138. searchForm: {
  139. ...initSearchForm
  140. },
  141. list: [],
  142. activeChiose: [],
  143. rules: {
  144. // 分页规则
  145. limit: 10, // 限制显示条数
  146. page: 1, // 当前页
  147. total: 0, // 总条数
  148. page_size: [10, 20, 40, 50], // 选择限制显示条数
  149. },
  150. };
  151. },
  152. computed: {
  153. storeState() {
  154. return store.state
  155. }
  156. },
  157. mounted() {
  158. if (this.detail) {
  159. store.dispatch('getFindSound', {
  160. data: {
  161. musicGroupId: this.detail.musicGroupId
  162. }
  163. })
  164. this.FetchList();
  165. }
  166. },
  167. methods: {
  168. handleSelectionChange(val) {
  169. this.activeChiose = val;
  170. },
  171. onReSet() {
  172. this.searchForm = {
  173. ...initSearchForm
  174. }
  175. this.FetchList()
  176. },
  177. async deleteUser() {
  178. try {
  179. await this.$confirm('是否删除选中学员?', '提示', {
  180. type: 'warning'
  181. })
  182. await delMusicGroupPaymentCalenderStudent({
  183. musicGroupPaymentCalenderDetailIds: this.activeChiose.map(item => item.id).join(',')
  184. })
  185. this.$message.success('删除成功')
  186. this.FetchList()
  187. } catch (error) {}
  188. },
  189. async FetchList() {
  190. try {
  191. const res = await getmusicGroupPaymentCalenderDetail({
  192. id: this.detail.id,
  193. page: this.rules.page,
  194. rows: this.rules.limit,
  195. ...this.searchForm,
  196. });
  197. this.rules.total = res.data.total;
  198. this.list = res.data.rows;
  199. } catch (error) {}
  200. },
  201. },
  202. };
  203. </script>
  204. <style lang="less" scoped>
  205. </style>