ScanTaskDetailDialog.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <el-dialog
  3. class="scan-task-detail-dialog page-dialog"
  4. :visible.sync="modalIsShow"
  5. :close-on-click-modal="false"
  6. :close-on-press-escape="false"
  7. append-to-body
  8. fullscreen
  9. @open="visibleChange"
  10. >
  11. <template slot="title">
  12. <h3>
  13. 详情
  14. <span class="color-gray ml-2"
  15. >{{ task.courseName }}({{ task.courseCode }})</span
  16. >
  17. </h3>
  18. </template>
  19. <div class="part-box part-box-pad">
  20. <el-table ref="TableList" :data="dataList">
  21. <el-table-column
  22. type="index"
  23. label="序号"
  24. width="70"
  25. :index="indexMethod"
  26. ></el-table-column>
  27. <el-table-column prop="studentName" label="姓名"></el-table-column>
  28. <el-table-column prop="studentCode" label="学号"></el-table-column>
  29. <el-table-column prop="courseCodeName" label="课程名称(代码)">
  30. <template slot-scope="scope">
  31. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="teacher" label="任课老师"></el-table-column>
  35. <el-table-column prop="teachClass" label="教学班"></el-table-column>
  36. <el-table-column
  37. prop="bindCount"
  38. label="绑定张数"
  39. width="120"
  40. ></el-table-column>
  41. </el-table>
  42. <div class="part-page">
  43. <el-pagination
  44. background
  45. layout="total,prev, pager, next"
  46. :current-page="current"
  47. :total="total"
  48. :page-size="size"
  49. @current-change="toPage"
  50. >
  51. </el-pagination>
  52. </div>
  53. </div>
  54. </el-dialog>
  55. </template>
  56. <script>
  57. import { scanTaskDetailPage } from "../api";
  58. export default {
  59. name: "scan-task-detail-dialog",
  60. props: {
  61. task: {
  62. type: Object,
  63. default() {
  64. return {};
  65. },
  66. },
  67. },
  68. data() {
  69. return {
  70. modalIsShow: false,
  71. dataList: [],
  72. current: 1,
  73. size: this.GLOBAL.pageSize,
  74. total: 0,
  75. };
  76. },
  77. computed: {
  78. title() {
  79. return `${this.task.scanTaskName}-${this.task.courseName}-详情`;
  80. },
  81. },
  82. methods: {
  83. visibleChange() {
  84. this.dataList = [];
  85. this.toPage(1);
  86. },
  87. cancel() {
  88. this.modalIsShow = false;
  89. },
  90. open() {
  91. this.modalIsShow = true;
  92. },
  93. async getList() {
  94. const datas = {
  95. paperScanTaskId: this.task.paperScanTaskId,
  96. pageNumber: this.current,
  97. pageSize: this.size,
  98. };
  99. const data = await scanTaskDetailPage(datas);
  100. this.dataList = data.records;
  101. this.total = data.total;
  102. },
  103. toPage(page) {
  104. this.current = page;
  105. this.getList();
  106. },
  107. },
  108. };
  109. </script>