综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

FlowRecord.vue 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="box">
  3. <scroll-view scroll-y="true" class="scroll-box">
  4. <uv-steps :current="activeStep" direction="column">
  5. <uv-steps-item v-for="item, index in flowRecordList" :key="'f' + index" :title="item.taskName">
  6. <template v-slot:desc>
  7. <view class="desc">
  8. <view class="desc-item">
  9. <view class="item-label">办理人:</view>
  10. <view class="item-value">{{ item.assigneeName }}</view>
  11. </view>
  12. <view class="desc-item" v-if="item.candidate">
  13. <view class="item-label">候选办理:</view>
  14. <view class="item-value">{{ item.candidate }}</view>
  15. </view>
  16. <view class="desc-item">
  17. <view class="item-label">接收时间:</view>
  18. <view class="item-value">{{ item.createTime }}</view>
  19. </view>
  20. <view class="desc-item">
  21. <view class="item-label">处理时间:</view>
  22. <view class="item-value">{{ item.finishTime }}</view>
  23. </view>
  24. <view class="desc-item">
  25. <view class="item-label">耗时:</view>
  26. <view class="item-value">{{ item.duration }}</view>
  27. </view>
  28. </view>
  29. </template>
  30. </uv-steps-item>
  31. </uv-steps>
  32. </scroll-view>
  33. </view>
  34. </template>
  35. <script>
  36. import { flowRecord } from "@/api/flowable/finished";
  37. export default {
  38. props: {
  39. rows: Object
  40. },
  41. watch: {
  42. rows(newval) {
  43. console.log(newval);
  44. this.getFlowRecordList();
  45. }
  46. },
  47. created() {
  48. this.getFlowRecordList();
  49. },
  50. data() {
  51. return {
  52. flowRecordList: [], // 流程流转数据
  53. flowList: [],
  54. activeStep: 0,
  55. }
  56. },
  57. methods: {
  58. setColor(val) {
  59. if (val) {
  60. return "#2bc418";
  61. } else {
  62. return "#b3bdbb";
  63. }
  64. },
  65. setIcon(val) {
  66. if (val) {
  67. return "el-icon-check";
  68. } else {
  69. return "el-icon-time";
  70. }
  71. },
  72. /** 获取流程变量内容 */
  73. processVariables() {
  74. if (this.rows.taskId) {
  75. }
  76. },
  77. /** 流程流转记录 */
  78. getFlowRecordList() {
  79. this.activeStep = 0;
  80. const params = { procInsId: this.rows.procInsId, deployId: this.rows.deployId }
  81. flowRecord(params).then(res => {
  82. this.flowRecordList = res.data.flowList.reverse();
  83. for (let i = 0; i < this.flowRecordList.length; i++) {
  84. if (!this.flowRecordList[i].finishTime) {
  85. this.activeStep = i
  86. }
  87. }
  88. if (this.activeStep == 0) {
  89. this.activeStep = this.flowRecordList.length
  90. }
  91. }).catch(res => {
  92. })
  93. },
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .box {
  99. padding: 20px;
  100. height: 100%;
  101. }
  102. .scroll-box {
  103. height: 100%;
  104. }
  105. .desc {
  106. padding: 8px;
  107. background: #fff;
  108. border-radius: 8px;
  109. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  110. width: 100%;
  111. .desc-item {
  112. display: flex;
  113. border-bottom: 1px solid #eee;
  114. height: 30px;
  115. align-items: center;
  116. .item-label {
  117. width: 80px;
  118. text-align: right;
  119. }
  120. .item-value {
  121. // flex: 1;
  122. }
  123. }
  124. }
  125. </style>