completed.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. :index-row="false"
  26. :selection-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. <!-- <div>
  51. <ibps-layout ref="layout">
  52. <div slot="west">
  53. <ibps-type-tree
  54. :width="width"
  55. :height="height"
  56. title="任务分类"
  57. category-key="FLOW_TYPE"
  58. @node-click="handleNodeClick"
  59. @expand-collapse="handleExpandCollapse"
  60. />
  61. </div>
  62. <ibps-card-list
  63. ref="crud"
  64. :title="title"
  65. :height="height"
  66. :data="listData"
  67. :pagination="pagination"
  68. :pk-key="pkKey"
  69. :toolbars="listConfig.toolbars"
  70. :search-form="listConfig.searchForm"
  71. :columns="listConfig.columns"
  72. :loading="loading"
  73. :index-row="false"
  74. @action-event="handleAction"
  75. @sort-change="handleSortChange"
  76. @pagination-change="handlePaginationChange"
  77. >
  78. <template slot="item-symbol">
  79. <p style="width:60px;height:60px;border: 2px solid #409eff;border-radius: 100%;font-size: 48px;color:#409eff;font-size:30px;line-height: 60px;">办结</p>
  80. </template>
  81. <template slot="item-detail-name">
  82. <span />
  83. </template>
  84. <template slot="item-detail-partyTypeName">
  85. <span />
  86. </template>
  87. <template slot="item-detail-createTime">
  88. <span />
  89. </template>
  90. <template slot="item-detail-taskName">
  91. <span />
  92. </template>
  93. <template slot="item-detail-completeTime">
  94. <span />
  95. </template>
  96. <template slot="item-detail-curNode">
  97. <span />
  98. </template>
  99. <template slot="item-detail-status">
  100. <span />
  101. </template>
  102. </ibps-card-list>
  103. <bpmn-formrender
  104. :visible="dialogFormVisible"
  105. :instance-id="instanceId"
  106. @callback="search"
  107. @close="visible => dialogFormVisible = visible"
  108. />
  109. </ibps-layout>
  110. </div> -->
  111. </template>
  112. <script>
  113. import { handled } from '@/api/platform/office/bpmReceived'
  114. import { statusOptions, status } from '@/business/platform/bpmn/constants'
  115. import ActionUtils from '@/utils/action'
  116. import FixHeight from '@/mixins/height'
  117. import CommonData from '../mixin/utils'
  118. export default {
  119. mixins: [FixHeight, CommonData],
  120. data () {
  121. return {
  122. title: '我的办结',
  123. statusOptions,
  124. listConfig: {
  125. // 工具栏
  126. toolbars: [
  127. { key: 'search' }
  128. ],
  129. // 查询条件
  130. searchForm: {
  131. forms: [
  132. { prop: 'Q^proc_def_name_^SL', name: 'Q^inst.proc_def_name_^SL', label: '事务名称', itemWidth: 200 },
  133. { prop: 'Q^subject_^SL', name: 'Q^inst.subject_^SL', label: '事务说明', itemWidth: 200 },
  134. { prop: 'Q^status_^S',
  135. name: 'Q^inst.status_^S',
  136. label: '状态',
  137. itemWidth: 200,
  138. labelWidth: 70,
  139. fieldType: 'select',
  140. options: status
  141. },
  142. {
  143. prop: ['Q^create_time_^DL', 'Q^create_time_^DG'],
  144. name: ['Q^inst.create_time_^DL', 'Q^inst.create_time_^DG'],
  145. label: '创建时间',
  146. fieldType: 'daterange'
  147. }
  148. ]
  149. },
  150. // 表格字段配置
  151. columns: [
  152. { prop: 'procDefName', label: '事务名称', width: 200, link: 'dialog' },
  153. { prop: 'subject', label: '事务说明', minWidth: 200 },
  154. { prop: 'createDept', label: '发起部门', width: 100, slotName: 'createDept' },
  155. { prop: 'createBy', label: '发起人', width: 80, slotName: 'createBy' },
  156. { prop: 'updateBy', label: '提交人', width: 80, slotName: 'updateBy' },
  157. { prop: 'createTime', label: '创建时间', width: 150, sortable: true },
  158. { prop: 'status', label: '事务状态', tags: statusOptions, width: 100 }
  159. ]
  160. }
  161. }
  162. },
  163. created () {
  164. this.loadData()
  165. },
  166. methods: {
  167. /**
  168. * 加载数据
  169. */
  170. loadData () {
  171. this.loading = true
  172. // handled(this.getFormatParams()).then(response => {
  173. handled(this.getSearchFormData()).then(response => {
  174. const { data } = response || {}
  175. data.dataResult.forEach((item, i) => {
  176. item.createDept = this.getTaskInfo(item.subject)
  177. item.subject = this.getTaskDesc(item.subject)
  178. item.curNode = item.curNode ? `待${item.curNode}` : '已结束'
  179. })
  180. ActionUtils.handleListData(this, data)
  181. this.loading = false
  182. }).catch(() => {
  183. this.loading = false
  184. })
  185. },
  186. // getFormatParams () {
  187. // const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
  188. // if (!params.hasOwnProperty('Q^inst.status_^S')) {
  189. // params['Q^inst.status_^NE'] = 'running'
  190. // }
  191. // return ActionUtils.formatParams(params, this.pagination, this.sorts)
  192. // },
  193. // 获取格式化参数
  194. getSearchFormData () {
  195. let params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
  196. params = {
  197. ...params,
  198. ...this.searchParams
  199. }
  200. if (this.$utils.isNotEmpty(this.typeId)) {
  201. params['Q^TYPE_ID_^S'] = this.typeId
  202. }
  203. return ActionUtils.formatParams(
  204. params,
  205. this.pagination,
  206. this.sorts
  207. )
  208. },
  209. /**
  210. * 处理按钮事件
  211. */
  212. handleAction (command, position, selection, data) {
  213. switch (command) {
  214. case 'search':// 查询
  215. ActionUtils.setFirstPagination(this.pagination)
  216. this.search()
  217. break
  218. case 'add':// 添加
  219. this.handleEdit()
  220. break
  221. case 'edit':// 编辑
  222. this.handleEdit(selection)
  223. break
  224. default:
  225. break
  226. }
  227. },
  228. /**
  229. * 编辑
  230. */
  231. handleEdit (id) {
  232. this.instanceId = id
  233. this.dialogFormVisible = true
  234. }
  235. }
  236. }
  237. </script>