outWork.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="userId"
  11. label="学员编号"
  12. ></el-table-column>
  13. <el-table-column
  14. align="center"
  15. prop="username"
  16. label="学员姓名"
  17. ></el-table-column>
  18. <el-table-column
  19. align="center"
  20. prop="subjectNames"
  21. label="专业"
  22. ></el-table-column>
  23. <el-table-column
  24. align="center"
  25. prop="studentId"
  26. label="是否布置作业"
  27. >
  28. <template slot-scope="scope">
  29. <div>
  30. {{scope.row.homeworkExist?'是':'否'}}
  31. </div>
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <pagination
  36. sync
  37. :total.sync="rules.total"
  38. :page.sync="rules.page"
  39. :limit.sync="rules.limit"
  40. :page-sizes="rules.page_size"
  41. @pagination="getList"
  42. />
  43. </div>
  44. </template>
  45. <script>
  46. import pagination from "@/components/Pagination/index";
  47. import { getTeacherServeExtraDetail } from "../api";
  48. export default {
  49. props:['detail'],
  50. components:{pagination},
  51. data() {
  52. return {
  53. tableList:[],
  54. rules: {
  55. // 分页规则
  56. limit: 10, // 限制显示条数
  57. page: 1, // 当前页
  58. total: 0, // 总条数
  59. page_size: [10, 20, 40, 50], // 选择限制显示条数
  60. },
  61. };
  62. },
  63. mounted() {
  64. // 获取分部
  65. this.init();
  66. },
  67. methods: {
  68. init() {
  69. this.getList()
  70. },
  71. async getList() {
  72. console.log(this.detail)
  73. try {
  74. const dayjs = this.$helpers.dayjs
  75. const ruselt = await getTeacherServeExtraDetail({
  76. page: this.rules.page,
  77. rows: this.rules.limit,
  78. monday: dayjs(this.detail.monday).format("YYYY-MM-DD"),
  79. sunday: dayjs(this.detail.sunday).format("YYYY-MM-DD"),
  80. teacherId:this.detail.teacherId
  81. });
  82. this.tableList = ruselt.data.rows
  83. this.rules.total = ruselt.data.total
  84. } catch (e) {
  85. console.log(e)
  86. }
  87. },
  88. search() {
  89. this.rules.page = 1;
  90. this.getList();
  91. },
  92. onReSet() {},
  93. },
  94. };
  95. </script>
  96. <style lang="scss" scoped>
  97. </style>