提交 | 用户 | 时间
|
759b1c
|
1 |
<template> |
H |
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="processDefinitionId"> |
|
9 |
<el-input v-model="queryParams.processDefinitionId" placeholder="请输入流程定义的编号" clearable @keyup.enter.native="handleQuery"/> |
|
10 |
</el-form-item> |
|
11 |
<el-form-item label="流程分类" prop="category"> |
|
12 |
<el-select v-model="queryParams.category" placeholder="请选择流程分类" clearable> |
|
13 |
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)" |
|
14 |
:key="dict.value" :label="dict.label" :value="dict.value"/> |
|
15 |
</el-select> |
|
16 |
</el-form-item> |
|
17 |
<el-form-item label="提交时间" prop="createTime"> |
|
18 |
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" |
|
19 |
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> |
|
20 |
</el-form-item> |
|
21 |
<el-form-item label="状态" prop="status"> |
|
22 |
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> |
|
23 |
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)" |
|
24 |
:key="dict.value" :label="dict.label" :value="dict.value"/> |
|
25 |
</el-select> |
|
26 |
</el-form-item> |
|
27 |
<el-form-item label="结果" prop="result"> |
|
28 |
<el-select v-model="queryParams.result" placeholder="请选择流结果" clearable> |
|
29 |
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)" |
|
30 |
:key="dict.value" :label="dict.label" :value="dict.value"/> |
|
31 |
</el-select> |
|
32 |
</el-form-item> |
|
33 |
<el-form-item> |
|
34 |
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
|
35 |
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|
36 |
</el-form-item> |
|
37 |
</el-form> |
|
38 |
|
|
39 |
<!-- 操作工具栏 --> |
|
40 |
<el-row :gutter="10" class="mb8"> |
|
41 |
<el-col :span="1.5"> |
|
42 |
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
|
43 |
v-hasPermi="['bpm:process-instance:query']">发起流程</el-button> |
|
44 |
</el-col> |
|
45 |
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
46 |
</el-row> |
|
47 |
|
|
48 |
<!-- 列表 --> |
|
49 |
<el-table v-loading="loading" :data="list"> |
|
50 |
<el-table-column label="编号" align="center" prop="id" width="320" /> |
|
51 |
<el-table-column label="流程名" align="center" prop="name" /> |
|
52 |
<el-table-column label="流程分类" align="center" prop="category"> |
|
53 |
<template v-slot="scope"> |
|
54 |
<dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" /> |
|
55 |
</template> |
|
56 |
</el-table-column> |
|
57 |
<el-table-column label="当前审批任务" align="center" prop="tasks"> |
|
58 |
<template v-slot="scope"> |
|
59 |
<el-button v-for="task in scope.row.tasks" :key="task.id" type="text""> |
|
60 |
<span>{{ task.name }}</span> |
|
61 |
</el-button> |
|
62 |
</template> |
|
63 |
</el-table-column> |
|
64 |
<el-table-column label="状态" align="center" prop="status"> |
|
65 |
<template v-slot="scope"> |
|
66 |
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" /> |
|
67 |
</template> |
|
68 |
</el-table-column> |
|
69 |
<el-table-column label="结果" align="center" prop="result"> |
|
70 |
<template v-slot="scope"> |
|
71 |
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/> |
|
72 |
</template> |
|
73 |
</el-table-column> |
|
74 |
<el-table-column label="提交时间" align="center" prop="createTime" width="180"> |
|
75 |
<template v-slot="scope"> |
|
76 |
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
77 |
</template> |
|
78 |
</el-table-column> |
|
79 |
<el-table-column label="结束时间" align="center" prop="createTime" width="180"> |
|
80 |
<template v-slot="scope"> |
|
81 |
<span>{{ parseTime(scope.row.endTime) }}</span> |
|
82 |
</template> |
|
83 |
</el-table-column> |
|
84 |
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
85 |
<template v-slot="scope"> |
|
86 |
<el-button type="text" size="small" icon="el-icon-delete" v-if="scope.row.result === 1" |
|
87 |
v-hasPermi="['bpm:process-instance:cancel']" @click="handleCancel(scope.row)">取消</el-button> |
|
88 |
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)" |
|
89 |
v-hasPermi="['bpm:process-instance:query']">详情</el-button> |
|
90 |
</template> |
|
91 |
</el-table-column> |
|
92 |
</el-table> |
|
93 |
<!-- 分页组件 --> |
|
94 |
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
|
95 |
@pagination="getList"/> |
|
96 |
|
|
97 |
</div> |
|
98 |
</template> |
|
99 |
|
|
100 |
<script> |
|
101 |
import { getMyProcessInstancePage, cancelProcessInstance } from "@/api/bpm/processInstance"; |
|
102 |
|
|
103 |
export default { |
|
104 |
name: "BpmProcessInstance", |
|
105 |
components: { |
|
106 |
}, |
|
107 |
data() { |
|
108 |
return { |
|
109 |
// 遮罩层 |
|
110 |
loading: true, |
|
111 |
// 显示搜索条件 |
|
112 |
showSearch: true, |
|
113 |
// 总条数 |
|
114 |
total: 0, |
|
115 |
// 工作流的流程实例的拓展列表 |
|
116 |
list: [], |
|
117 |
// 查询参数 |
|
118 |
queryParams: { |
|
119 |
pageNo: 1, |
|
120 |
pageSize: 10, |
|
121 |
name: null, |
|
122 |
processDefinitionId: null, |
|
123 |
category: null, |
|
124 |
status: null, |
|
125 |
result: null, |
|
126 |
createTime: [] |
|
127 |
} |
|
128 |
}; |
|
129 |
}, |
|
130 |
created() { |
|
131 |
this.getList(); |
|
132 |
}, |
|
133 |
activated() { |
|
134 |
this.getList(); |
|
135 |
}, |
|
136 |
methods: { |
|
137 |
/** 查询列表 */ |
|
138 |
getList() { |
|
139 |
this.loading = true; |
|
140 |
// 执行查询 |
|
141 |
getMyProcessInstancePage(this.queryParams).then(response => { |
|
142 |
this.list = response.data.list; |
|
143 |
this.total = response.data.total; |
|
144 |
this.loading = false; |
|
145 |
}); |
|
146 |
}, |
|
147 |
/** 搜索按钮操作 */ |
|
148 |
handleQuery() { |
|
149 |
this.queryParams.pageNo = 1; |
|
150 |
this.getList(); |
|
151 |
}, |
|
152 |
/** 重置按钮操作 */ |
|
153 |
resetQuery() { |
|
154 |
this.resetForm("queryForm"); |
|
155 |
this.handleQuery(); |
|
156 |
}, |
|
157 |
/** 新增按钮操作 **/ |
|
158 |
handleAdd() { |
|
159 |
this.$router.push({ name: "BpmProcessInstanceCreate"}) |
|
160 |
}, |
|
161 |
/** 取消按钮操作 */ |
|
162 |
handleCancel(row) { |
|
163 |
const id = row.id; |
|
164 |
this.$prompt('请输入取消原因?', "取消流程", { |
|
165 |
type: 'warning', |
|
166 |
confirmButtonText: "确定", |
|
167 |
cancelButtonText: "取消", |
|
168 |
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格 |
|
169 |
inputErrorMessage: "取消原因不能为空", |
|
170 |
}).then(({ value }) => { |
|
171 |
return cancelProcessInstance(id, value); |
|
172 |
}).then(() => { |
|
173 |
this.getList(); |
|
174 |
this.$modal.msgSuccess("取消成功"); |
|
175 |
}) |
|
176 |
}, |
|
177 |
/** 处理详情按钮 */ |
|
178 |
handleDetail(row) { |
|
179 |
this.$router.push({ name: "BpmProcessInstanceDetail", query: { id: row.id}}); |
|
180 |
}, |
|
181 |
} |
|
182 |
}; |
|
183 |
</script> |