afterWork.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div>
  3. <el-table
  4. style="width: 100%"
  5. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  6. :data="tableList"
  7. >
  8. <el-table-column
  9. align="center"
  10. prop="id"
  11. label="课程编号"
  12. ></el-table-column>
  13. <el-table-column
  14. align="center"
  15. prop="name"
  16. label="服务课程"
  17. ></el-table-column>
  18. <el-table-column
  19. align="center"
  20. prop="groupType"
  21. label="课程类型"
  22. >
  23. <template slot-scope="scope">
  24. <div>
  25. {{scope.row.groupType | coursesType}}
  26. </div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column
  30. align="center"
  31. prop="studentNum"
  32. label="学员数量"
  33. ></el-table-column>
  34. <el-table-column
  35. align="center"
  36. prop="subjectName"
  37. label="专业"
  38. ></el-table-column>
  39. <el-table-column
  40. align="center"
  41. prop="status"
  42. label="课程状态"
  43. >
  44. <template slot-scope="scope">
  45. <div>
  46. {{scope.row.status | coursesStatus}}
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column
  51. align="center"
  52. prop="homeworkExist"
  53. label="是否布置作业"
  54. >
  55. <template slot-scope="scope">
  56. <div>
  57. {{scope.row.homeworkExist?'是':'否'}}
  58. </div>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <pagination
  63. :total.sync="rules.total"
  64. :page.sync="rules.page"
  65. :limit.sync="rules.limit"
  66. :page-sizes="rules.page_size"
  67. @pagination="getList"
  68. />
  69. </div>
  70. </template>
  71. <script>
  72. import pagination from "@/components/Pagination/index";
  73. import { getTeacherServeHomeworkDetail } from "../api";
  74. export default {
  75. components: { pagination },
  76. props: ["detail"],
  77. data() {
  78. return {
  79. tableList: [],
  80. rules: {
  81. // 分页规则
  82. limit: 10, // 限制显示条数
  83. page: 1, // 当前页
  84. total: 0, // 总条数
  85. page_size: [10, 20, 40, 50], // 选择限制显示条数
  86. },
  87. };
  88. },
  89. mounted() {
  90. // 获取分部
  91. this.init();
  92. },
  93. methods: {
  94. init() {
  95. this.getList();
  96. },
  97. async getList() {
  98. try {
  99. const dayjs = this.$helpers.dayjs
  100. const ruselt = await getTeacherServeHomeworkDetail({
  101. page: this.rules.page,
  102. rows: this.rules.limit,
  103. monday: dayjs(this.detail.monday).format("YYYY-MM-DD"),
  104. sunday: dayjs(this.detail.sunday).format("YYYY-MM-DD"),
  105. teacherId:this.detail.teacherId
  106. });
  107. this.tableList = ruselt.data.rows
  108. this.rules.total = ruselt.data.total
  109. } catch (e) {
  110. console.log(e)
  111. }
  112. },
  113. search() {
  114. this.rules.page = 1;
  115. this.getList();
  116. },
  117. onReSet() {},
  118. },
  119. };
  120. </script>
  121. <style lang="scss" scoped>
  122. </style>