index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="approvalProcess">
  3. <u-navbar ref="uNavbar" :border-bottom="false" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle" :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
  4. <view class="content">
  5. <u-time-line>
  6. <u-time-line-item nodeTop="10">
  7. <!-- 此处自定义了左边内容,用一个图标替代 -->
  8. <template v-slot:node>
  9. <view class="u-node" style="background: #009FE8;"></view>
  10. </template>
  11. <template v-slot:content>
  12. <view>
  13. <view class="u-order-title">{{name}}</view>
  14. <view class="u-order-desc">发文审核申请</view>
  15. <view class="u-order-time">{{createTime}}</view>
  16. </view>
  17. </template>
  18. </u-time-line-item>
  19. <u-time-line-item nodeTop="10" v-for="(item, index) in data" :key="index">
  20. <!-- 此处自定义了左边内容,用一个图标替代 -->
  21. <template v-slot:node>
  22. <view class="u-node" style="background: #009FE8;"></view>
  23. </template>
  24. <template v-slot:content>
  25. <view>
  26. <view class="u-order-title">{{item.approvalName}}</view>
  27. <view class="u-order-desc">{{item.nodeName}} - {{item.approvalOperation}}</view>
  28. <view class="u-order-time">{{item.approveTime}}</view>
  29. </view>
  30. </template>
  31. </u-time-line-item>
  32. <u-time-line-item nodeTop="10">
  33. <!-- 此处自定义了左边内容,用一个图标替代 -->
  34. <template v-slot:node>
  35. <view class="u-node" style="background: #009FE8;"></view>
  36. </template>
  37. <template v-slot:content>
  38. <view>
  39. <view class="u-order-title">等待下一级人员审核中</view>
  40. </view>
  41. </template>
  42. </u-time-line-item>
  43. </u-time-line>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. setNav:{
  52. backgroundColor:'#fff', //背景色
  53. color:'#333', //字体颜色
  54. bold: true,
  55. size: '36',
  56. backColor: '#333',
  57. isdisPlayNavTitle: true, //是否显示返回按钮
  58. navTitle:'审核流程' //导航标题
  59. },
  60. id: '',
  61. data: [],
  62. name: '',
  63. createTime: ''
  64. }
  65. },
  66. onLoad(options) {
  67. this.id = options.id
  68. this.name = options.name
  69. this.getDetail()
  70. },
  71. methods: {
  72. async getDetail() {
  73. let res = await this.$u.post(`jflow/p/c/task/backlog/detail`, {
  74. businessCode: this.id
  75. })
  76. if (res.resultCode == 0) {
  77. let data = []
  78. res.data.guiValue.forEach(item => {
  79. if (item.nodeName == '开始') {
  80. this.createTime = item.createTime
  81. } else {
  82. item.approvalLists.forEach(({approvalName, approvalOperation, approveTime}) => {
  83. data.push({
  84. approvalName,
  85. approvalOperation,
  86. approveTime,
  87. nodeName: item.nodeName
  88. })
  89. })
  90. }
  91. })
  92. this.data = data
  93. }
  94. // if (res.data && res.data.rows) {
  95. // if (this.pageNo == 1) {
  96. // this.data = res.data.rows
  97. // this.total = res.data.total
  98. // } else {
  99. // this.data = this.data.concat(res.data.rows)
  100. // }
  101. // }
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .content{
  108. padding: 100rpx;
  109. }
  110. .u-node {
  111. width: 22rpx;
  112. height: 22rpx;
  113. border-radius: 100rpx;
  114. display: flex;
  115. justify-content: center;
  116. align-items: center;
  117. background: #d0d0d0;
  118. }
  119. .u-order-title {
  120. color: #343434;
  121. font-weight: bold;
  122. font-size: 28rpx;
  123. }
  124. .u-order-desc {
  125. color: rgb(150, 150, 150);
  126. }
  127. .u-order-time {
  128. color: rgb(200, 200, 200);
  129. font-size: 26rpx;
  130. margin-top: 20rpx;
  131. }
  132. </style>