completed.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. :data="listData"
  17. :toolbars="listConfig.toolbars"
  18. :search-form="listConfig.searchForm"
  19. :pk-key="pkKey"
  20. :columns="listConfig.columns"
  21. display-field="我的办结"
  22. :row-handle="listConfig.rowHandle"
  23. :pagination="pagination"
  24. :loading="loading"
  25. :index-row="false"
  26. :selection-row="false"
  27. @action-event="handleAction"
  28. @sort-change="handleSortChange"
  29. @column-link-click="handleLinkClick"
  30. @pagination-change="handlePaginationChange"
  31. />
  32. <bpmn-formrender
  33. :visible="dialogFormVisible"
  34. :instance-id="instanceId"
  35. @callback="search"
  36. @close="visible => dialogFormVisible = visible"
  37. />
  38. </ibps-layout>
  39. <!-- <div>
  40. <ibps-layout ref="layout">
  41. <div slot="west">
  42. <ibps-type-tree
  43. :width="width"
  44. :height="height"
  45. title="任务分类"
  46. category-key="FLOW_TYPE"
  47. @node-click="handleNodeClick"
  48. @expand-collapse="handleExpandCollapse"
  49. />
  50. </div>
  51. <ibps-card-list
  52. ref="crud"
  53. :title="title"
  54. :height="height"
  55. :data="listData"
  56. :pagination="pagination"
  57. :pk-key="pkKey"
  58. :toolbars="listConfig.toolbars"
  59. :search-form="listConfig.searchForm"
  60. :columns="listConfig.columns"
  61. :loading="loading"
  62. :index-row="false"
  63. @action-event="handleAction"
  64. @sort-change="handleSortChange"
  65. @pagination-change="handlePaginationChange"
  66. >
  67. <template slot="item-symbol">
  68. <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>
  69. </template>
  70. <template slot="item-detail-name">
  71. <span></span>
  72. </template>
  73. <template slot="item-detail-partyTypeName">
  74. <span></span>
  75. </template>
  76. <!-- <template slot="item-detail-createTime">
  77. <span></span>
  78. </template>
  79. <template slot="item-detail-taskName">
  80. <span></span>
  81. </template>
  82. <template slot="item-detail-completeTime">
  83. <span></span>
  84. </template>
  85. <template slot="item-detail-curNode">
  86. <span></span>
  87. </template>
  88. <template slot="item-detail-status">
  89. <span></span>
  90. </template>
  91. </ibps-card-list>
  92. <bpmn-formrender
  93. :visible="dialogFormVisible"
  94. :instance-id="instanceId"
  95. @callback="search"
  96. @close="visible => dialogFormVisible = visible"
  97. />
  98. </ibps-layout>
  99. </div> -->
  100. </template>
  101. <script>
  102. import { handled } from '@/api/platform/office/bpmReceived'
  103. import { statusOptions, status } from '@/business/platform/bpmn/constants'
  104. import ActionUtils from '@/utils/action'
  105. import FixHeight from '@/mixins/height'
  106. import IbpsTypeTree from '@/business/platform/cat/type/tree'
  107. import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
  108. export default {
  109. components: {
  110. IbpsTypeTree,
  111. BpmnFormrender,
  112. 'ibps-type-tree': () => import('@/business/platform/cat/type/tree'),
  113. 'ibps-card-list': () => import('@/components/ibps-card-list/list'),
  114. 'form-builder': () => import('@/business/platform/form/formbuilder/dialog'),
  115. 'formrender-preview': () => import('@/business/platform/form/formrender/preview/index')
  116. },
  117. mixins: [FixHeight],
  118. data() {
  119. return {
  120. width: 220,
  121. height: 500,
  122. title:'办结的事务',
  123. // height: document.clientHeight,
  124. query: '',
  125. typeId: '',
  126. pkKey: 'id', // 主键 如果主键不是pk需要传主键
  127. loading: false,
  128. dialogFormVisible: false,
  129. copyDialogFormVisible: false,
  130. rightsDialogFormVisible: false,
  131. formbuilderDialogVisible: false,
  132. formrenderDialogVisible: false,
  133. importFormVisible: false,
  134. formPrintDialogVisible: false,
  135. instanceId: '', // 编辑dialog需要使用
  136. statusOptions: [],
  137. editId: '',
  138. formKey: '',
  139. searchField: '',
  140. searchName: 'Q^subject_^SL',
  141. listData: [],
  142. listConfig: {
  143. // 工具栏
  144. toolbars: [
  145. { key: 'search' }
  146. ],
  147. // 查询条件
  148. searchForm: {
  149. forms: [
  150. { prop: 'Q^subject_^SL', name: 'Q^inst.subject_^SL', label: '请求标题', itemWidth: 200 },
  151. { prop: 'Q^proc_def_name_^SL', name: 'Q^inst.proc_def_name_^SL', label: '流程名称', itemWidth: 200 },
  152. { prop: 'Q^status_^S',
  153. name: 'Q^inst.status_^S',
  154. label: '状态',
  155. itemWidth: 200,
  156. labelWidth: 70,
  157. fieldType: 'select',
  158. options: status
  159. },
  160. {
  161. prop: ['Q^create_time_^DL', 'Q^create_time_^DG'],
  162. name: ['Q^inst.create_time_^DL', 'Q^inst.create_time_^DG'],
  163. label: '创建时间',
  164. fieldType: 'daterange'
  165. }
  166. ]
  167. },
  168. // 表格字段配置
  169. columns: [
  170. { prop: 'taskSubjectName', label: '请求标题', link: 'dialog' },
  171. { prop: 'procDefName', label: '流程名称', width: 200 },
  172. { prop: 'createTime', label: '创建时间', width: 150 },
  173. { prop: 'status', label: '状态', tags: statusOptions, width: 140 }
  174. ]
  175. },
  176. pagination: {},
  177. sorts: {}
  178. }
  179. },
  180. created() {
  181. this.loadData()
  182. },
  183. methods: {
  184. /**
  185. * 加载数据
  186. */
  187. loadData() {
  188. this.loading = true
  189. handled(this.getFormatParams()).then(response => {
  190. response.data.dataResult.forEach((item) => {
  191. const taskSubject = item.subject.split('#')
  192. this.$set(item, 'taskSubjectName', taskSubject[0] +'#'+ taskSubject[1]+'#')
  193. })
  194. ActionUtils.handleListData(this, response.data)
  195. this.loading = false
  196. }).catch(() => {
  197. this.loading = false
  198. })
  199. },
  200. /**
  201. * 获取格式化参数
  202. */
  203. getFormatParams() {
  204. const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
  205. params['end'] = '1'
  206. if (this.$utils.isNotEmpty(this.typeId)) {
  207. params['Q^TYPE_ID_^S'] = this.typeId
  208. }
  209. return ActionUtils.formatParams(
  210. params,
  211. this.pagination,
  212. this.sorts)
  213. },
  214. /**
  215. * 处理分页事件
  216. */
  217. handlePaginationChange(page) {
  218. ActionUtils.setPagination(this.pagination, page)
  219. this.loadData()
  220. },
  221. /**
  222. * 处理排序
  223. */
  224. handleSortChange(sort) {
  225. ActionUtils.setSorts(this.sorts, sort)
  226. this.loadData()
  227. },
  228. search() {
  229. this.loadData()
  230. },
  231. /**
  232. * 重置查询条件
  233. */
  234. reset() {
  235. this.$refs['crud'].handleReset()
  236. },
  237. /**
  238. * 点击表格
  239. */
  240. handleLinkClick(data) {
  241. this.instanceId = data.id || ''
  242. this.dialogFormVisible = true
  243. },
  244. /**
  245. * 处理按钮事件
  246. */
  247. handleAction(command, position, selection, data) {
  248. switch (command) {
  249. case 'search':// 查询
  250. ActionUtils.setFirstPagination(this.pagination)
  251. this.search()
  252. break
  253. case 'add':// 添加
  254. this.handleEdit()
  255. break
  256. case 'edit':// 编辑
  257. this.handleEdit(selection)
  258. break
  259. default:
  260. break
  261. }
  262. },
  263. /**
  264. * 编辑
  265. */
  266. handleEdit(id) {
  267. this.instanceId = id
  268. this.dialogFormVisible = true
  269. },
  270. handleNodeClick(typeId) {
  271. this.typeId = typeId
  272. this.loadData()
  273. },
  274. handleExpandCollapse(isExpand) {
  275. this.width = isExpand ? 230 : 30
  276. }
  277. }
  278. }
  279. </script>
  280. <style scoped>
  281. .ibps-layout >>> .container-component{
  282. position: absolute;
  283. top: 0px;
  284. right: 0;
  285. bottom: 0px;
  286. left: 220px!important;}
  287. .ibps-card-list-container >>> .ibps-card-list--picture-card{display: block;}
  288. </style>