ApproveList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view>
  3. <!-- 流程 -->
  4. <view class="process">
  5. <view class="title">
  6. 流程
  7. </view>
  8. <u-time-line>
  9. <u-time-line-item node-top="10" v-for="(item,i) in approveList" :key="i">
  10. <template v-slot:node>
  11. <view>
  12. <view class="u-node" style="background:#CDCDCD;">
  13. <!-- 此处为uView的icon组件 -->
  14. <!-- <u-icon name="checkmark" color="#fff" :size="24"></u-icon> -->
  15. </view>
  16. </view>
  17. </template>
  18. <template v-slot:content>
  19. <view class="u-order">
  20. <view class="u-order-desc">
  21. <view class="level">
  22. <template v-for="(item2,index) in item.approveUserList">
  23. {{index!=0?',':''}}{{item2.name}}
  24. </template>
  25. </view>
  26. <view class="date">
  27. {{item.approveTime?item.approveTime:''}}
  28. </view>
  29. </view>
  30. <view class="u-order-time">
  31. <view class="photo">
  32. <template v-for="(item2,index) in item.approveUserList">
  33. <u-avatar size="56" class="img" :src="item2.headImg" :key="index"></u-avatar>
  34. </template>
  35. </view>
  36. <view class="confirm">
  37. <u-icon v-if="item.status==-1" name="more-circle-fill"
  38. :color="recordStatusColor(-1)"></u-icon>
  39. <u-icon v-if="item.status==0" name="more-circle-fill"
  40. :color="recordStatusColor(0)"></u-icon>
  41. <u-icon v-if="item.status==1" name="checkmark-circle-fill"
  42. :color="recordStatusColor(1)"></u-icon>
  43. <u-icon v-if="item.status==2" name="close-circle-fill"
  44. :color="recordStatusColor(2)"></u-icon>
  45. </view>
  46. <view class="name">
  47. <view v-if="item.status==-1">未开始</view>
  48. <view v-if="item.status==0">未审批</view>
  49. <view v-if="item.status==1">审批通过</view>
  50. <view v-if="item.status==2">审批驳回</view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. </u-time-line-item>
  56. <u-time-line-item>
  57. <template v-slot:content>
  58. <view class="u-order">
  59. <view class="u-order-desc">
  60. <view class="level">
  61. 仓库管理
  62. </view>
  63. <view class="state"
  64. v-if="outRecordDetailObj&&outRecordDetailObj.outRecord&&outRecordDetailObj.outRecord.status==1">
  65. <view v-if="operator.status==0">等待出库</view>
  66. <view v-if="operator.status==1">出库成功</view>
  67. </view>
  68. </view>
  69. <view class="u-order-time">
  70. <view class="photo">
  71. <u-avatar size="56" class="img" :src="operator.userImg"></u-avatar>
  72. </view>
  73. <view class="confirm">
  74. <u-icon v-if="operator.status==0" name="more-circle-fill"
  75. :color="recordStatusColor(0)"></u-icon>
  76. <u-icon v-if="operator.status==1" name="checkmark-circle-fill"
  77. :color="recordStatusColor(1)"></u-icon>
  78. </view>
  79. <view class="name"
  80. v-if="outRecordDetailObj&&outRecordDetailObj.outRecord&&outRecordDetailObj.outRecord.status!=0">
  81. <view v-if="operator.status==0">等待出库</view>
  82. <view v-if="operator.status==1">出库成功</view>
  83. </view>
  84. <view class="name" v-else>
  85. <view>等待审批</view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. </u-time-line-item>
  91. </u-time-line>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import {
  97. recordStatusColor
  98. } from '@/apis/status.js'
  99. export default {
  100. name: "ApproveList",
  101. props: {
  102. approveList: {
  103. default: []
  104. },
  105. outRecordDetailObj: {}
  106. },
  107. data() {
  108. return {
  109. };
  110. },
  111. computed: {
  112. operator() {
  113. var obj = {
  114. userImg: "",
  115. status: "",
  116. name: "",
  117. }
  118. var outRecordDetailObj = this.outRecordDetailObj;
  119. if (outRecordDetailObj && outRecordDetailObj.outRecord && outRecordDetailObj.outRecord.status != 0) {
  120. if (outRecordDetailObj.outRecord.status == 3) {
  121. obj.status = 1;
  122. }
  123. }
  124. return obj
  125. }
  126. },
  127. methods: {
  128. recordStatusColor
  129. }
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. // 流程
  134. .process {
  135. background-color: #fff;
  136. margin-top: 24rpx;
  137. padding: 24rpx 32rpx;
  138. padding-bottom: 80px;
  139. .title {
  140. color: rgba(51, 51, 51, 1);
  141. font-size: 32rpx;
  142. }
  143. .u-time-axis-item {
  144. //margin-bottom: 76rpx;
  145. }
  146. .u-time-axis {
  147. //padding: 18rpx 40rpx;
  148. }
  149. .u-node {
  150. width: 18rpx;
  151. height: 18rpx;
  152. border-radius: 100rpx !important;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. background: #d0d0d0;
  157. }
  158. .u-order {
  159. margin-bottom: 32rpx;
  160. }
  161. .u-order-title {
  162. color: #333333;
  163. font-weight: bold;
  164. font-size: 32rpx;
  165. }
  166. .u-order-desc {
  167. margin-bottom: 16rpx;
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. .level {
  172. color: #333333;
  173. font-size: 32rpx;
  174. font-weight: bold;
  175. }
  176. .date {
  177. color: rgba(119, 119, 119, 1);
  178. }
  179. .state {
  180. color: rgba(255, 121, 0, 1);
  181. }
  182. }
  183. .u-order-time {
  184. width: 160rpx;
  185. color: #777777;
  186. font-size: 28rpx;
  187. margin-top: 16rpx;
  188. display: flex;
  189. flex-direction: column;
  190. align-items: center;
  191. .photo {
  192. display: flex;
  193. width: 56rpx;
  194. height: 56rpx;
  195. border-radius: 100px;
  196. margin-bottom: 4rpx;
  197. .img {
  198. width: 100%;
  199. min-width: 30px;
  200. height: 100%;
  201. overflow: hidden;
  202. position: relative;
  203. }
  204. }
  205. .confirm {
  206. position: absolute;
  207. top: 46rpx;
  208. left: 56rpx;
  209. }
  210. .name {
  211. color: rgba(51, 51, 51, 1);
  212. font-size: 24rpx;
  213. }
  214. }
  215. }
  216. </style>