@lambo-design/workflow-approve 1.0.0-beta.3 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/components/assignee-box.vue +351 -351
- package/src/components/history.vue +378 -508
- package/src/components/{attachment.vue → horizontal/attachment.vue} +224 -228
- package/src/components/horizontal/history.vue +464 -468
- package/src/components/horizontal/opinion.vue +263 -263
- package/src/components/opinion.vue +302 -389
- package/src/components/title.vue +24 -24
- package/src/horizontal.vue +1002 -1022
- package/src/portrait.vue +1036 -1191
- package/src/styles/css/index.less +221 -0
- package/src/workflow-diagram.vue +332 -373
package/src/workflow-diagram.vue
CHANGED
|
@@ -1,373 +1,332 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
|
|
4
|
-
<Collapse v-show="showChart" v-model="showDefaultExpand">
|
|
5
|
-
<Panel name="0">
|
|
6
|
-
流程跟踪图
|
|
7
|
-
<div slot="content">
|
|
8
|
-
<div class="containers" :style="'height: '+canvasHeight+ 'px'">
|
|
9
|
-
<div class="canvas" ref="canvas"></div>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</Panel>
|
|
13
|
-
</Collapse>
|
|
14
|
-
|
|
15
|
-
<Collapse v-show="showTable" v-model="showDefaultExpand">
|
|
16
|
-
<Panel name="1">
|
|
17
|
-
{{ tableName }}
|
|
18
|
-
<div slot="content">
|
|
19
|
-
<EditTable :columns="tableColumns" v-model="hisAudit" :show-table-option="false">
|
|
20
|
-
</EditTable>
|
|
21
|
-
</div>
|
|
22
|
-
</Panel>
|
|
23
|
-
</Collapse>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<Modal v-model="showDetail" :width="modelWidth" :footer-hide='true' title="审批详情">
|
|
27
|
-
<Card v-for="(item,index) in detailDones" :key="index" style="margin-bottom: 10px">
|
|
28
|
-
<Form :model="item" :label-width="140" class="compactForm">
|
|
29
|
-
<Row>
|
|
30
|
-
<i-col span="12" offset="0">
|
|
31
|
-
<FormItem label="审批节点:">
|
|
32
|
-
{{ item.taskName }}
|
|
33
|
-
</FormItem>
|
|
34
|
-
</i-col>
|
|
35
|
-
<i-col span="12" offset="0">
|
|
36
|
-
<FormItem label="审批人:">
|
|
37
|
-
<Tooltip placement="bottom-end">
|
|
38
|
-
<span class="tooltip-text">{{ item.auditName }}</span>
|
|
39
|
-
<div slot="content" style="white-space: normal;">
|
|
40
|
-
{{ item.auditName }}
|
|
41
|
-
</div>
|
|
42
|
-
</Tooltip>
|
|
43
|
-
|
|
44
|
-
</FormItem>
|
|
45
|
-
</i-col>
|
|
46
|
-
|
|
47
|
-
</Row>
|
|
48
|
-
<Row>
|
|
49
|
-
<i-col span="12" offset="0">
|
|
50
|
-
<FormItem label="审批结果:">
|
|
51
|
-
<Tag color="success" v-if="item.auditResult == '30'">通过</Tag>
|
|
52
|
-
<Tag color="error" v-else-if="item.auditResult == '40'">驳回到上一节点</Tag>
|
|
53
|
-
<Tag color="error" v-else-if="item.auditResult=='50'">驳回到原点</Tag>
|
|
54
|
-
<Tag color="error" v-else-if="item.auditResult=='51'">流程终止</Tag>
|
|
55
|
-
<Tag color="error" v-else-if="item.auditResult == '60'">撤回</Tag>
|
|
56
|
-
<Tag color="success" v-else-if="item.auditResult == '80'">跳转到指定节点</Tag>
|
|
57
|
-
<Tag color="success" v-else-if="item.auditResult == '90'">驳回到指定节点</Tag>
|
|
58
|
-
<Tag color="success" v-else>待审核</Tag>
|
|
59
|
-
</FormItem>
|
|
60
|
-
</i-col>
|
|
61
|
-
<i-col span="12" offset="0">
|
|
62
|
-
<FormItem v-if="item.startDate" label="发起时间:">
|
|
63
|
-
{{ item.startDate }}
|
|
64
|
-
</FormItem>
|
|
65
|
-
<FormItem v-else label="审批时间:">
|
|
66
|
-
{{ item.auditDate }}
|
|
67
|
-
</FormItem>
|
|
68
|
-
</i-col>
|
|
69
|
-
</Row>
|
|
70
|
-
<Row>
|
|
71
|
-
<i-col span="24" offset="0">
|
|
72
|
-
<FormItem v-if="item.auditComment" label="审批意见:">
|
|
73
|
-
{{ item.auditComment }}
|
|
74
|
-
</FormItem>
|
|
75
|
-
</i-col>
|
|
76
|
-
</Row>
|
|
77
|
-
</Form>
|
|
78
|
-
</Card>
|
|
79
|
-
</Modal>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
84
|
-
|
|
85
|
-
<script>
|
|
86
|
-
import ajax from "@lambo-design/shared/utils/ajax";
|
|
87
|
-
import zoomScroll from "@lambo-design/shared/utils/zoomScroll";
|
|
88
|
-
import BpmnViewer from "bpmn-js/lib/Viewer";
|
|
89
|
-
import ModelingModule from 'bpmn-js/lib/features/modeling';
|
|
90
|
-
import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
|
|
91
|
-
import EditTable from "@lambo-design/edit-table";
|
|
92
|
-
|
|
93
|
-
export default {
|
|
94
|
-
components: {
|
|
95
|
-
EditTable
|
|
96
|
-
},
|
|
97
|
-
props: {
|
|
98
|
-
canvasHeight: {
|
|
99
|
-
type: Number,
|
|
100
|
-
default: 350
|
|
101
|
-
},
|
|
102
|
-
modelWidth: {
|
|
103
|
-
type: Number,
|
|
104
|
-
default: 693
|
|
105
|
-
},
|
|
106
|
-
modelTitle: {
|
|
107
|
-
type: String,
|
|
108
|
-
default: "审批详情"
|
|
109
|
-
},
|
|
110
|
-
showChart: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: true
|
|
113
|
-
},
|
|
114
|
-
showTable: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: true
|
|
117
|
-
},
|
|
118
|
-
tableName: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: "审批流程跟踪"
|
|
121
|
-
},
|
|
122
|
-
tableColumns: {
|
|
123
|
-
type: Array,
|
|
124
|
-
default: () => {
|
|
125
|
-
return [
|
|
126
|
-
{title: '序号', type: 'index', width: 80},
|
|
127
|
-
{title: '审批节点', key: 'taskName', minWidth: 130},
|
|
128
|
-
{title: '办理人', key: 'auditName', minWidth: 180, tooltip: true},
|
|
129
|
-
{
|
|
130
|
-
title: '审批结果', key: 'auditResult', minWidth: 100,
|
|
131
|
-
render: (h, {row, column, index}) => {
|
|
132
|
-
let label = "";
|
|
133
|
-
if (row.auditResult == '30') label = '通过';
|
|
134
|
-
else if (row.auditResult == '40') label = '驳回到上一级';
|
|
135
|
-
else if (row.auditResult == '50') label = '驳回到原点';
|
|
136
|
-
else if (row.auditResult == '51') label = '流程终止';
|
|
137
|
-
else if (row.auditResult == '60') label = '撤回';
|
|
138
|
-
else if (row.auditResult == '80') label = '跳转到指定节点';
|
|
139
|
-
else if (row.auditResult == '90') label = '驳回到指定节点';
|
|
140
|
-
else label = '待审核';
|
|
141
|
-
return h('Label', {
|
|
142
|
-
props: {
|
|
143
|
-
value: row.auditResult
|
|
144
|
-
}
|
|
145
|
-
}, label)
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
title: '审批时间', key: 'auditTime', minWidth: 150,
|
|
150
|
-
render: (h, {row}) => {
|
|
151
|
-
const displayDate = row.startDate || row.auditDate;
|
|
152
|
-
return h('span', displayDate);
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
title: '审批意见', key: 'auditComment', minWidth: 180, tooltip: true,
|
|
157
|
-
render: (h, {row, column, index}) => {
|
|
158
|
-
let label = "";
|
|
159
|
-
if (row.auditComment == '' || row.auditComment == null) label = '无';
|
|
160
|
-
else label = row.auditComment;
|
|
161
|
-
return h('Label', {
|
|
162
|
-
props: {
|
|
163
|
-
value: row.auditComment
|
|
164
|
-
}
|
|
165
|
-
}, label)
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
];
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
hisAudit: {
|
|
172
|
-
type: Array,
|
|
173
|
-
default: () => {
|
|
174
|
-
return []
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
tableData: {
|
|
178
|
-
type: Array,
|
|
179
|
-
default: () => {
|
|
180
|
-
return []
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
applyId: {
|
|
184
|
-
type: String,
|
|
185
|
-
default: ""
|
|
186
|
-
},
|
|
187
|
-
instanceId: {
|
|
188
|
-
type: String,
|
|
189
|
-
default: ""
|
|
190
|
-
},
|
|
191
|
-
procId: {
|
|
192
|
-
type: String,
|
|
193
|
-
default: ""
|
|
194
|
-
},
|
|
195
|
-
smartFlowServerContext: {
|
|
196
|
-
type: String,
|
|
197
|
-
default: '/api/smart-flow-server',
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
data() {
|
|
201
|
-
return {
|
|
202
|
-
detailDones: [],
|
|
203
|
-
showDetail: false,
|
|
204
|
-
showDefaultExpand: this.getShowDefaultExpand(),
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
computed: {},
|
|
208
|
-
methods: {
|
|
209
|
-
getShowDefaultExpand() {
|
|
210
|
-
let expand = [];
|
|
211
|
-
if (this.showChart) {
|
|
212
|
-
expand.push('0');
|
|
213
|
-
}
|
|
214
|
-
if (this.showTable) {
|
|
215
|
-
expand.push('1');
|
|
216
|
-
}
|
|
217
|
-
return expand;
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
//画流程图
|
|
221
|
-
workflowInit() {
|
|
222
|
-
const canvas = this.$refs.canvas;
|
|
223
|
-
// this.bpmnViewer.destroy();
|
|
224
|
-
// if (this.bpmnViewer) return
|
|
225
|
-
if (this.bpmnViewer){
|
|
226
|
-
this.bpmnViewer.destroy()
|
|
227
|
-
}
|
|
228
|
-
this.bpmnViewer = new BpmnViewer({
|
|
229
|
-
container: canvas,
|
|
230
|
-
additionalModules: [
|
|
231
|
-
// MoveModule, // 可以调整元素
|
|
232
|
-
ModelingModule, // 基础工具 MoveModule、SetColor 等依赖于此
|
|
233
|
-
MoveCanvasModule, // 移动整个画布
|
|
234
|
-
zoomScroll // 放大缩小
|
|
235
|
-
]
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
ajax.get(this.smartFlowServerContext + "/manage/processTodo/printData", {
|
|
239
|
-
params: {
|
|
240
|
-
applyId: this.applyId,
|
|
241
|
-
instanceId: this.instanceId,
|
|
242
|
-
procId: this.procId
|
|
243
|
-
}
|
|
244
|
-
}).then(resp => {
|
|
245
|
-
if (resp.data.code == '200') {
|
|
246
|
-
const bpmnXmlStr = resp.data.data.processXml;
|
|
247
|
-
this.bpmnViewer.importXML(bpmnXmlStr);
|
|
248
|
-
setTimeout(() => {
|
|
249
|
-
const printData = resp.data.data.historicData;
|
|
250
|
-
this.doPrint(printData);
|
|
251
|
-
}, 700);
|
|
252
|
-
} else {
|
|
253
|
-
this.$Message.error("加载流程xml失败," + resp.data.data);
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
},
|
|
257
|
-
doPrint(printData) {
|
|
258
|
-
var self = this;
|
|
259
|
-
const {doneLightSet, donePointSet, doneTaskSet, todoPointSet} =
|
|
260
|
-
printData;
|
|
261
|
-
const canvas = this.bpmnViewer.get("canvas");
|
|
262
|
-
const elementRegistry = this.bpmnViewer.get('elementRegistry');
|
|
263
|
-
const userTaskList = elementRegistry.filter(
|
|
264
|
-
(item) => item.type === 'bpmn:UserTask'
|
|
265
|
-
);
|
|
266
|
-
//循环节点查找multiple
|
|
267
|
-
self.notMultiple = true;
|
|
268
|
-
canvas.zoom("fit-viewport", "auto");
|
|
269
|
-
var eventBus = this.bpmnViewer.get("eventBus");
|
|
270
|
-
var dones = this.tableData;
|
|
271
|
-
eventBus.on('element.click', function (evt) {
|
|
272
|
-
self.detailDones = [];
|
|
273
|
-
for (var item of dones) {
|
|
274
|
-
if (item.taskNode == evt.element.id) {
|
|
275
|
-
self.detailDones.push(item);
|
|
276
|
-
self.showDetail = true;
|
|
277
|
-
self.$emit("showTaskNode", item);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
for (var k in doneLightSet) {
|
|
284
|
-
if (doneLightSet[k]) {
|
|
285
|
-
canvas.addMarker(doneLightSet[k], "done-line");
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
for (var k in donePointSet) {
|
|
289
|
-
if (donePointSet[k]) {
|
|
290
|
-
canvas.addMarker(donePointSet[k], "done-point");
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
for (var k in doneTaskSet) {
|
|
294
|
-
if (doneTaskSet[k]) {
|
|
295
|
-
canvas.addMarker(doneTaskSet[k], "done-task");
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
for (var k in todoPointSet) {
|
|
299
|
-
if (todoPointSet[k]) {
|
|
300
|
-
canvas.addMarker(todoPointSet[k], "todo-point");
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
// 校验必填
|
|
306
|
-
isNotBlank(val) {
|
|
307
|
-
return (val != null || val === 0) && (val.toString().trim() != '' || val === 0)
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
mounted() {
|
|
311
|
-
if (this.isNotBlank(this.applyId)) {
|
|
312
|
-
this.workflowInit();
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
watch: {
|
|
316
|
-
applyId(val) {
|
|
317
|
-
if (this.isNotBlank(val)) {
|
|
318
|
-
this.workflowInit();
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
instanceId(val) {
|
|
322
|
-
if (this.isNotBlank(this.applyId) && this.isNotBlank(val)) {
|
|
323
|
-
this.workflowInit();
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
</script>
|
|
329
|
-
|
|
330
|
-
<style lang="less">
|
|
331
|
-
.
|
|
332
|
-
|
|
333
|
-
background-color: #ffffff;
|
|
334
|
-
width: 100%;
|
|
335
|
-
|
|
336
|
-
.done-line .djs-visual > :nth-child(1) {
|
|
337
|
-
stroke: rgb(218, 246, 209) !important;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.done-point .djs-visual > :nth-child(1) {
|
|
341
|
-
// stroke: rgb(218, 246, 209) !important;
|
|
342
|
-
fill: rgb(218, 246, 209) !important;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.done-task .djs-visual > :nth-child(1) {
|
|
346
|
-
// stroke: rgb(218, 246, 209) !important;
|
|
347
|
-
fill: rgb(218, 246, 209) !important;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.todo-point .djs-visual > :nth-child(1) {
|
|
351
|
-
// stroke: rgba(258,227,180) !important;
|
|
352
|
-
fill: rgb(258, 227, 180) !important;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.bjs-powered-by {
|
|
356
|
-
display: none;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.canvas {
|
|
361
|
-
width: 100%;
|
|
362
|
-
height: 100%;
|
|
363
|
-
margin-top: 0%;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.tooltip-text {
|
|
367
|
-
overflow: hidden;
|
|
368
|
-
text-overflow: ellipsis;
|
|
369
|
-
white-space: nowrap;
|
|
370
|
-
display: inline-block;
|
|
371
|
-
max-width: 130px; /* 限制文本宽度 */
|
|
372
|
-
}
|
|
373
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
|
|
4
|
+
<Collapse v-show="showChart" v-model="showDefaultExpand">
|
|
5
|
+
<Panel name="0">
|
|
6
|
+
流程跟踪图
|
|
7
|
+
<div slot="content">
|
|
8
|
+
<div class="containers" :style="'height: '+canvasHeight+ 'px'">
|
|
9
|
+
<div class="canvas" ref="canvas"></div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</Panel>
|
|
13
|
+
</Collapse>
|
|
14
|
+
|
|
15
|
+
<Collapse v-show="showTable" v-model="showDefaultExpand">
|
|
16
|
+
<Panel name="1">
|
|
17
|
+
{{ tableName }}
|
|
18
|
+
<div slot="content">
|
|
19
|
+
<EditTable :columns="tableColumns" v-model="hisAudit" :show-table-option="false">
|
|
20
|
+
</EditTable>
|
|
21
|
+
</div>
|
|
22
|
+
</Panel>
|
|
23
|
+
</Collapse>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<Modal v-model="showDetail" :width="modelWidth" :footer-hide='true' title="审批详情">
|
|
27
|
+
<Card v-for="(item,index) in detailDones" :key="index" style="margin-bottom: 10px">
|
|
28
|
+
<Form :model="item" :label-width="140" class="compactForm">
|
|
29
|
+
<Row>
|
|
30
|
+
<i-col span="12" offset="0">
|
|
31
|
+
<FormItem label="审批节点:">
|
|
32
|
+
{{ item.taskName }}
|
|
33
|
+
</FormItem>
|
|
34
|
+
</i-col>
|
|
35
|
+
<i-col span="12" offset="0">
|
|
36
|
+
<FormItem label="审批人:">
|
|
37
|
+
<Tooltip placement="bottom-end">
|
|
38
|
+
<span class="tooltip-text">{{ item.auditName }}</span>
|
|
39
|
+
<div slot="content" style="white-space: normal;">
|
|
40
|
+
{{ item.auditName }}
|
|
41
|
+
</div>
|
|
42
|
+
</Tooltip>
|
|
43
|
+
|
|
44
|
+
</FormItem>
|
|
45
|
+
</i-col>
|
|
46
|
+
|
|
47
|
+
</Row>
|
|
48
|
+
<Row>
|
|
49
|
+
<i-col span="12" offset="0">
|
|
50
|
+
<FormItem label="审批结果:">
|
|
51
|
+
<Tag color="success" v-if="item.auditResult == '30'">通过</Tag>
|
|
52
|
+
<Tag color="error" v-else-if="item.auditResult == '40'">驳回到上一节点</Tag>
|
|
53
|
+
<Tag color="error" v-else-if="item.auditResult=='50'">驳回到原点</Tag>
|
|
54
|
+
<Tag color="error" v-else-if="item.auditResult=='51'">流程终止</Tag>
|
|
55
|
+
<Tag color="error" v-else-if="item.auditResult == '60'">撤回</Tag>
|
|
56
|
+
<Tag color="success" v-else-if="item.auditResult == '80'">跳转到指定节点</Tag>
|
|
57
|
+
<Tag color="success" v-else-if="item.auditResult == '90'">驳回到指定节点</Tag>
|
|
58
|
+
<Tag color="success" v-else>待审核</Tag>
|
|
59
|
+
</FormItem>
|
|
60
|
+
</i-col>
|
|
61
|
+
<i-col span="12" offset="0">
|
|
62
|
+
<FormItem v-if="item.startDate" label="发起时间:">
|
|
63
|
+
{{ item.startDate }}
|
|
64
|
+
</FormItem>
|
|
65
|
+
<FormItem v-else label="审批时间:">
|
|
66
|
+
{{ item.auditDate }}
|
|
67
|
+
</FormItem>
|
|
68
|
+
</i-col>
|
|
69
|
+
</Row>
|
|
70
|
+
<Row>
|
|
71
|
+
<i-col span="24" offset="0">
|
|
72
|
+
<FormItem v-if="item.auditComment" label="审批意见:">
|
|
73
|
+
{{ item.auditComment }}
|
|
74
|
+
</FormItem>
|
|
75
|
+
</i-col>
|
|
76
|
+
</Row>
|
|
77
|
+
</Form>
|
|
78
|
+
</Card>
|
|
79
|
+
</Modal>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script>
|
|
86
|
+
import ajax from "@lambo-design/shared/utils/ajax";
|
|
87
|
+
import zoomScroll from "@lambo-design/shared/utils/zoomScroll";
|
|
88
|
+
import BpmnViewer from "bpmn-js/lib/Viewer";
|
|
89
|
+
import ModelingModule from 'bpmn-js/lib/features/modeling';
|
|
90
|
+
import MoveCanvasModule from 'diagram-js/lib/navigation/movecanvas';
|
|
91
|
+
import EditTable from "@lambo-design/edit-table";
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
components: {
|
|
95
|
+
EditTable
|
|
96
|
+
},
|
|
97
|
+
props: {
|
|
98
|
+
canvasHeight: {
|
|
99
|
+
type: Number,
|
|
100
|
+
default: 350
|
|
101
|
+
},
|
|
102
|
+
modelWidth: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 693
|
|
105
|
+
},
|
|
106
|
+
modelTitle: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: "审批详情"
|
|
109
|
+
},
|
|
110
|
+
showChart: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: true
|
|
113
|
+
},
|
|
114
|
+
showTable: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: true
|
|
117
|
+
},
|
|
118
|
+
tableName: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: "审批流程跟踪"
|
|
121
|
+
},
|
|
122
|
+
tableColumns: {
|
|
123
|
+
type: Array,
|
|
124
|
+
default: () => {
|
|
125
|
+
return [
|
|
126
|
+
{title: '序号', type: 'index', width: 80},
|
|
127
|
+
{title: '审批节点', key: 'taskName', minWidth: 130},
|
|
128
|
+
{title: '办理人', key: 'auditName', minWidth: 180, tooltip: true},
|
|
129
|
+
{
|
|
130
|
+
title: '审批结果', key: 'auditResult', minWidth: 100,
|
|
131
|
+
render: (h, {row, column, index}) => {
|
|
132
|
+
let label = "";
|
|
133
|
+
if (row.auditResult == '30') label = '通过';
|
|
134
|
+
else if (row.auditResult == '40') label = '驳回到上一级';
|
|
135
|
+
else if (row.auditResult == '50') label = '驳回到原点';
|
|
136
|
+
else if (row.auditResult == '51') label = '流程终止';
|
|
137
|
+
else if (row.auditResult == '60') label = '撤回';
|
|
138
|
+
else if (row.auditResult == '80') label = '跳转到指定节点';
|
|
139
|
+
else if (row.auditResult == '90') label = '驳回到指定节点';
|
|
140
|
+
else label = '待审核';
|
|
141
|
+
return h('Label', {
|
|
142
|
+
props: {
|
|
143
|
+
value: row.auditResult
|
|
144
|
+
}
|
|
145
|
+
}, label)
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: '审批时间', key: 'auditTime', minWidth: 150,
|
|
150
|
+
render: (h, {row}) => {
|
|
151
|
+
const displayDate = row.startDate || row.auditDate;
|
|
152
|
+
return h('span', displayDate);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: '审批意见', key: 'auditComment', minWidth: 180, tooltip: true,
|
|
157
|
+
render: (h, {row, column, index}) => {
|
|
158
|
+
let label = "";
|
|
159
|
+
if (row.auditComment == '' || row.auditComment == null) label = '无';
|
|
160
|
+
else label = row.auditComment;
|
|
161
|
+
return h('Label', {
|
|
162
|
+
props: {
|
|
163
|
+
value: row.auditComment
|
|
164
|
+
}
|
|
165
|
+
}, label)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
hisAudit: {
|
|
172
|
+
type: Array,
|
|
173
|
+
default: () => {
|
|
174
|
+
return []
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
tableData: {
|
|
178
|
+
type: Array,
|
|
179
|
+
default: () => {
|
|
180
|
+
return []
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
applyId: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: ""
|
|
186
|
+
},
|
|
187
|
+
instanceId: {
|
|
188
|
+
type: String,
|
|
189
|
+
default: ""
|
|
190
|
+
},
|
|
191
|
+
procId: {
|
|
192
|
+
type: String,
|
|
193
|
+
default: ""
|
|
194
|
+
},
|
|
195
|
+
smartFlowServerContext: {
|
|
196
|
+
type: String,
|
|
197
|
+
default: '/api/smart-flow-server',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
data() {
|
|
201
|
+
return {
|
|
202
|
+
detailDones: [],
|
|
203
|
+
showDetail: false,
|
|
204
|
+
showDefaultExpand: this.getShowDefaultExpand(),
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
computed: {},
|
|
208
|
+
methods: {
|
|
209
|
+
getShowDefaultExpand() {
|
|
210
|
+
let expand = [];
|
|
211
|
+
if (this.showChart) {
|
|
212
|
+
expand.push('0');
|
|
213
|
+
}
|
|
214
|
+
if (this.showTable) {
|
|
215
|
+
expand.push('1');
|
|
216
|
+
}
|
|
217
|
+
return expand;
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
//画流程图
|
|
221
|
+
workflowInit() {
|
|
222
|
+
const canvas = this.$refs.canvas;
|
|
223
|
+
// this.bpmnViewer.destroy();
|
|
224
|
+
// if (this.bpmnViewer) return
|
|
225
|
+
if (this.bpmnViewer){
|
|
226
|
+
this.bpmnViewer.destroy()
|
|
227
|
+
}
|
|
228
|
+
this.bpmnViewer = new BpmnViewer({
|
|
229
|
+
container: canvas,
|
|
230
|
+
additionalModules: [
|
|
231
|
+
// MoveModule, // 可以调整元素
|
|
232
|
+
ModelingModule, // 基础工具 MoveModule、SetColor 等依赖于此
|
|
233
|
+
MoveCanvasModule, // 移动整个画布
|
|
234
|
+
zoomScroll // 放大缩小
|
|
235
|
+
]
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
ajax.get(this.smartFlowServerContext + "/manage/processTodo/printData", {
|
|
239
|
+
params: {
|
|
240
|
+
applyId: this.applyId,
|
|
241
|
+
instanceId: this.instanceId,
|
|
242
|
+
procId: this.procId
|
|
243
|
+
}
|
|
244
|
+
}).then(resp => {
|
|
245
|
+
if (resp.data.code == '200') {
|
|
246
|
+
const bpmnXmlStr = resp.data.data.processXml;
|
|
247
|
+
this.bpmnViewer.importXML(bpmnXmlStr);
|
|
248
|
+
setTimeout(() => {
|
|
249
|
+
const printData = resp.data.data.historicData;
|
|
250
|
+
this.doPrint(printData);
|
|
251
|
+
}, 700);
|
|
252
|
+
} else {
|
|
253
|
+
this.$Message.error("加载流程xml失败," + resp.data.data);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
doPrint(printData) {
|
|
258
|
+
var self = this;
|
|
259
|
+
const {doneLightSet, donePointSet, doneTaskSet, todoPointSet} =
|
|
260
|
+
printData;
|
|
261
|
+
const canvas = this.bpmnViewer.get("canvas");
|
|
262
|
+
const elementRegistry = this.bpmnViewer.get('elementRegistry');
|
|
263
|
+
const userTaskList = elementRegistry.filter(
|
|
264
|
+
(item) => item.type === 'bpmn:UserTask'
|
|
265
|
+
);
|
|
266
|
+
//循环节点查找multiple
|
|
267
|
+
self.notMultiple = true;
|
|
268
|
+
canvas.zoom("fit-viewport", "auto");
|
|
269
|
+
var eventBus = this.bpmnViewer.get("eventBus");
|
|
270
|
+
var dones = this.tableData;
|
|
271
|
+
eventBus.on('element.click', function (evt) {
|
|
272
|
+
self.detailDones = [];
|
|
273
|
+
for (var item of dones) {
|
|
274
|
+
if (item.taskNode == evt.element.id) {
|
|
275
|
+
self.detailDones.push(item);
|
|
276
|
+
self.showDetail = true;
|
|
277
|
+
self.$emit("showTaskNode", item);
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
for (var k in doneLightSet) {
|
|
284
|
+
if (doneLightSet[k]) {
|
|
285
|
+
canvas.addMarker(doneLightSet[k], "done-line");
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
for (var k in donePointSet) {
|
|
289
|
+
if (donePointSet[k]) {
|
|
290
|
+
canvas.addMarker(donePointSet[k], "done-point");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
for (var k in doneTaskSet) {
|
|
294
|
+
if (doneTaskSet[k]) {
|
|
295
|
+
canvas.addMarker(doneTaskSet[k], "done-task");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
for (var k in todoPointSet) {
|
|
299
|
+
if (todoPointSet[k]) {
|
|
300
|
+
canvas.addMarker(todoPointSet[k], "todo-point");
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
},
|
|
305
|
+
// 校验必填
|
|
306
|
+
isNotBlank(val) {
|
|
307
|
+
return (val != null || val === 0) && (val.toString().trim() != '' || val === 0)
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
mounted() {
|
|
311
|
+
if (this.isNotBlank(this.applyId)) {
|
|
312
|
+
this.workflowInit();
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
watch: {
|
|
316
|
+
applyId(val) {
|
|
317
|
+
if (this.isNotBlank(val)) {
|
|
318
|
+
this.workflowInit();
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
instanceId(val) {
|
|
322
|
+
if (this.isNotBlank(this.applyId) && this.isNotBlank(val)) {
|
|
323
|
+
this.workflowInit();
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
</script>
|
|
329
|
+
|
|
330
|
+
<style lang="less">
|
|
331
|
+
@import "./styles/css/index.less";
|
|
332
|
+
</style>
|