flowBase.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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') || procDefId.includes('dgt-decision'))">打分表</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') || procDefId.includes('dgt-decision'))">
  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. this.getMettingId()
  67. }
  68. //console.log('接收到的 信息:', response.rows);
  69. })
  70. .catch(error => {
  71. console.error('获取审批数据失败:', error);
  72. });
  73. },
  74. getMettingId() {
  75. let queryParams = {
  76. pageNum: 1,
  77. pageSize: 10,
  78. meetingType: "",
  79. orderByColumn: "createTime",
  80. isAsc: "desc",
  81. projectPoolId: this.id,
  82. };
  83. //console.log(this.procDefId);
  84. if(this.procDefId.includes('dgt-project')){
  85. queryParams.meetingType="LX";
  86. }else if(this.procDefId.includes('dgt-decision')){
  87. queryParams.meetingType="TJ";
  88. }
  89. listMeeting(queryParams).then((response) => {
  90. let meetingList = response.rows;
  91. if (meetingList.length > 0) {
  92. this.getScoringListById(meetingList[0].id)
  93. }
  94. });
  95. },
  96. getScoringListById(meetingId) {
  97. getScoringListById(meetingId).then((response) => {
  98. this.scoringList = response.rows;
  99. });
  100. },
  101. // 打分详情-弹窗
  102. handleDetail(createBy,scoringList) {
  103. // 遍历 scoringList,找到 createBy 与 item.createBy 匹配的数据
  104. const matchedData = scoringList.find(scoringItem => scoringItem.createBy === createBy);
  105. //console.log('筛选出的目标数据2:', createBy);
  106. this.$store.commit("SET_TPROJECTSCORING", matchedData);
  107. this.$router.push({
  108. path: "/invest/meeting/mark",
  109. query: { id: matchedData.meetingId, formType: 1, readonly: true },
  110. });
  111. },
  112. },
  113. };
  114. </script>
  115. <style scoped>
  116. .approval-table {
  117. margin-top: 20px;
  118. width: 100%;
  119. border-collapse: collapse;
  120. margin-bottom: 20px;
  121. }
  122. .approval-table th,
  123. .approval-table td {
  124. border: 1px solid #ccc;
  125. padding: 8px 10px;
  126. }
  127. table {
  128. width: 100%;
  129. border-collapse: collapse;
  130. }
  131. th, td {
  132. text-align: center;
  133. /* 复用 Element UI 的文本颜色 */
  134. color: var(--el-text-color-regular, #606266);
  135. /* 复用 Element UI 的边框颜色 */
  136. border-color: var(--el-border-color, #dcdfe6);
  137. /* 其他继承样式(如字体大小、粗细)可按需加 */
  138. font-weight: var(--el-font-weight-regular, 400);
  139. }
  140. </style>