ccList.vue 3.0 KB

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