WaitTask.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div class="wait-task">
  3. <div class="part-box part-box-pad">
  4. <el-table ref="TableList" :data="dataList">
  5. <el-table-column
  6. type="index"
  7. label="序号"
  8. width="50"
  9. :index="indexMethod"
  10. ></el-table-column>
  11. <el-table-column prop="paperNumber" label="试卷编号"></el-table-column>
  12. <el-table-column prop="type" label="课程(代码)">
  13. <template slot-scope="scope">
  14. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="cardRuleName" label="题卡规则"></el-table-column>
  18. <el-table-column prop="taskName" label="流程节点"> </el-table-column>
  19. <el-table-column prop="createTime" label="创建时间" width="180">
  20. <span slot-scope="scope">{{
  21. scope.row.createTime | timestampFilter
  22. }}</span>
  23. </el-table-column>
  24. <el-table-column class-name="action-column" label="操作" width="100px">
  25. <template slot-scope="scope">
  26. <el-button class="btn-primary" type="text" @click="toDo(scope.row)"
  27. >立即处理</el-button
  28. >
  29. </template>
  30. </el-table-column>
  31. </el-table>
  32. <div class="part-page">
  33. <el-pagination
  34. background
  35. layout="total,prev, pager, next"
  36. :current-page="current"
  37. :total="total"
  38. :page-size="size"
  39. @current-change="toPage"
  40. >
  41. </el-pagination>
  42. </div>
  43. </div>
  44. <!-- ModifyTaskApply -->
  45. <modify-task-apply
  46. ref="ModifyTaskApply"
  47. :instance="curTask"
  48. @modified="taskModified"
  49. ></modify-task-apply>
  50. </div>
  51. </template>
  52. <script>
  53. import { mapActions } from "vuex";
  54. import { waitExamTaskListPage } from "../api";
  55. import ModifyTaskApply from "../components/ModifyTaskApply";
  56. export default {
  57. name: "wait-task",
  58. components: { ModifyTaskApply },
  59. data() {
  60. return {
  61. current: 1,
  62. size: this.GLOBAL.pageSize,
  63. total: 0,
  64. dataList: [],
  65. curTask: {}
  66. };
  67. },
  68. mounted() {
  69. this.toPage(1);
  70. },
  71. methods: {
  72. ...mapActions("exam", ["updateWaitTaskCount"]),
  73. async getList() {
  74. const datas = {
  75. pageNumber: this.current,
  76. pageSize: this.size
  77. };
  78. const data = await waitExamTaskListPage(datas);
  79. this.dataList = data.records;
  80. this.total = data.total;
  81. },
  82. toPage(page) {
  83. this.current = page;
  84. this.getList();
  85. },
  86. toDo(task) {
  87. this.curTask = { ...task, source: "REVIEW" };
  88. this.$refs.ModifyTaskApply.open();
  89. },
  90. taskModified() {
  91. this.getList();
  92. this.updateWaitTaskCount();
  93. }
  94. },
  95. beforeRouteLeave(to, from, next) {
  96. if (to.name === "CardDesign") {
  97. this.$ls.set("cachePageInfo", {
  98. page: this.current,
  99. curRowId: this.curTask.id
  100. });
  101. } else {
  102. this.$ls.remove("cachePageInfo");
  103. }
  104. next();
  105. }
  106. };
  107. </script>