综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

participate.vue 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!--
  2. * @Author: wrh
  3. * @Date: 2024-03-25 17:38:39
  4. * @LastEditors: wrh
  5. * @LastEditTime: 2026-02-27 11:08:31
  6. -->
  7. <template>
  8. <div>
  9. <el-collapse v-model="activeNames" @change="handleChange" accordion>
  10. <el-collapse-item :name="item.projectId" v-for="item in tableData" :key="item.projectNumber">
  11. <template slot="title">
  12. <div :class="{ active: activeNames == item.projectId }">
  13. <svg-icon :icon-class="activeNames == item.projectId ? 'ArrowDown' : 'ArrowRight'"
  14. class="info-icon"></svg-icon>
  15. {{ item.projectNumber + ' ' + ' ' + item.projectName + ' ' + ' ' + getUserName(item.projectLeader) }}
  16. </div>
  17. </template>
  18. <div class="tables">
  19. <el-table :data="workData" style="width: 100%" align="center" v-loading="tableLoading" height="300px">
  20. <el-table-column type="index" label="序号" />
  21. <el-table-column prop="workType" label="工作类型" />
  22. <el-table-column prop="workItem" label="工作项目" />
  23. <el-table-column prop="workContent" label="工作内容" />
  24. <el-table-column prop="workLoad" label="工作量" />
  25. </el-table>
  26. <div class="mt10" style="text-align:right;">
  27. <el-pagination small layout="total,prev, pager, next" :total="workTotal" :current-page="pageNum"
  28. @current-change="changePageNum"></el-pagination>
  29. </div>
  30. </div>
  31. </el-collapse-item>
  32. </el-collapse>
  33. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  34. :autoScroll="false" @pagination="getListByPaticipates" />
  35. </div>
  36. </template>
  37. <script>
  38. import { listProject } from "@/api/oa/project/project";
  39. import { listDeclare } from "@/api/oa/declare/declare"
  40. export default {
  41. props: {
  42. userId: {
  43. type: Number
  44. }
  45. },
  46. data() {
  47. return {
  48. // 查询参数
  49. queryParams: {
  50. pageNum: 1,
  51. pageSize: 10,
  52. participates: null
  53. },
  54. // 总条数
  55. total: 0,
  56. tableData: [],
  57. activeNames: '',
  58. workData: [],
  59. workTotal: 0,
  60. tableLoading: false,
  61. pageNum: 1,
  62. }
  63. },
  64. created() {
  65. this.getListByPaticipates();
  66. },
  67. methods: {
  68. handleChange(val) {
  69. if (val) {
  70. this.getDeclareList();
  71. }
  72. },
  73. getDeclareList() {
  74. this.tableLoading = true
  75. listDeclare({ pageNum: this.pageNum, projectId: this.activeNames, userId: this.$route.query.userId }).then(res => {
  76. this.workData = res.rows;
  77. this.workTotal = res.total;
  78. this.tableLoading = false
  79. })
  80. },
  81. changePageNum(val) {
  82. this.pageNum = val;
  83. this.getDeclareList();
  84. },
  85. getListByPaticipates() {
  86. if (this.$route.query.userId)
  87. this.queryParams.participates = this.$route.query.userId;
  88. else
  89. this.queryParams.participates = this.userId;
  90. listProject(this.queryParams).then(res => {
  91. this.tableData = res.rows
  92. this.total = res.total
  93. });
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .info-icon {
  100. font-size: 20px;
  101. }
  102. .active {
  103. color: var(--current-color);
  104. }
  105. .tables {
  106. border: 1px solid #e2e1e1;
  107. padding: 10px;
  108. }
  109. </style>