index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 {getDoneTaskPage} from '@/api/bpm/task'
  39. import {getDate} from "@/utils/dateUtils";
  40. import Vue from "vue";
  41. export default {
  42. name: "BpmDoneTask",
  43. components: {
  44. },
  45. data() {
  46. return {
  47. detailLoading:false,
  48. title:'',
  49. //详情页面id
  50. businessKey:'',
  51. open: false,
  52. // 遮罩层
  53. loading: true,
  54. // 显示搜索条件
  55. showSearch: true,
  56. // 总条数
  57. total: 0,
  58. // 已办任务列表
  59. list: [],
  60. // 查询参数
  61. queryParams: {
  62. pageNo: 1,
  63. pageSize: 10,
  64. name: null,
  65. createTime: []
  66. },
  67. };
  68. },
  69. created() {
  70. this.getList();
  71. },
  72. methods: {
  73. /** 查询列表 */
  74. getList() {
  75. this.loading = true;
  76. getDoneTaskPage(this.queryParams).then(response => {
  77. this.list = response.data.list;
  78. this.total = response.data.total;
  79. this.loading = false;
  80. });
  81. },
  82. /** 搜索按钮操作 */
  83. handleQuery() {
  84. this.queryParams.pageNo = 1;
  85. this.getList();
  86. },
  87. /** 重置按钮操作 */
  88. resetQuery() {
  89. this.resetForm("queryForm");
  90. this.handleQuery();
  91. },
  92. getDateStar(ms) {
  93. return getDate(ms);
  94. },
  95. /** 处理审批按钮 */
  96. handleAudit(row) {
  97. this.title = row.processInstance.name;
  98. console.log(row);
  99. this.businessKey = row.processInstance.businessKey;
  100. //将业务表单,注册为动态组件
  101. const path = row.processDefinition.formCustomViewPath;
  102. console.log("path:" + path)
  103. Vue.component("async-biz-form-component", function (resolve) {
  104. require([`@/views${path}`], resolve);
  105. });
  106. this.open = true;
  107. }
  108. }
  109. };
  110. </script>