flowBase.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div class="approval-table">
  3. <table border="1" cellpadding="8" cellspacing="0">
  4. <thead>
  5. <tr>
  6. <th>节点名称</th>
  7. <th>审批人</th>
  8. <th>审批结果</th>
  9. <th>审批时间</th>
  10. <th v-if="procDefId && procDefId.includes('dgt-project')">打分表</th>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <tr v-for="(item, index) in approvalData" :key="index">
  15. <td>{{ item.taskName }}</td>
  16. <td>{{ item.createBy }}</td>
  17. <td>{{ item.comment }}</td>
  18. <td>{{ item.createDate }}</td>
  19. <td v-if="procDefId && procDefId.includes('dgt-project')">
  20. <el-button v-if="item.taskDefKey==='decision' " class="custom-blue-color" size="mini"
  21. type="text" icon="el-icon-search" @click="handleDetail(item.createBy,scoringList)">查看</el-button>
  22. </td>
  23. </tr>
  24. </tbody>
  25. </table>
  26. </div>
  27. </template>
  28. <script>
  29. import axios from 'axios';
  30. import {getFlowBaseInfo} from "../../api/project/flowBase";
  31. import {getScoringListById,
  32. listMeeting} from "@/api/invest/meeting";
  33. export default {
  34. props: {
  35. procInstId: {
  36. type: String,
  37. /*required: true*/
  38. },
  39. id: {
  40. type: String,
  41. /*required: true*/
  42. }
  43. },
  44. data() {
  45. return {
  46. approvalData: [],
  47. procDefId:null,
  48. // 所以人打分列表
  49. scoringList: []
  50. };
  51. },
  52. created() {
  53. // 组件创建时调用接口获取数据
  54. this.fetchApprovalData();
  55. this.getMettingId();
  56. },
  57. methods: {
  58. fetchApprovalData() {
  59. // 假设接口地址为 /api/approvalData,参数为 processId
  60. getFlowBaseInfo(this.procInstId)
  61. .then(response => {
  62. this.approvalData = response.rows;
  63. // 获取第一条数据的某个字段,先判断数组是否有数据
  64. if (response.rows && response.rows.length > 0) {
  65. this.procDefId = response.rows[0].procDefId;
  66. }
  67. console.log('接收到的 信息:', response.rows);
  68. })
  69. .catch(error => {
  70. console.error('获取审批数据失败:', error);
  71. });
  72. },
  73. getMettingId() {
  74. let queryParams = {
  75. pageNum: 1,
  76. pageSize: 10,
  77. meetingType: "LX",
  78. orderByColumn: "createTime",
  79. isAsc: "desc",
  80. projectPoolId: this.id,
  81. };
  82. listMeeting(queryParams).then((response) => {
  83. let meetingList = response.rows;
  84. if (meetingList.length > 0) {
  85. this.getScoringListById(meetingList[0].id)
  86. }
  87. });
  88. },
  89. getScoringListById(meetingId) {
  90. getScoringListById(meetingId).then((response) => {
  91. this.scoringList = response.rows;
  92. });
  93. },
  94. // 打分详情-弹窗
  95. handleDetail(createBy,scoringList) {
  96. // 遍历 scoringList,找到 createBy 与 item.createBy 匹配的数据
  97. const matchedData = scoringList.find(scoringItem => scoringItem.createBy === createBy);
  98. //console.log('筛选出的目标数据2:', createBy);
  99. this.$store.commit("SET_TPROJECTSCORING", matchedData);
  100. this.$router.push({
  101. path: "/invest/meeting/mark",
  102. query: { id: matchedData.meetingId, formType: 1, readonly: true },
  103. });
  104. },
  105. },
  106. };
  107. </script>
  108. <style scoped>
  109. .approval-table {
  110. margin-top: 20px;
  111. width: 100%;
  112. border-collapse: collapse;
  113. margin-bottom: 20px;
  114. }
  115. .approval-table th,
  116. .approval-table td {
  117. border: 1px solid #ccc;
  118. padding: 8px 10px;
  119. }
  120. table {
  121. width: 100%;
  122. border-collapse: collapse;
  123. }
  124. th, td {
  125. text-align: center;
  126. /* 复用 Element UI 的文本颜色 */
  127. color: var(--el-text-color-regular, #606266);
  128. /* 复用 Element UI 的边框颜色 */
  129. border-color: var(--el-border-color, #dcdfe6);
  130. /* 其他继承样式(如字体大小、粗细)可按需加 */
  131. font-weight: var(--el-font-weight-regular, 400);
  132. }
  133. </style>