ccList.vue 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. <!-- @content-click="(id) => handle2ProcessTask(item.id, item.procInstId, 'cc', item.procDefId,false)" -->
  14. <di-descriptions :title="item.processDefinitionName" label-col="3" value-col="9" :border-bottom="true" >
  15. <template slot="right" v-if="categoryMap[item.category]">
  16. <u-tag size="mini" :text="categoryMap[item.category].label" :type="categoryMap[item.category].type" mode="light" />
  17. </template>
  18. <di-descriptions-item label="流程单号" :value="item.processNo" :ellipsis="true"/>
  19. <di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
  20. <di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
  21. <u-row style="justify-content: flex-end;">
  22. <u-col :span="2">
  23. <u-button type="primary" plain size="mini" @click="handleRead(item.id, 'read')">已读</u-button>
  24. </u-col>
  25. </u-row>
  26. <!-- <di-descriptions-item label="办结时间" :value="item.endTime" :ellipsis="true"/> -->
  27. </di-descriptions>
  28. </u-swipe-action>
  29. </view>
  30. <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
  31. </scroll-view>
  32. </template>
  33. <script>
  34. import approveList from './approveList'
  35. export default {
  36. mixins: [approveList],
  37. data() {
  38. return {
  39. baseApi: '/cusFlowTask',
  40. listApi: 'myCcList',
  41. customQueryParam: {
  42. category: 'todo',
  43. taskCategory: 'cc',
  44. // findByCurrentUserId: true,
  45. // orderBy: 'startTime:DESC'
  46. },
  47. categoryMap: {
  48. todo: {
  49. label: '待办',
  50. type: 'primary'
  51. },
  52. hold: {
  53. label: '暂存',
  54. type: 'warning'
  55. },
  56. cc: {
  57. label: '抄送',
  58. type: 'success'
  59. }
  60. }
  61. }
  62. },
  63. methods: {
  64. async handleClickContext (id, item) {
  65. /* if (!item.assignee) {
  66. await this.claim(item.id)
  67. } */
  68. this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
  69. },
  70. async handleRead(taskId,taskOperate) {
  71. let {code,msg} = await this.$dibootApi.put('/workflow/task/taskOperate', {
  72. taskId,
  73. taskOperate
  74. })
  75. if (code == 0) {
  76. uni.showToast({
  77. title: msg,
  78. icon: 'none'
  79. })
  80. this.page.pageIndex = 1
  81. this.getList(true)
  82. }
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. .di-scroll-list {
  89. background: none;
  90. }
  91. </style>