PrintTaskStudents.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <el-dialog
  3. class="print-task-students"
  4. :visible.sync="modalIsShow"
  5. title="考生明细"
  6. top="10vh"
  7. width="700px"
  8. :close-on-click-modal="false"
  9. :close-on-press-escape="false"
  10. append-to-body
  11. @open="visibleChange"
  12. >
  13. <el-table border ref="TableList" :data="dataList">
  14. <el-table-column
  15. type="index"
  16. label="序号"
  17. width="70"
  18. :index="indexMethod"
  19. ></el-table-column>
  20. <el-table-column prop="studentName" label="姓名"></el-table-column>
  21. <el-table-column prop="studentCode" label="学号"></el-table-column>
  22. <el-table-column prop="clazz" label="班级"></el-table-column>
  23. </el-table>
  24. <div class="part-page">
  25. <el-pagination
  26. v-if="dataList.length"
  27. background
  28. layout="total, sizes, prev, pager, next, jumper"
  29. :pager-count="5"
  30. :current-page="current"
  31. :total="total"
  32. :page-size="size"
  33. @current-change="toPage"
  34. @size-change="pageSizeChange"
  35. >
  36. </el-pagination>
  37. </div>
  38. <div slot="footer"></div>
  39. </el-dialog>
  40. </template>
  41. <script>
  42. import { listTaskPrintStudent } from "../api";
  43. export default {
  44. name: "print-task-students",
  45. props: {
  46. classId: {
  47. type: String,
  48. default: "",
  49. },
  50. },
  51. data() {
  52. return {
  53. modalIsShow: false,
  54. isSubmit: false,
  55. params: "",
  56. dataList: [],
  57. current: 1,
  58. size: this.GLOBAL.pageSize,
  59. total: 0,
  60. };
  61. },
  62. methods: {
  63. visibleChange() {
  64. this.toPage(1);
  65. },
  66. async getList() {
  67. const data = await listTaskPrintStudent({
  68. classId: this.classId,
  69. pageNumber: this.current,
  70. pageSize: this.size,
  71. });
  72. this.dataList = data.records;
  73. this.total = data.total;
  74. },
  75. toPage(page) {
  76. this.current = page;
  77. this.getList();
  78. },
  79. cancel() {
  80. this.modalIsShow = false;
  81. },
  82. open() {
  83. this.modalIsShow = true;
  84. },
  85. },
  86. };
  87. </script>