index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索工作栏 -->
  4. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  5. <el-form-item label="流程名成" prop="name">
  6. <el-input v-model="queryParams.name" placeholder="请输入流程名" clearable @keyup.enter.native="handleQuery"/>
  7. </el-form-item>
  8. <el-form-item label="创建时间" prop="createTime">
  9. <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
  10. range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <!-- 列表 -->
  18. <el-table v-loading="loading" :data="list" @row-click="handleAudit">
  19. <el-table-column label="任务编号" align="center" prop="id"/>
  20. <el-table-column label="流程名称" align="center" prop="processInstance.name" />
  21. <el-table-column label="流程发起人" align="center" prop="processInstance.startUser.nickname" />
  22. <el-table-column label="当前节点" align="center" prop="taskDefinitionKey" />
  23. <el-table-column label="创建时间" align="center" prop="createTime" width="180">
  24. <template v-slot="scope">
  25. <span>{{ parseTime(scope.row.createTime) }}</span>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. <!-- 分页组件 -->
  30. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  31. @pagination="getList"/>
  32. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body v-loading="detailLoading">
  33. <async-biz-form-component :id="businessKey"></async-biz-form-component>
  34. </el-dialog>
  35. </div>
  36. </template>
  37. <script>
  38. import {getTodoTaskPage} from '@/api/bpm/task'
  39. import Vue from "vue";
  40. export default {
  41. name: "BpmTodoTask",
  42. components: {
  43. },
  44. data() {
  45. return {
  46. detailLoading:false,
  47. title:'',
  48. //详情页面id
  49. businessKey:'',
  50. open: false,
  51. // 遮罩层
  52. loading: true,
  53. // 显示搜索条件
  54. showSearch: true,
  55. // 总条数
  56. total: 0,
  57. // 待办任务列表
  58. list: [],
  59. // 查询参数
  60. queryParams: {
  61. pageNo: 1,
  62. pageSize: 10,
  63. name: null,
  64. createTime: []
  65. },
  66. };
  67. },
  68. created() {
  69. this.getList();
  70. },
  71. methods: {
  72. closeEdit() {
  73. this.open = false;
  74. this.getList();
  75. },
  76. /** 查询列表 */
  77. getList() {
  78. this.loading = true;
  79. // 处理查询参数
  80. getTodoTaskPage(this.queryParams).then(response => {
  81. this.list = response.data.list;
  82. this.total = response.data.total;
  83. this.loading = false;
  84. });
  85. },
  86. /** 搜索按钮操作 */
  87. handleQuery() {
  88. this.queryParams.pageNo = 1;
  89. this.getList();
  90. },
  91. /** 重置按钮操作 */
  92. resetQuery() {
  93. this.resetForm("queryForm");
  94. this.handleQuery();
  95. },
  96. /** 处理审批按钮 */
  97. handleAudit(row) {
  98. this.title = row.processInstance.name;
  99. console.log(row);
  100. this.businessKey = row.processInstance.businessKey;
  101. //将业务表单,注册为动态组件
  102. const path = row.taskDefinitionKey == 'modifyApply' ? row.processDefinition.formCustomCreatePath : row.processDefinition.formCustomViewPath;
  103. console.log("path:" + path)
  104. Vue.component("async-biz-form-component", function (resolve) {
  105. require([`@/views${path}`], resolve);
  106. });
  107. this.open = true;
  108. }
  109. }
  110. };
  111. </script>