AuditPaperUnsubmit.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="audit-paper-unsubmit">
  3. <el-form class="part-filter-form" :model="filter" inline>
  4. <el-form-item label="提交人">
  5. <el-input
  6. v-model="filter.creator"
  7. placeholder="请输入提交人姓名"
  8. ></el-input>
  9. </el-form-item>
  10. <el-form-item label="试卷名称">
  11. <el-input
  12. v-model="filter.paperName"
  13. placeholder="请输入试卷名称"
  14. ></el-input>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button type="danger" @click="toPage(1)">查询</el-button>
  18. </el-form-item>
  19. </el-form>
  20. <div>
  21. <el-table
  22. v-loading="loading"
  23. element-loading-text="拼命加载中"
  24. :data="dataList"
  25. >
  26. <el-table-column label="试卷名称" prop="paperName"> </el-table-column>
  27. <el-table-column label="课程" prop="courseName"> </el-table-column>
  28. <el-table-column label="提交时间" prop="creationTime" width="153">
  29. </el-table-column>
  30. <el-table-column label="操作" width="170" fixed="right">
  31. <template slot-scope="scope">
  32. <div class="operate_left">
  33. <el-button
  34. size="mini"
  35. type="primary"
  36. plain
  37. @click="toEdit(scope.row)"
  38. >编辑</el-button
  39. >
  40. <el-button
  41. size="mini"
  42. type="primary"
  43. plain
  44. @click="toSubmit(scope.row)"
  45. >提交</el-button
  46. >
  47. </div>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. <div class="part-page">
  52. <el-pagination
  53. :current-page="currentPage"
  54. :page-size="pageSize"
  55. :page-sizes="[10, 20, 50, 100, 200, 300]"
  56. layout="total, sizes, prev, pager, next, jumper"
  57. :total="total"
  58. @current-change="toPage"
  59. @size-change="handleSizeChange"
  60. >
  61. </el-pagination>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import { auditPaperUnsubmitPageListApi, submitPaperApi } from "../api";
  68. export default {
  69. name: "AuditPaperUnsubmit",
  70. data() {
  71. return {
  72. filter: { creator: "", paperName: "" },
  73. dataList: [],
  74. currentPage: 1,
  75. pageSize: 10,
  76. total: 0,
  77. loading: false,
  78. };
  79. },
  80. mounted() {
  81. this.toPage(1);
  82. },
  83. methods: {
  84. toPage(page) {
  85. this.currentPage = page;
  86. this.getList();
  87. },
  88. async getList() {
  89. this.loading = true;
  90. const res = await auditPaperUnsubmitPageListApi({
  91. ...this.filter,
  92. curPage: this.currentPage,
  93. pageSize: this.pageSize,
  94. }).catch(() => {});
  95. this.loading = false;
  96. if (!res) return;
  97. this.dataList = res.data.content;
  98. this.total = res.data.totalElements;
  99. },
  100. handleSizeChange(val) {
  101. this.pageSize = val;
  102. this.toPage(1);
  103. },
  104. toEdit(row) {
  105. window.open(
  106. this.getRouterPath({
  107. name: "EditPaper",
  108. params: {
  109. id: row.id,
  110. parentView: "audit-paper",
  111. },
  112. })
  113. );
  114. },
  115. async toSubmit(row) {
  116. const confirm = await this.$confirm(`确定要提交该试卷吗?`, "提示", {
  117. type: "warning",
  118. }).catch(() => {});
  119. if (confirm !== "confirm") return;
  120. await submitPaperApi([row.id]);
  121. this.$message.success("操作成功!");
  122. },
  123. },
  124. };
  125. </script>