handled.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. <ibps-crud
  14. ref="crud"
  15. :height="height"
  16. :style="{ marginLeft: width + 'px' }"
  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">{{
  35. getTransformData(
  36. scope.row.createDept,
  37. 'deptList',
  38. 'positionId',
  39. 'positionName'
  40. )
  41. }}</span>
  42. </template>
  43. <template slot="createBy" slot-scope="scope">
  44. <span class="wrap">{{
  45. getTransformData(scope.row.createBy, 'userList', 'userId', 'userName')
  46. }}</span>
  47. </template>
  48. <template slot="updateBy" slot-scope="scope">
  49. <span class="wrap">{{
  50. getTransformData(scope.row.updateBy, 'userList', 'userId', 'userName')
  51. }}</span>
  52. </template>
  53. </ibps-crud>
  54. <bpmn-formrender
  55. :visible="dialogFormVisible"
  56. :instance-id="instanceId"
  57. @callback="search"
  58. @close="(visible) => (dialogFormVisible = visible)"
  59. />
  60. </ibps-layout>
  61. </template>
  62. <script>
  63. import { handled } from '@/api/platform/office/bpmReceived'
  64. import { statusOptions, endOptions } from '@/business/platform/bpmn/constants'
  65. import ActionUtils from '@/utils/action'
  66. import FixHeight from '@/mixins/height'
  67. import CommonData from '../mixin/utils'
  68. export default {
  69. mixins: [FixHeight, CommonData],
  70. data() {
  71. return {
  72. title: '我的已办',
  73. listConfig: {
  74. // 工具栏
  75. toolbars: [{ key: 'search' }],
  76. // 查询条件
  77. searchForm: {
  78. forms: [
  79. { prop: 'Q^proc_def_name_^SL', label: '事务名称' },
  80. {
  81. prop: 'Q^subject_^SL',
  82. name: 'Q^inst.subject_^SL',
  83. label: '事务说明'
  84. },
  85. {
  86. prop: ['Q^create_time_^DL', 'Q^create_time_^DG'],
  87. name: ['Q^inst.create_time_^DL', 'Q^inst.create_time_^DG'],
  88. label: '创建时间',
  89. fieldType: 'daterange'
  90. },
  91. {
  92. prop: 'end',
  93. label: '是否结束',
  94. labelWidth: 100,
  95. fieldType: 'select',
  96. options: endOptions
  97. }
  98. ]
  99. },
  100. // 表格字段配置
  101. columns: [
  102. {
  103. prop: 'procDefName',
  104. label: '事务名称',
  105. link: 'dialog',
  106. width: 200
  107. },
  108. { prop: 'subject', label: '事务说明', minWidth: 200 },
  109. { prop: 'curNode', label: '审批状态', width: 120 },
  110. {
  111. prop: 'createDept',
  112. label: '发起部门',
  113. width: 90,
  114. slotName: 'createDept'
  115. },
  116. {
  117. prop: 'createBy',
  118. label: '发起人',
  119. width: 80,
  120. slotName: 'createBy'
  121. },
  122. {
  123. prop: 'updateBy',
  124. label: '提交人',
  125. width: 80,
  126. slotName: 'updateBy'
  127. },
  128. {
  129. prop: 'updateTime',
  130. label: '办理时间',
  131. width: 150,
  132. sortable: true
  133. },
  134. {
  135. prop: 'status',
  136. label: '事务状态',
  137. tags: statusOptions,
  138. width: 100
  139. }
  140. ]
  141. }
  142. }
  143. },
  144. created() {
  145. this.loadData()
  146. },
  147. methods: {
  148. /**
  149. * 加载数据
  150. */
  151. loadData() {
  152. this.loading = true
  153. handled(this.getFormatParams())
  154. .then((response) => {
  155. const { data } = response || {}
  156. data.dataResult.forEach((item, i) => {
  157. item.createDept = this.getTaskInfo(item.subject)
  158. item.subject = this.getTaskDesc(item.subject)
  159. item.curNode = item.curNode ? `待${item.curNode}` : '已结束'
  160. })
  161. ActionUtils.handleListData(this, data)
  162. console.log('data===>', data)
  163. this.loading = false
  164. })
  165. .catch((err) => {
  166. console.log(err)
  167. this.loading = false
  168. })
  169. },
  170. /**
  171. * 获取格式化参数
  172. */
  173. getFormatParams() {
  174. const params = this.$refs['crud']
  175. ? this.$refs['crud'].getSearcFormData()
  176. : {}
  177. delete params['Q^inst.status_^SL']
  178. delete params['Q^inst.status_^NE']
  179. switch (params.end) {
  180. case 'true':
  181. params['Q^inst.status_^SL'] = 'end'
  182. break
  183. case 'false':
  184. params['Q^inst.status_^NE'] = 'end'
  185. break
  186. default:
  187. break
  188. }
  189. delete params.end
  190. params['Q^TYPE_ID_^S'] = this.typeId
  191. return ActionUtils.formatParams(params, this.pagination, this.sorts)
  192. },
  193. /**
  194. * 处理按钮事件
  195. */
  196. handleAction(command, position, selection, data) {
  197. switch (command) {
  198. case 'search': // 查询
  199. ActionUtils.setFirstPagination(this.pagination)
  200. this.search()
  201. break
  202. default:
  203. break
  204. }
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. // .ibps-layout .container-component {
  211. // position: absolute;
  212. // top: 0px;
  213. // right: 0;
  214. // bottom: 0px;
  215. // left: 220px!important;
  216. // }
  217. // .ibps-card-list-container .ibps-card-list--picture-card {
  218. // display: block;
  219. // }
  220. </style>