todoList.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-item label="药剂类型" :value="item.medicineTypeName" :ellipsis="true"/>
  24. </di-descriptions>
  25. </u-swipe-action>
  26. </view>
  27. <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
  28. </scroll-view>
  29. </template>
  30. <script>
  31. import approveList from './approveList'
  32. export default {
  33. mixins: [approveList],
  34. data() {
  35. return {
  36. baseApi: '/cusFlowTask',
  37. listApi: 'myTodoList',
  38. customQueryParam: {
  39. category: 'todo',
  40. taskCategory: 'todo',
  41. },
  42. categoryMap: {
  43. todo: {
  44. label: '待办',
  45. type: 'primary'
  46. },
  47. hold: {
  48. label: '暂存',
  49. type: 'warning'
  50. },
  51. cc: {
  52. label: '抄送',
  53. type: 'success'
  54. }
  55. }
  56. }
  57. },
  58. methods: {
  59. async handleClickContext (id, item) {
  60. /* if (!item.assignee) {
  61. await this.claim(item.id)
  62. } */
  63. this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
  64. },
  65. async claim (taskId) {
  66. await this.$dibootApi.put('/workflow/task/taskOperate', {
  67. taskId,
  68. taskOperate: 'claim'
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. .di-scroll-list {
  76. background: none;
  77. }
  78. </style>