handled.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <ibps-layout ref="layout">
  3. <div slot="west">
  4. <ibps-type-tree
  5. :width="width"
  6. :height="height"
  7. title="事务分类"
  8. category-key="FLOW_TYPE"
  9. @node-click="handleNodeClick"
  10. @expand-collapse="handleExpandCollapse"
  11. />
  12. </div>
  13. <!-- :style="{ marginLeft: width+'px' }" -->
  14. <ibps-crud
  15. ref="crud"
  16. :height="height"
  17. :data="listData"
  18. :toolbars="listConfig.toolbars"
  19. :search-form="listConfig.searchForm"
  20. :pk-key="pkKey"
  21. :columns="listConfig.columns"
  22. :row-handle="listConfig.rowHandle"
  23. :pagination="pagination"
  24. :loading="loading"
  25. :selection-row="false"
  26. :index-row="false"
  27. :display-field="title"
  28. @action-event="handleAction"
  29. @sort-change="handleSortChange"
  30. @column-link-click="handleLinkClick"
  31. @pagination-change="handlePaginationChange"
  32. >
  33. <template slot="createDept" slot-scope="scope">
  34. <span class="wrap">{{ getTransformData(scope.row.createDept, 'deptList', 'positionId', 'positionName') }}</span>
  35. </template>
  36. <template slot="createBy" slot-scope="scope">
  37. <span class="wrap">{{ getTransformData(scope.row.createBy, 'userList', 'userId', 'userName') }}</span>
  38. </template>
  39. <template slot="updateBy" slot-scope="scope">
  40. <span class="wrap">{{ getTransformData(scope.row.updateBy, 'userList', 'userId', 'userName') }}</span>
  41. </template>
  42. </ibps-crud>
  43. <bpmn-formrender
  44. :visible="dialogFormVisible"
  45. :instance-id="instanceId"
  46. @callback="search"
  47. @close="visible => dialogFormVisible = visible"
  48. />
  49. </ibps-layout>
  50. </template>
  51. <script>
  52. import { handled } from '@/api/platform/office/bpmReceived'
  53. import { statusOptions, endOptions } from '@/business/platform/bpmn/constants'
  54. import ActionUtils from '@/utils/action'
  55. import FixHeight from '@/mixins/height'
  56. import CommonData from '../mixin/utils'
  57. export default {
  58. mixins: [FixHeight, CommonData],
  59. data () {
  60. return {
  61. title: '我的已办',
  62. listConfig: {
  63. // 工具栏
  64. toolbars: [
  65. { key: 'search' }
  66. ],
  67. // 查询条件
  68. searchForm: {
  69. forms: [
  70. { prop: 'Q^proc_def_name_^SL', label: '事务名称' },
  71. { prop: 'Q^subject_^SL', name: 'Q^inst.subject_^SL', label: '事务说明' },
  72. {
  73. prop: ['Q^create_time_^DL', 'Q^create_time_^DG'],
  74. name: ['Q^inst.create_time_^DL', 'Q^inst.create_time_^DG'],
  75. label: '创建时间',
  76. fieldType: 'daterange'
  77. },
  78. {
  79. prop: 'end',
  80. label: '是否结束',
  81. labelWidth: 100,
  82. fieldType: 'select',
  83. options: endOptions
  84. }
  85. ]
  86. },
  87. // 表格字段配置
  88. columns: [
  89. { prop: 'procDefName', label: '事务名称', link: 'dialog', width: 200 },
  90. { prop: 'subject', label: '事务说明', minWidth: 200 },
  91. { prop: 'curNode', label: '审批状态', width: 120 },
  92. { prop: 'createDept', label: '发起部门', width: 90, slotName: 'createDept' },
  93. { prop: 'createBy', label: '发起人', width: 80, slotName: 'createBy' },
  94. { prop: 'updateBy', label: '提交人', width: 80, slotName: 'updateBy' },
  95. { prop: 'updateTime', label: '办理时间', width: 150, sortable: true },
  96. { prop: 'status', label: '事务状态', tags: statusOptions, width: 100 }
  97. ]
  98. }
  99. }
  100. },
  101. created () {
  102. this.loadData()
  103. },
  104. methods: {
  105. /**
  106. * 加载数据
  107. */
  108. loadData () {
  109. this.loading = true
  110. handled(this.getFormatParams()).then(response => {
  111. const { data } = response || {}
  112. data.dataResult.forEach((item, i) => {
  113. item.createDept = this.getTaskInfo(item.subject)
  114. item.subject = this.getTaskDesc(item.subject)
  115. item.curNode = item.curNode ? `待${item.curNode}` : '已结束'
  116. })
  117. ActionUtils.handleListData(this, data)
  118. this.loading = false
  119. }).catch(() => {
  120. this.loading = false
  121. })
  122. },
  123. /**
  124. * 处理按钮事件
  125. */
  126. handleAction (command, position, selection, data) {
  127. switch (command) {
  128. case 'search':// 查询
  129. ActionUtils.setFirstPagination(this.pagination)
  130. this.search()
  131. break
  132. default:
  133. break
  134. }
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. .ibps-layout .container-component {
  141. position: absolute;
  142. top: 0px;
  143. right: 0;
  144. bottom: 0px;
  145. left: 220px!important;
  146. }
  147. .ibps-card-list-container .ibps-card-list--picture-card {
  148. display: block;
  149. }
  150. </style>