studentPayment.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <section>
  3. <!--搜索栏-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true" @submit.native.prevent>
  6. <el-form-item label="姓名">
  7. <el-input v-model="keyword" placeholder="请输入" clearable @change="searchList" size="small"></el-input>
  8. </el-form-item>
  9. <el-form-item label="课程名称">
  10. <el-input v-model="courseName" placeholder="请输入" clearable @change="searchList" size="small"></el-input>
  11. </el-form-item>
  12. <el-button type="primary" size="small" style="float: right;" @click="exportExcel()"
  13. :loading="exportExcelLoading">导出</el-button>
  14. </el-form>
  15. </el-col>
  16. <!--表格-->
  17. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  18. <el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
  19. <el-table-column prop="name" label="学员姓名" min-width="120" align="center"></el-table-column>
  20. <el-table-column prop="idNumber" label="证件号码" min-width="180" align="center"></el-table-column>
  21. <el-table-column prop="teachVeriPrice" label="培训费/认证费" min-width="150" align="center"></el-table-column>
  22. <el-table-column prop="materialPrice" label="资料费" min-width="120" align="center"></el-table-column>
  23. <el-table-column prop="other1Price" label="其他费用1" min-width="120" align="center"></el-table-column>
  24. <el-table-column prop="other2Price" label="其他费用2" min-width="120" align="center"></el-table-column>
  25. <el-table-column prop="payDate" label="打款日期" min-width="150" align="center"></el-table-column>
  26. <el-table-column prop="name" label="汇款方名称" min-width="180" align="center"></el-table-column>
  27. <el-table-column prop="receiveMoneyCompany" label="收款单位" min-width="150" align="center"></el-table-column>
  28. <el-table-column prop="payWay" label="打款方式" min-width="150" align="center"></el-table-column>
  29. <el-table-column prop="invoiceDate" label="开票日期" min-width="150" align="center"></el-table-column>
  30. </el-table>
  31. <!--分页-->
  32. <el-col :span="24" class="toolbar">
  33. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  34. :page-sizes="[10, 20, 50, 100]" :page-size="size" layout="total, sizes, prev, pager, next" :total="total"
  35. style="float:right;"></el-pagination>
  36. </el-col>
  37. </section>
  38. </template>
  39. <script>
  40. import { fixedDataGender, fixedDataCertificateType, fixedDataOrNot, fixedDataInvoiceSubject, fixedDatainvoiceType } from '../../common/js/fixedData'
  41. export default {
  42. data() {
  43. return {
  44. // 搜索条件
  45. keyword: null,
  46. courseName: null,
  47. // 表格相关
  48. tableHeight: 0,
  49. listLoading: false,
  50. total: 0,
  51. page: 1,
  52. size: 20,
  53. list: [],
  54. exportExcelLoading: false
  55. }
  56. },
  57. methods: {
  58. exportExcel() {
  59. this.exportExcelLoading = true;
  60. this.http.post('/user-exam-info/exportStudentPayList', {
  61. name: this.keyword,
  62. courseName: this.courseName
  63. }, res => {
  64. if (res.code == "ok") {
  65. var filePath = res.data;
  66. const a = document.createElement('a'); // 创建a标签
  67. a.setAttribute('download', '学员缴费情况.xlsx');// download属性
  68. a.setAttribute('href', filePath);// href链接
  69. a.click(); //自执行点击事件
  70. a.remove();
  71. } else {
  72. this.$message({
  73. message: res.msg,
  74. type: "error"
  75. });
  76. }
  77. }, () => {
  78. this.exportExcelLoading = false;
  79. })
  80. },
  81. searchList() {
  82. this.page = 1;
  83. this.getList();
  84. },
  85. getList() {
  86. this.listLoading = true;
  87. this.http.post('/user-exam-info/getStudentPayList', {
  88. name: this.keyword,
  89. courseName: this.courseName,
  90. pageIndex: this.page,
  91. pageSize: this.size
  92. }, res => {
  93. this.list = (res.data.records || []).map(item => {
  94. const { sex, idType, invoiceType, isIndivdual } = item
  95. return {
  96. ...item
  97. }
  98. });
  99. this.total = res.data.total;
  100. this.listLoading = false;
  101. }, () => {
  102. this.listLoading = false;
  103. })
  104. },
  105. // 分页相关
  106. handleCurrentChange(val) {
  107. this.page = val;
  108. this.getList();
  109. },
  110. handleSizeChange(val) {
  111. this.page = 1;
  112. this.size = val;
  113. this.getList();
  114. }
  115. },
  116. created() {
  117. let height = window.innerHeight;
  118. this.tableHeight = height - 195;
  119. const that = this;
  120. window.onresize = function temp() {
  121. that.tableHeight = window.innerHeight - 195;
  122. };
  123. },
  124. mounted() {
  125. this.getList();
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .toolbar {
  131. padding-bottom: 10px;
  132. }
  133. </style>