orderManagement.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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-form-item label="课程分类">
  13. <el-select v-model="courseType" placeholder="请选择" size="small" clearable @change="searchList">
  14. <!-- <el-option label="线上课" :value="0"></el-option> -->
  15. <!-- <el-option label="线下课" :value="1"></el-option> -->
  16. </el-select>
  17. </el-form-item>
  18. </el-form>
  19. </el-col>
  20. <!--表格-->
  21. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  22. <el-table-column prop="course" label="姓名" min-width="120" align="center"></el-table-column>
  23. <el-table-column prop="name" label="课程分类" min-width="120" align="center"></el-table-column>
  24. <el-table-column prop="course" label="课程名称" min-width="180" align="center"></el-table-column>
  25. <el-table-column prop="name" label="价格" min-width="120" align="center"></el-table-column>
  26. </el-table>
  27. <!--分页-->
  28. <el-col :span="24" class="toolbar">
  29. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  30. :page-sizes="[10, 20, 50, 100]" :page-size="size" layout="total, sizes, prev, pager, next" :total="total"
  31. style="float:right;"></el-pagination>
  32. </el-col>
  33. </section>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. // 搜索条件
  40. keyword: null,
  41. courseName: null,
  42. courseType: null,
  43. // 表格相关
  44. tableHeight: 0,
  45. listLoading: false,
  46. total: 0,
  47. page: 1,
  48. size: 20,
  49. list: []
  50. }
  51. },
  52. methods: {
  53. // 搜索考试信息
  54. searchList() {
  55. this.page = 1;
  56. this.getList();
  57. },
  58. // 获取考试信息列表
  59. getList() {
  60. // 待接口联调
  61. return
  62. this.listLoading = true;
  63. this.http.post('/exam-info/pageList', {
  64. name: this.keyword,
  65. courseName: this.courseName,
  66. page: this.page,
  67. size: this.size
  68. }, res => {
  69. this.list = res.data.records;
  70. this.total = res.data.total;
  71. this.listLoading = false;
  72. }, () => {
  73. this.listLoading = false;
  74. })
  75. },
  76. // 分页相关
  77. handleCurrentChange(val) {
  78. this.page = val;
  79. this.getList();
  80. },
  81. handleSizeChange(val) {
  82. this.page = 1;
  83. this.size = val;
  84. this.getList();
  85. }
  86. },
  87. created() {
  88. let height = window.innerHeight;
  89. this.tableHeight = height - 195;
  90. const that = this;
  91. window.onresize = function temp() {
  92. that.tableHeight = window.innerHeight - 195;
  93. };
  94. },
  95. mounted() {
  96. this.getList();
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .toolbar {
  102. padding-bottom: 10px;
  103. }
  104. </style>