index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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-button @click="onExport" type="primary" v-permission="'export/arrearageStudents'">导出</el-button>
  78. </el-form-item>
  79. </save-form>
  80. <el-table
  81. :data="list"
  82. style="width: 100%"
  83. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  84. >
  85. <el-table-column
  86. prop="userId"
  87. label="学员编号"
  88. >
  89. <copy-text slot-scope="scope">{{scope.row.userId}}</copy-text>
  90. </el-table-column>
  91. <el-table-column
  92. prop="studentName"
  93. label="学员姓名"
  94. >
  95. <copy-text slot-scope="scope">{{scope.row.studentName}}</copy-text>
  96. </el-table-column>
  97. <el-table-column
  98. prop="organName"
  99. label="所属分部"
  100. >
  101. <copy-text slot-scope="scope">{{scope.row.organName}}</copy-text>
  102. </el-table-column>
  103. <el-table-column
  104. prop="cooperationName"
  105. label="合作单位"
  106. >
  107. <copy-text slot-scope="scope">{{scope.row.cooperationName}}</copy-text>
  108. </el-table-column>
  109. <el-table-column
  110. prop="musicGroupName"
  111. label="所在乐团"
  112. >
  113. <copy-text slot-scope="scope">{{scope.row.musicGroupName}}</copy-text>
  114. </el-table-column>
  115. <el-table-column
  116. prop="eduTeacherName"
  117. label="乐团主管"
  118. >
  119. <copy-text slot-scope="scope">{{scope.row.eduTeacherName}}</copy-text>
  120. </el-table-column>
  121. <el-table-column
  122. prop="subjectName"
  123. label="声部"
  124. >
  125. <copy-text slot-scope="scope">{{scope.row.subjectName}}</copy-text>
  126. </el-table-column>
  127. <el-table-column
  128. prop="gender"
  129. label="性别"
  130. >
  131. <span slot-scope="scope">{{scope.row.gender | sex}}</span>
  132. </el-table-column>
  133. <el-table-column
  134. prop="parentName"
  135. label="家长姓名"
  136. >
  137. <copy-text slot-scope="scope">{{scope.row.parentName}}</copy-text>
  138. </el-table-column>
  139. <el-table-column
  140. prop="phone"
  141. label="家长联系电话"
  142. >
  143. <copy-text slot-scope="scope">{{scope.row.phone}}</copy-text>
  144. </el-table-column>
  145. <el-table-column
  146. prop="noPaymentAmount"
  147. label="欠费金额"
  148. >
  149. <span style="color: red;" slot-scope="scope">{{scope.row.noPaymentAmount | moneyFormat}}</span>
  150. </el-table-column>
  151. <el-table-column
  152. prop="ctrls"
  153. label="操作"
  154. fixed="right"
  155. v-if="permission('musicGroupPaymentCalenderDetail/queryPage/list')"
  156. >
  157. <el-button slot-scope="scope" type="text" @click="view(scope.row)">查看</el-button>
  158. </el-table-column>
  159. </el-table>
  160. <pagination
  161. sync
  162. :total.sync="rules.total"
  163. :page.sync="rules.page"
  164. :limit.sync="rules.limit"
  165. :page-sizes="rules.page_size"
  166. @pagination="FetchList"
  167. />
  168. </div>
  169. <el-dialog width="1000px" title="缴费记录" :visible.sync="visible">
  170. <list-dialog
  171. v-if="visible && detail"
  172. @close="visible = false"
  173. :musicGroupId="detail.musicGroupId"
  174. :userId="detail.userId"
  175. />
  176. </el-dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import pagination from "@/components/Pagination/index";
  181. import list from './modals/list'
  182. import { permission } from '@/utils/directivePage'
  183. import { getCooperation } from '@/api/buildTeam'
  184. import { queryArrearageStudents, getNoPaymentStudentMusicGroups } from './api'
  185. import { Export } from '@/utils/downLoadFile'
  186. import qs from 'qs'
  187. const initSearch = {
  188. search: '',
  189. eduTeacherId: null,
  190. organIds: [],
  191. branchs: null,
  192. musicGroupId: null,
  193. cooperationOrganId: null,
  194. }
  195. export default {
  196. components: {
  197. pagination,
  198. 'list-dialog': list
  199. },
  200. data() {
  201. return {
  202. list: [],
  203. visible: false,
  204. detail: null,
  205. musicList: [],
  206. searchForm: {
  207. ...initSearch
  208. },
  209. cooperations: [],
  210. rules: {
  211. // 分页规则
  212. limit: 10, // 限制显示条数
  213. page: 1, // 当前页
  214. total: 0, // 总条数
  215. page_size: [10, 20, 40, 50], // 选择限制显示条数
  216. },
  217. }
  218. },
  219. mounted() {
  220. const { query } = this.$route
  221. if (query.organId) {
  222. this.searchForm.organIds = [Number(query.organId)]
  223. }
  224. if(query.result) {
  225. this.searchForm.eduTeacherId = Number(query.result)
  226. }
  227. getCooperation({ rows: 1000 }).then((res) => {
  228. this.cooperations = res.data.rows
  229. })
  230. this.$store.dispatch('setBranchs')
  231. this.$store.dispatch('setSchools')
  232. this.FetchList()
  233. this.FetchMusicList()
  234. },
  235. methods: {
  236. permission,
  237. async FetchList() {
  238. try {
  239. const { organIds, ...rest} = this.searchForm
  240. const res = await queryArrearageStudents({
  241. page: this.rules.page,
  242. rows: this.rules.limit,
  243. organIds: organIds.join(','),
  244. ...rest,
  245. })
  246. this.rules.total = res.data.total;
  247. this.list = res.data.rows
  248. } catch (error) {}
  249. },
  250. async FetchMusicList() {
  251. try {
  252. const res = await getNoPaymentStudentMusicGroups()
  253. this.musicList = res.data
  254. } catch (error) {}
  255. },
  256. submit() {
  257. this.rules.page = 1
  258. this.FetchList()
  259. },
  260. onReSet() {
  261. this.searchForm = {...initSearch}
  262. this.submit();
  263. },
  264. view(row) {
  265. this.detail = row
  266. this.visible = true
  267. },
  268. onExport() {
  269. const { organIds, ...rest} = this.searchForm
  270. Export(this, {
  271. url: '/api-web/export/arrearageStudents',
  272. fileName: '欠费学员.xlsx',
  273. method: 'post',
  274. params: qs.stringify({ organIds: organIds.join(','), ...rest })
  275. }, '您确定导出欠费学员列表?')
  276. }
  277. }
  278. }
  279. </script>