todo.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="blacklog-container">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="我的待办" @clickLeft="back"
  4. background-color="#157A2C" color="#fff"></uni-nav-bar>
  5. <view class="list-container">
  6. <u-list @scrolltolower="scrolltolower">
  7. <u-list-item v-for="(item, index) in list" :key="index">
  8. <view class="kd-card">
  9. <view class="card-title">
  10. <text>{{ item.processInstance.name }}</text>
  11. <text class="card-time">{{ item.createTime }}</text>
  12. </view>
  13. <view>
  14. <view class="card-body">
  15. <view class="card-col" v-for="itm in colOptions">
  16. <text class="label">{{ itm.label }}</text>
  17. <text class="content">{{ item[itm.key] }}</text>
  18. </view>
  19. </view>
  20. <view class="card-footer">
  21. <u-button v-if="['0', '2'].includes(item.extensionProperty.taskHandlePlatform)"
  22. type="success" @click="handleDetail(item, 'handle')">处理</u-button>
  23. <u-button v-else type="error">请在PC端处理</u-button>
  24. <u-button type="info" @click="handleDetail(item, 'detail')">流程详情</u-button>
  25. </view>
  26. </view>
  27. </view>
  28. </u-list-item>
  29. </u-list>
  30. </view>
  31. <view v-show="list.length === 0" class="no_data">
  32. <u-empty mode="data" textSize="30"></u-empty>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. getTodoTaskPage
  39. } from '@/api/wt/index.js'
  40. let [page, size, isEnd] = [1, 10, true]
  41. export default {
  42. computed: {
  43. colOptions() {
  44. return [{
  45. label: '流程节点',
  46. key: 'name'
  47. },
  48. {
  49. label: '流程发起人',
  50. key: `startUserNickname`
  51. }
  52. ]
  53. }
  54. },
  55. data() {
  56. return {
  57. list: [],
  58. params: {
  59. status: '',
  60. name: ''
  61. }
  62. }
  63. },
  64. onShow() {
  65. page = 1
  66. this.list = []
  67. this.getList()
  68. },
  69. methods: {
  70. scrolltolower() {
  71. if (isEnd) return
  72. page++
  73. this.getList()
  74. },
  75. //miniHandleRouter
  76. handleDetail(item, type) {
  77. console.log('111~~~', item)
  78. //'pages/home' + this.listData.miniHandleRouter
  79. ///wt/components/feeApplication/taskSubmit
  80. if (type == 'handle') {
  81. console.log(Object.keys(item.formJson).length)
  82. if (Object.keys(item.formJson).length) {
  83. let params = JSON.stringify({
  84. id: item.id,
  85. processInstanceId: item.processInstance.id|| '',
  86. type: type
  87. })
  88. let queryParams = `params=${params}`
  89. let url = '/pages/home/wt/components/formParser/routerView'
  90. uni.navigateTo({
  91. url: `${url}?${queryParams}`
  92. })
  93. } else {
  94. let queryParams =
  95. `id=${item.processInstance.id}&businessId=${item.businessId}&taskId=${item.id}&taskDefinitionKey=${item.taskDefinitionKey}&miniHandleRouter=${item.miniHandleRouter}&miniViewRouter=${item.miniViewRouter}`
  96. let url = '/pages/home' + item.miniHandleRouter.replace('taskForm', 'processTask')
  97. console.log('url~~~',`${url}?${queryParams}`)
  98. uni.navigateTo({
  99. url: `${url}?${queryParams}`
  100. })
  101. }
  102. //
  103. } else {
  104. uni.navigateTo({
  105. url: `/pages/home/wt/components/detail?processInstanceId=${item.processInstance.id}`
  106. })
  107. }
  108. },
  109. async getList() {
  110. let paging = {
  111. pageNo: page,
  112. pageSize: size,
  113. processType:0
  114. }
  115. let par = Object.assign(paging, this.params)
  116. isEnd = false
  117. const data = await getTodoTaskPage(par)
  118. this.list.push(...data.list)
  119. this.list.forEach(item => {
  120. item.startUserNickname = item.processInstance.startUserNickname
  121. })
  122. isEnd = this.list.length >= data.count
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .blacklog-container {
  129. height: 100vh;
  130. display: flex;
  131. flex-direction: column;
  132. }
  133. .list-container {
  134. flex: 1;
  135. padding: 24rpx;
  136. background: $page-bg;
  137. flex: 1;
  138. overflow: hidden;
  139. // position: absolute;
  140. // top: 88rpx;
  141. // bottom: 0;
  142. // left: 0;
  143. // right: 0;
  144. /deep/ .u-list {
  145. height: 100% !important;
  146. }
  147. }
  148. .no_data {
  149. position: fixed;
  150. top: 50%;
  151. left: 50%;
  152. transform: translate(-50%, -50%);
  153. color: #999;
  154. font-size: 50rpx;
  155. }
  156. .kd-card {
  157. font-size: 34rpx;
  158. color: #333;
  159. background-color: #fff;
  160. border-radius: 10rpx;
  161. word-break: break-all;
  162. margin-bottom: 24rpx;
  163. .status {
  164. font-weight: normal;
  165. }
  166. .card-title {
  167. font-size: 1rem;
  168. font-weight: bold;
  169. .card-time {
  170. font-weight: normal;
  171. color: #bfbfbf;
  172. font-size: 0.9rem;
  173. align-self: center;
  174. }
  175. }
  176. .card-footer,
  177. .card-title {
  178. display: flex;
  179. justify-content: space-between;
  180. padding: 30rpx 30rpx;
  181. }
  182. .card-footer {
  183. padding: 10rpx 30rpx 18rpx 30rpx;
  184. font-size: 0.8rem;
  185. /deep/ .u-button {
  186. width: 48%;
  187. }
  188. }
  189. .card-body {
  190. padding: 0 28rpx;
  191. position: relative;
  192. min-height: 150rpx;
  193. }
  194. .card-body:after {
  195. content: '';
  196. position: absolute;
  197. left: auto;
  198. top: auto;
  199. bottom: 10rpx;
  200. right: auto;
  201. height: 1rpx;
  202. width: 91%;
  203. background-color: #f1f1f1;
  204. }
  205. .card-col {
  206. padding: 8rpx 0;
  207. display: flex;
  208. // line-height: ;
  209. .content {
  210. flex: 1;
  211. overflow: hidden;
  212. font-size: 0.9rem;
  213. }
  214. .label {
  215. font-size: 0.9rem;
  216. color: #999;
  217. width: 25%;
  218. }
  219. }
  220. }
  221. </style>