todoList.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <scroll-view :style="{height: `calc(${approveListHeight}px - 20rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
  3. refresher-enabled @refresherrefresh="handlePullDownRefresh">
  4. <view class="di-scroll-list">
  5. <!-- 右滑 -->
  6. <u-swipe-action
  7. style="margin-bottom: 20rpx;border-radius: 10rpx;overflow: hidden;"
  8. v-for="(item, index) in list"
  9. :show="activeIndex === item[primaryKey]"
  10. :key="index"
  11. :index='item.id'
  12. @content-click="(id) => handleClickContext(id, item)">
  13. <di-descriptions :title="item.processDefinitionName" label-col="3" value-col="9" :border-bottom="true" >
  14. <template slot="right" v-if="categoryMap[item.category]">
  15. <u-tag size="mini" :text="categoryMap[item.category].label" :type="categoryMap[item.category].type" mode="light" />
  16. </template>
  17. <!-- <di-descriptions-item label="节点名称" :value="item.name" :ellipsis="true"/>
  18. <di-descriptions-item label="开始时间" :value="item.createTime" :ellipsis="true"/> -->
  19. <di-descriptions-item label="流程单号" :value="item.processNo" :ellipsis="true"/>
  20. <di-descriptions-item label="待办节点" :value="item.name" :ellipsis="true"/>
  21. <di-descriptions-item label="提交人" :value="item.applyUserName" :ellipsis="true"/>
  22. <di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
  23. </di-descriptions>
  24. </u-swipe-action>
  25. </view>
  26. <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
  27. </scroll-view>
  28. </template>
  29. <script>
  30. import approveList from './approveList'
  31. export default {
  32. mixins: [approveList],
  33. data() {
  34. return {
  35. baseApi: '/cusFlowTask',
  36. listApi: 'myTodoList',
  37. customQueryParam: {
  38. category: 'todo',
  39. taskCategory: 'todo',
  40. },
  41. categoryMap: {
  42. todo: {
  43. label: '待办',
  44. type: 'primary'
  45. },
  46. hold: {
  47. label: '暂存',
  48. type: 'warning'
  49. },
  50. cc: {
  51. label: '抄送',
  52. type: 'success'
  53. }
  54. }
  55. }
  56. },
  57. methods: {
  58. async handleClickContext (id, item) {
  59. /* if (!item.assignee) {
  60. await this.claim(item.id)
  61. } */
  62. this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
  63. },
  64. async claim (taskId) {
  65. await this.$dibootApi.put('/workflow/task/taskOperate', {
  66. taskId,
  67. taskOperate: 'claim'
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .di-scroll-list {
  75. background: none;
  76. }
  77. </style>