index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>欠费学员列表 <filter-search @reload="FetchList" :keys="['visitFlag']" :moreKeys="['organId']"/>
  5. </h2>
  6. <div class="m-core">
  7. <save-form
  8. :inline="true"
  9. @submit="submit"
  10. @reset="onReSet"
  11. ref="searchForm"
  12. :model.sync="searchForm"
  13. >
  14. <el-form-item>
  15. <el-input
  16. v-model.trim="searchForm.search"
  17. clearable
  18. placeholder="学员编号、姓名"
  19. ></el-input>
  20. </el-form-item>
  21. <el-form-item>
  22. <el-select
  23. v-model.trim="searchForm.organIds"
  24. clearable
  25. filterable
  26. multiple
  27. collapse-tags
  28. placeholder="请选择所属分部"
  29. >
  30. <el-option
  31. v-for="(item, index) in selects.branchs"
  32. :key="index"
  33. :label="item.name"
  34. :value="item.id"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-select
  40. v-model.trim="searchForm.musicGroupId"
  41. clearable
  42. filterable
  43. placeholder="请选择乐团"
  44. >
  45. <el-option
  46. v-for="(item, index) in musicList"
  47. :key="index"
  48. :value="item.id"
  49. :label="item.name"
  50. ></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item>
  54. <el-select
  55. v-model.trim="searchForm.cooperationOrganId"
  56. clearable
  57. filterable
  58. placeholder="请选择合作单位"
  59. >
  60. <el-option
  61. v-for="(item, index) in cooperations"
  62. :key="index"
  63. :value="item.id"
  64. :label="item.name"
  65. ></el-option>
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item>
  69. <remote-search
  70. :commit="'setEducations'"
  71. v-model="searchForm.eduTeacherId"
  72. />
  73. </el-form-item>
  74. <el-form-item>
  75. <el-button native-type="submit" type="danger">搜索</el-button>
  76. <el-button native-type="reset" type="primary">重置</el-button>
  77. </el-form-item>
  78. </save-form>
  79. <el-table
  80. :data="list"
  81. style="width: 100%"
  82. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  83. >
  84. <el-table-column
  85. prop="userId"
  86. label="学员编号"
  87. >
  88. <copy-text slot-scope="scope">{{scope.row.userId}}</copy-text>
  89. </el-table-column>
  90. <el-table-column
  91. prop="studentName"
  92. label="学员姓名"
  93. >
  94. <copy-text slot-scope="scope">{{scope.row.studentName}}</copy-text>
  95. </el-table-column>
  96. <el-table-column
  97. prop="organName"
  98. label="所属分部"
  99. >
  100. <copy-text slot-scope="scope">{{scope.row.organName}}</copy-text>
  101. </el-table-column>
  102. <el-table-column
  103. prop="cooperationName"
  104. label="合作单位"
  105. >
  106. <copy-text slot-scope="scope">{{scope.row.cooperationName}}</copy-text>
  107. </el-table-column>
  108. <el-table-column
  109. prop="musicGroupName"
  110. label="所在乐团"
  111. >
  112. <copy-text slot-scope="scope">{{scope.row.musicGroupName}}</copy-text>
  113. </el-table-column>
  114. <el-table-column
  115. prop="eduTeacherName"
  116. label="乐团主管"
  117. >
  118. <copy-text slot-scope="scope">{{scope.row.eduTeacherName}}</copy-text>
  119. </el-table-column>
  120. <el-table-column
  121. prop="subjectName"
  122. label="声部"
  123. >
  124. <copy-text slot-scope="scope">{{scope.row.subjectName}}</copy-text>
  125. </el-table-column>
  126. <el-table-column
  127. prop="gender"
  128. label="性别"
  129. >
  130. <span slot-scope="scope">{{scope.row.gender | sex}}</span>
  131. </el-table-column>
  132. <el-table-column
  133. prop="parentName"
  134. label="家长姓名"
  135. >
  136. <copy-text slot-scope="scope">{{scope.row.parentName}}</copy-text>
  137. </el-table-column>
  138. <el-table-column
  139. prop="phone"
  140. label="家长联系电话"
  141. >
  142. <copy-text slot-scope="scope">{{scope.row.phone}}</copy-text>
  143. </el-table-column>
  144. <el-table-column
  145. prop="noPaymentAmount"
  146. label="欠费金额"
  147. >
  148. <span style="color: red;" slot-scope="scope">{{scope.row.noPaymentAmount | moneyFormat}}</span>
  149. </el-table-column>
  150. <el-table-column
  151. prop="ctrls"
  152. label="操作"
  153. fixed="right"
  154. v-if="permission('musicGroupPaymentCalenderDetail/queryPage/list')"
  155. >
  156. <el-button slot-scope="scope" type="text" @click="view(scope.row)">查看</el-button>
  157. </el-table-column>
  158. </el-table>
  159. <pagination
  160. sync
  161. :total.sync="rules.total"
  162. :page.sync="rules.page"
  163. :limit.sync="rules.limit"
  164. :page-sizes="rules.page_size"
  165. @pagination="FetchList"
  166. />
  167. </div>
  168. <el-dialog width="1000px" title="缴费记录" :visible.sync="visible">
  169. <list-dialog
  170. v-if="visible && detail"
  171. @close="visible = false"
  172. :musicGroupId="detail.musicGroupId"
  173. :userId="detail.userId"
  174. />
  175. </el-dialog>
  176. </div>
  177. </template>
  178. <script>
  179. import pagination from "@/components/Pagination/index";
  180. import list from './modals/list'
  181. import { permission } from '@/utils/directivePage'
  182. import { getCooperation } from '@/api/buildTeam'
  183. import { queryArrearageStudents, getNoPaymentStudentMusicGroups } from './api'
  184. const initSearch = {
  185. search: '',
  186. eduTeacherId: null,
  187. organIds: [],
  188. branchs: null,
  189. musicGroupId: null,
  190. cooperationOrganId: null,
  191. }
  192. export default {
  193. components: {
  194. pagination,
  195. 'list-dialog': list
  196. },
  197. data() {
  198. return {
  199. list: [],
  200. visible: false,
  201. detail: null,
  202. musicList: [],
  203. searchForm: {
  204. ...initSearch
  205. },
  206. cooperations: [],
  207. rules: {
  208. // 分页规则
  209. limit: 10, // 限制显示条数
  210. page: 1, // 当前页
  211. total: 0, // 总条数
  212. page_size: [10, 20, 40, 50], // 选择限制显示条数
  213. },
  214. }
  215. },
  216. mounted() {
  217. const { query } = this.$route
  218. if (query.organId) {
  219. console.log(query.organId)
  220. this.searchForm.organIds = [Number(query.organId)]
  221. }
  222. getCooperation({ rows: 1000 }).then((res) => {
  223. this.cooperations = res.data.rows
  224. })
  225. this.$store.dispatch('setBranchs')
  226. this.$store.dispatch('setSchools')
  227. this.FetchList()
  228. this.FetchMusicList()
  229. },
  230. methods: {
  231. permission,
  232. async FetchList() {
  233. try {
  234. const { organIds, ...rest} = this.searchForm
  235. const res = await queryArrearageStudents({
  236. page: this.rules.page,
  237. rows: this.rules.limit,
  238. organIds: organIds.join(','),
  239. ...rest,
  240. })
  241. this.rules.total = res.data.total;
  242. this.list = res.data.rows
  243. } catch (error) {}
  244. },
  245. async FetchMusicList() {
  246. try {
  247. const res = await getNoPaymentStudentMusicGroups()
  248. this.musicList = res.data
  249. } catch (error) {}
  250. },
  251. submit() {
  252. this.rules.page = 1
  253. this.FetchList()
  254. },
  255. onReSet() {
  256. this.searchForm = {...initSearch}
  257. this.submit();
  258. },
  259. view(row) {
  260. this.detail = row
  261. this.visible = true
  262. },
  263. }
  264. }
  265. </script>