detailFlowChart.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <!--详情流程图-->
  3. <view class="detail-flow-chart">
  4. <view class="flow-title">流程图</view>
  5. <u-steps direction="column" :current="current">
  6. <u-steps-item :key="i" v-for="(item, i) in proNodes">
  7. <view class="item-icon" slot="icon">
  8. <text class="item-title">{{ item.nodeType }}</text>
  9. <!--已激活状态 -->
  10. <u-icon
  11. v-if="i < current"
  12. class="status-icon"
  13. name="checkmark-circle-fill"
  14. color="#08BC62"
  15. size="17"
  16. ></u-icon>
  17. <!--当前处于这一步-->
  18. <u-icon
  19. v-else-if="i === current"
  20. class="status-icon"
  21. name="more-circle-fill"
  22. color="#F08B14"
  23. size="17"
  24. ></u-icon>
  25. <!--待审批-->
  26. <u-icon
  27. v-if="i > current"
  28. class="status-icon"
  29. name="checkmark-circle-fill"
  30. color="#CAD0DB"
  31. size="17"
  32. ></u-icon>
  33. </view>
  34. <view class="steps-content" slot="desc">
  35. <view
  36. :key="i"
  37. v-for="(info, i) in item.list"
  38. class="info-row"
  39. >
  40. <detailAvatar :info="info"></detailAvatar>
  41. <view class="u-info">
  42. <text
  43. class="u-name"
  44. :class="{ 'mb-8': info.approvalTime }"
  45. >
  46. {{ info.userName }}
  47. </text>
  48. <text class="c-time">{{ info.approvalTime }}</text>
  49. </view>
  50. </view>
  51. </view>
  52. </u-steps-item>
  53. </u-steps>
  54. </view>
  55. </template>
  56. <script>
  57. import detailAvatar from './detailAvatar.vue';
  58. export default {
  59. name: 'detailFlowChart',
  60. props: {
  61. proNodes: {
  62. default: () => [],
  63. type: Array,
  64. },
  65. },
  66. data() {
  67. return {};
  68. },
  69. computed: {
  70. current() {
  71. return this.proNodes.findIndex((item) => item.current);
  72. },
  73. },
  74. components: {
  75. detailAvatar,
  76. },
  77. };
  78. </script>
  79. <style scoped lang="scss">
  80. .detail-flow-chart {
  81. background-color: #fff;
  82. border-radius: 6px;
  83. margin: 20rpx 0;
  84. padding: 20rpx;
  85. .flow-title {
  86. margin-bottom: 30rpx;
  87. position: relative;
  88. font-size: 15px;
  89. color: #333333;
  90. &:before {
  91. content: '';
  92. position: absolute;
  93. bottom: -6px;
  94. left: 0;
  95. width: 14px;
  96. height: 3px;
  97. background-color: #436ff6;
  98. border-radius: 6px;
  99. }
  100. }
  101. .u-steps {
  102. padding-left: 45px;
  103. .steps-content {
  104. .info-row {
  105. position: relative;
  106. display: flex;
  107. align-items: center;
  108. margin-bottom: 20rpx;
  109. background-color: #f5f6f8;
  110. padding: 16rpx 30rpx;
  111. border-radius: 4px;
  112. .status-box {
  113. position: absolute;
  114. top: 0;
  115. right: 0;
  116. border-radius: 0px 5px 0px 10px;
  117. color: #fff;
  118. font-size: 12px;
  119. padding: 3px 6px;
  120. }
  121. .pend-approval {
  122. background-color: #848796;
  123. }
  124. .rejected {
  125. background-color: #ff5e59;
  126. }
  127. .agree {
  128. background-color: #08bc62;
  129. }
  130. &:last-child {
  131. margin-bottom: 0;
  132. }
  133. .u-info {
  134. display: flex;
  135. flex-direction: column;
  136. margin-left: 20rpx;
  137. .u-name {
  138. font-size: 14px;
  139. color: #333333;
  140. }
  141. .mb-8 {
  142. margin-bottom: 8px;
  143. }
  144. .c-time {
  145. font-size: 12px;
  146. color: #7b7e8c;
  147. }
  148. }
  149. }
  150. }
  151. .item-icon {
  152. position: relative;
  153. display: flex;
  154. align-items: center;
  155. .item-title {
  156. position: absolute;
  157. left: -45px;
  158. font-size: 14px;
  159. color: #595c62;
  160. }
  161. .status-icon {
  162. margin-top: 2px;
  163. }
  164. }
  165. }
  166. }
  167. </style>