ui-process-h5 2.0.7-beta → 2.1.0-beta

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.
Files changed (91) hide show
  1. package/README.md +11 -204
  2. package/build/configure/README.md +211 -0
  3. package/build/configure/package.json +32 -0
  4. package/debug.js +9 -0
  5. package/index.html +12 -0
  6. package/package.json +56 -25
  7. package/src/App.vue +233 -0
  8. package/src/assets/font-icon/iconfont.scss +57 -0
  9. package/src/assets/font-icon/iconfont.ttf +0 -0
  10. package/src/assets/img/add-file.png +0 -0
  11. package/src/assets/img/arrow-right.png +0 -0
  12. package/src/assets/img/arrow.png +0 -0
  13. package/src/assets/img/check.png +0 -0
  14. package/src/assets/img/del.png +0 -0
  15. package/src/assets/img/doc.png +0 -0
  16. package/src/assets/img/file.png +0 -0
  17. package/src/assets/img/image.png +0 -0
  18. package/src/assets/img/pdf.png +0 -0
  19. package/src/assets/img/process.png +0 -0
  20. package/src/assets/img/xls.png +0 -0
  21. package/src/assets/img/zip.png +0 -0
  22. package/src/assets/js/auth.js +65 -0
  23. package/src/assets/js/errorCode.js +6 -0
  24. package/src/assets/js/message.js +352 -0
  25. package/src/assets/js/request.js +99 -0
  26. package/src/assets/js/toast.js +239 -0
  27. package/src/assets/js/top.js +229 -0
  28. package/src/assets/js/utils.js +83 -0
  29. package/src/assets/js/vuePopper.js +123 -0
  30. package/src/assets/query.png +0 -0
  31. package/src/assets/status/check.png +0 -0
  32. package/src/assets/status/del.png +0 -0
  33. package/src/assets/status/error.png +0 -0
  34. package/src/assets/status/loading.png +0 -0
  35. package/src/assets/status/success.png +0 -0
  36. package/src/main.js +17 -0
  37. package/src/packages/attchUpload/index.js +375 -0
  38. package/src/packages/attchUpload/index.scss +143 -0
  39. package/src/packages/attchUpload/index.vue +173 -0
  40. package/src/packages/downSelect/index.js +119 -0
  41. package/src/packages/downSelect/index.scss +88 -0
  42. package/src/packages/downSelect/index.vue +62 -0
  43. package/src/packages/index.js +6 -0
  44. package/src/packages/popup/index.js +125 -0
  45. package/src/packages/popup/index.scss +178 -0
  46. package/src/packages/popup/index.vue +80 -0
  47. package/src/packages/preview/index.js +40 -0
  48. package/src/packages/preview/index.vue +15 -0
  49. package/src/packages/previewImage/index.js +286 -0
  50. package/src/packages/previewImage/index.scss +76 -0
  51. package/src/packages/previewImage/index.vue +53 -0
  52. package/src/packages/process/index.js +1016 -0
  53. package/src/packages/process/index.scss +188 -0
  54. package/src/packages/process/index.vue +291 -0
  55. package/src/packages/process/operation/backNode.vue +396 -0
  56. package/src/packages/process/operation/cancel.vue +425 -0
  57. package/src/packages/process/operation/ccTask.vue +256 -0
  58. package/src/packages/process/operation/complete.vue +1384 -0
  59. package/src/packages/process/operation/counterSign.vue +498 -0
  60. package/src/packages/process/operation/delegateTask.vue +493 -0
  61. package/src/packages/process/operation/index.js +8 -0
  62. package/src/packages/process/operation/index.scss +212 -0
  63. package/src/packages/process/operation/msgList.vue +174 -0
  64. package/src/packages/process/operation/treeNode.vue +901 -0
  65. package/src/packages/process/operation/treePerson.vue +304 -0
  66. package/src/packages/submitPopup/index.js +708 -0
  67. package/src/packages/submitPopup/index.scss +190 -0
  68. package/src/packages/submitPopup/index.vue +125 -0
  69. package/src/packages/tab/index.js +236 -0
  70. package/src/packages/tab/index.scss +177 -0
  71. package/src/packages/tab/index.vue +155 -0
  72. package/src/packages/tip/index.js +80 -0
  73. package/src/packages/tip/index.scss +121 -0
  74. package/src/packages/tip/index.vue +57 -0
  75. package/src/packages/viewAttchList/index.js +138 -0
  76. package/src/packages/viewAttchList/index.scss +76 -0
  77. package/src/packages/viewAttchList/index.vue +121 -0
  78. package/src/style.css +80 -0
  79. package/vite.config.ts +118 -0
  80. package/v2/style.css +0 -1
  81. package/v2/ui-process-h5.js +0 -9945
  82. package/v2/ui-process-h5.umd.cjs +0 -18
  83. package/v2.7/style.css +0 -1
  84. package/v2.7/ui-process-h5.js +0 -9322
  85. package/v2.7/ui-process-h5.umd.cjs +0 -18
  86. package/v3/style.css +0 -1
  87. package/v3/ui-process-h5.js +0 -6842
  88. package/v3/ui-process-h5.umd.cjs +0 -6
  89. /package/{scripts → build/scripts}/postinstall.mjs +0 -0
  90. /package/{scripts → build/scripts}/switch-cli.mjs +0 -0
  91. /package/{scripts → build/scripts}/utils.mjs +0 -0
@@ -0,0 +1,1016 @@
1
+ import TopTab from "../tab/index.vue";
2
+ import TopPopup from "../popup/index.vue";
3
+ import TopTips from "../tip/index.vue";
4
+ import TopSumbitPopup from "../submitPopup/index.vue";
5
+ import * as operation from "./operation";
6
+ import { defineComponent } from "vue-demi";
7
+ import 'checked-pick-app/style.css'
8
+
9
+ export default defineComponent({
10
+ name: "TopProcess",
11
+ components: {
12
+ TopTab,
13
+ TopPopup,
14
+ TopTips,
15
+ TopSumbitPopup,
16
+ },
17
+ props: {
18
+ // tab控制
19
+ tapList: { require: false, default: () => [], type: Array },
20
+ // 自定义tab
21
+ selfTapList: { require: false, default: () => [], type: Array },
22
+ // 流程id
23
+ processDefId: { require: true, default: "", type: String },
24
+ processInstId: { require: true, default: "", type: String },
25
+ isAdditional: { require: false, default: false, type: Boolean },
26
+ isView: { default: false, type: Boolean },
27
+ // 表单信息
28
+ formData: { default: {}, type: Object },
29
+
30
+ // 弹窗开启前执行方法
31
+ getVarsStatus: { default: true, type: Boolean },
32
+ getVars: { default: null, type: Function },
33
+
34
+ // 请求
35
+ request: {
36
+ type: [Function, Object],
37
+ default: () => {
38
+ return { get: () => { }, post: () => { } };
39
+ },
40
+ },
41
+
42
+ // 结束执行事件
43
+ endFunction: {
44
+ type: Function,
45
+ default: null,
46
+ },
47
+ // 弹窗开启前触发
48
+ beforeFunction: {
49
+ type: Function,
50
+ default: null,
51
+ },
52
+ // 是否开启公文独立配置
53
+ isDocument: {
54
+ type: Boolean,
55
+ default: false,
56
+ },
57
+ // 送审参数
58
+ restartData: {
59
+ type: Object,
60
+ default: {
61
+ businessType: "",
62
+ showType: "",
63
+ processName: "",
64
+ },
65
+ },
66
+ selfList: {
67
+ type: Array,
68
+ default: () => [],
69
+ },
70
+ selfBtn: {
71
+ type: Array,
72
+ default: () => [],
73
+ },
74
+
75
+ // 炎黄userId this.user.
76
+ uid: {
77
+ type: String,
78
+ default: "",
79
+ },
80
+
81
+ // is Msg
82
+ isMsg: {
83
+ type: Boolean,
84
+ default: true,
85
+ },
86
+ // is Require
87
+ isRequire: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
91
+ // isCheckType
92
+ isCheckType: {
93
+ type: String,
94
+ default: "0",
95
+ },
96
+ //isorgType
97
+ isOrgType: {
98
+ type: Array,
99
+ default: () => [0],
100
+ },
101
+ isCodeType: {
102
+ type: Array,
103
+ default: () => [3],
104
+ },
105
+ isQuickReply: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+
110
+ // 抄送自定义事件
111
+ ccTaskFunction: {
112
+ type: Function,
113
+ default: null,
114
+ },
115
+
116
+ hideHeader:{
117
+ type: Boolean,
118
+ default: false
119
+ }
120
+ },
121
+ data() {
122
+ return {
123
+ processStatus: {},
124
+ processDefList: {},
125
+ processBusiness: {},
126
+ getFirstProcessNode: {},
127
+ // 底部按钮
128
+ taskNode: [],
129
+ taskNodeList: [],
130
+ taskNodeIds: [],
131
+ taskState: NaN,
132
+ taskCurrent: 0,
133
+ taskObj: {},
134
+ taskId: "",
135
+ taskNodeShow: false,
136
+ //额外按钮
137
+ actionShow: false,
138
+ // 弹窗标题
139
+ titleText: "",
140
+ btnStyle: "",
141
+ processIntId: "",
142
+ // 流程图
143
+ trackUrl: "",
144
+ // 审批记录
145
+ taskCommentList: [],
146
+ // 节点dom
147
+ operationCom: null,
148
+ // 流程实例对象
149
+ ProcessInsObj: {},
150
+
151
+ // 确认弹窗文本
152
+ popupContext: "",
153
+ // 弹窗数据
154
+ operationParam: {},
155
+
156
+ nextTaskNode: {},
157
+
158
+ //附件信息
159
+ annexlabel: "",
160
+
161
+ // 小弹窗处理逻辑类型
162
+ handleTipsType: "",
163
+
164
+ /* tips 相关属性 */
165
+ // 文本
166
+ textTips: "",
167
+ // 是否为状态弹窗
168
+ statusTips: false,
169
+ // 状态类型
170
+ typeTips: "",
171
+
172
+ // 节点
173
+ outGatewayUserTaskModel: [],
174
+ nextNodeData: [],
175
+
176
+ // 测试送审节点
177
+ visibleSong: false,
178
+
179
+ trackList: [],
180
+ user: {},
181
+ // 是否可选
182
+ canCheck: true,
183
+
184
+ // 节点信息
185
+ approveNode: {},
186
+
187
+ // 重新提交
188
+ restartDataS: {},
189
+ selfBtnList: [],
190
+
191
+ // 高度信息
192
+ topNum: 144,
193
+ bottomNum: 70,
194
+
195
+ userIdData: "",
196
+ TopPopup1: false,
197
+ cctaskTopPopup: false,
198
+ cctaskTopPopupTitle: "抄送",
199
+ };
200
+ },
201
+ watch: {
202
+ processInstId: {
203
+ // 初始化获取流程相关信息
204
+ async handler(val, preVal) {
205
+ this.processIntId =
206
+ this.processInstId ||
207
+ this.formData.processId ||
208
+ this.formData.processInstId;
209
+ if (val) {
210
+ // 流程图
211
+ this.request
212
+ .get("/aws/repository/getTrackUrl", {
213
+ params: {
214
+ processInstId: this.processIntId,
215
+ type: "mobile",
216
+ },
217
+ })
218
+ .then((res) => {
219
+ if (res.code == 200) {
220
+ this.trackUrl = res.data;
221
+ }
222
+ });
223
+
224
+ // 流程图信息
225
+ this.request
226
+ .get("/aws/pis/findNodeParticipantRows", {
227
+ params: {
228
+ processInstId: this.processIntId,
229
+ },
230
+ })
231
+ .then((res) => {
232
+ // console.log("流程信息", res);
233
+ if (res.code == 200) {
234
+ this.trackList = res.data;
235
+ }
236
+ });
237
+
238
+ // 流程信息
239
+ this.request
240
+ .get("/aws/tis/getTaskCommentList", {
241
+ params: {
242
+ processInstId: this.processInstId,
243
+ processBusinessKey: this.formData.businessKey,
244
+ },
245
+ })
246
+ .then((res) => {
247
+ if (res.code == 200) {
248
+ this.taskCommentList = res.data;
249
+ }
250
+ });
251
+
252
+ // info信息
253
+ this.getUserInfo();
254
+
255
+ // id
256
+ this.request
257
+ .get("/aws/pis/getProcessInstanceById", {
258
+ params: { processInstId: this.processInstId },
259
+ })
260
+ .then((res) => {
261
+ if (res.code == 200) {
262
+ this.ProcessInsObj = res.data;
263
+ }
264
+ });
265
+ // task信息 任务节点
266
+ await this.request
267
+ .get("/aws/repository/queryTaskNodeList", {
268
+ params: { processInstId: this.processInstId },
269
+ })
270
+ .then((res) => {
271
+ if (res.code == 200) {
272
+ this.taskNode = res.data;
273
+ this.taskNodeList = res.data;
274
+ if (this.taskNodeList.length == 1) {
275
+ if (this.taskNodeList[0].taskState == 4) {
276
+ this.taskState = 4;
277
+ return false;
278
+ }
279
+ if (this.taskNodeList[0].taskState == 11) {
280
+ this.taskState = 11;
281
+ }
282
+ let tid = this.taskNodeList[0].taskId;
283
+
284
+ this.handleGetProcessStatus();
285
+ this.handleGetUserTaskModel();
286
+ } else if (this.taskNodeList.length > 1) {
287
+ this.taskNodeList.forEach((item) => {
288
+ item.name = item.nodeName;
289
+ });
290
+ this.taskNodeShow = true;
291
+ this.actionShow = true;
292
+ } else {
293
+ this.handleGetProcessStatus();
294
+ this.handleGetUserTaskModel();
295
+ }
296
+ }
297
+ });
298
+ }
299
+ },
300
+ immediate: true,
301
+ deep: true,
302
+ },
303
+ restartData: {
304
+ handler(val, preVal) {
305
+ if (val) {
306
+ this.restartDataS = val;
307
+ }
308
+ },
309
+ immediate: true,
310
+ deep: true,
311
+ },
312
+ selfBtn: {
313
+ handler(val, preVal) {
314
+ if (val && val.length) {
315
+ this.selfBtnList = val;
316
+ }
317
+ },
318
+ immediate: true,
319
+ deep: true,
320
+ },
321
+ uid: {
322
+ handler(val, preVal) {
323
+ if (val) {
324
+ this.userIdData = val;
325
+ }
326
+ },
327
+ immediate: true,
328
+ deep: true,
329
+ },
330
+ },
331
+ mounted() { },
332
+ computed: {
333
+ //筛选
334
+ actionBtn() {
335
+ if (this.operBtn.length > 3) {
336
+ return this.operBtn.slice(3);
337
+ }
338
+ return [];
339
+ },
340
+ // 按钮对象
341
+ operBtn() {
342
+ let btnList = [];
343
+ let flag =
344
+ this.taskNode &&
345
+ this.taskNode[0] &&
346
+ this.taskNode[0].taskState != 4;
347
+
348
+ // 当前是否为重新提交
349
+ if (
350
+ this.formData.currentState === "已撤销" ||
351
+ this.formData.currentState === "已驳回" ||
352
+ this.processStatus.status === "已撤销" ||
353
+ this.processStatus.status === "已驳回" ||
354
+ this.processStatus.bizStatusName === "已撤销" ||
355
+ this.processStatus.bizStatusName === "已驳回"
356
+ ) {
357
+ let obj = {};
358
+ obj.name = "重新提交";
359
+ obj.btnProps = { type: "default" };
360
+ btnList.push(obj);
361
+ obj.click = this.handleTest;
362
+ // handleRestart
363
+ }
364
+
365
+ //处理
366
+ if (flag && !this.isView && this.taskObj.completeButtonLabel) {
367
+ let obj = {};
368
+ obj.name = this.taskObj.completeButtonLabel;
369
+ obj.btnProps = { type: "primary" };
370
+ btnList.push(obj);
371
+ obj.click = (name) => {
372
+ this.handleActionClose();
373
+ this.showOperation(
374
+ operation.complete,
375
+ name,
376
+ this.request,
377
+ this.taskObj.completeButtonAnnex
378
+ );
379
+ };
380
+ }
381
+
382
+ // 拒绝
383
+ if (flag && !this.isView && this.processStatus.currUserName) {
384
+ let obj = {};
385
+ obj.name = "拒绝";
386
+ obj.btnProps = { type: "danger" };
387
+ btnList.push(obj);
388
+ obj.click = (name) => {
389
+ this.handleActionClose();
390
+ this.showOperation(
391
+ operation.cancel,
392
+ name,
393
+ this.request,
394
+ this.taskObj.otherButtonAnnexList
395
+ );
396
+ };
397
+ }
398
+
399
+ // 自定义
400
+ if (this.selfBtnList && this.selfBtnList.length) {
401
+ this.selfBtnList.map((v) => {
402
+ let obj = {};
403
+ obj.name = v.name;
404
+ obj.btnProps = { type: v.type };
405
+ btnList.push(obj);
406
+ obj.click = v.click;
407
+ });
408
+ }
409
+
410
+ // 退回
411
+ if (
412
+ flag &&
413
+ !this.isView &&
414
+ this.taskObj.buttons &&
415
+ this.taskObj.buttons.length
416
+ ) {
417
+ this.taskObj.buttons.forEach((s) => {
418
+ if (s.label === "退回") {
419
+ let obj = {};
420
+ obj.name = s.label;
421
+ obj.btnProps = { type: "danger" };
422
+ btnList.push(obj);
423
+ obj.click = (name) => {
424
+ this.handleActionClose();
425
+ this.showOperation(
426
+ operation.backNode,
427
+ name,
428
+ this.request,
429
+ this.taskObj.otherButtonAnnexList
430
+ );
431
+ };
432
+ }
433
+ });
434
+ }
435
+
436
+ // 抄送
437
+ if (flag && !this.isView && this.taskObj.ccTaskButtonLabel) {
438
+ let obj = {};
439
+ obj.name = this.taskObj.ccTaskButtonLabel;
440
+ obj.btnProps = { type: "default" };
441
+ obj.click = async (name) => {
442
+ this.handleActionClose();
443
+
444
+ if (this.ccTaskFunction) {
445
+ let flag = await this.ccTaskFunction();
446
+ if (!flag) {
447
+ return;
448
+ }
449
+ }
450
+
451
+ this.showOperation(
452
+ operation.ccTask,
453
+ name,
454
+ this.request,
455
+ this.taskObj.ccTaskButtonAnnex,
456
+ "抄送"
457
+ );
458
+ this.cctaskTopPopupTitle = name;
459
+ // this.cctaskTopPopup = true;
460
+ };
461
+ btnList.push(obj);
462
+ }
463
+
464
+ // 转审
465
+ if (flag && !this.isView && this.taskObj.delegateTaskButtonLabel) {
466
+ let obj = {};
467
+ obj.name = this.taskObj.delegateTaskButtonLabel;
468
+ obj.btnProps = { type: "default" };
469
+ obj.click = (name) => {
470
+ this.handleActionClose();
471
+ this.showOperation(
472
+ operation.delegateTask,
473
+ name,
474
+ this.request,
475
+ this.taskObj.delegateTaskButtonAnnex
476
+ );
477
+ };
478
+ btnList.push(obj);
479
+ }
480
+
481
+ // 加签
482
+ if (flag && !this.isView && this.taskObj.counterSignLabel) {
483
+ let obj = {};
484
+ obj.name = this.taskObj.counterSignLabel;
485
+ obj.btnProps = { type: "primary" };
486
+ obj.click = (name) => {
487
+ this.handleActionClose();
488
+ this.showOperation(
489
+ operation.counterSign,
490
+ name,
491
+ this.request,
492
+ this.taskObj.counterSignButtonAnnex
493
+ );
494
+ };
495
+ btnList.push(obj);
496
+ }
497
+
498
+ // 催办
499
+ if (
500
+ this.processIntId &&
501
+ this.processStatus.createUid == this.userIdData &&
502
+ this.taskNode[0]?.taskState != 2 &&
503
+ this.processStatus.status !== "已驳回" &&
504
+ this.processStatus.status !== "已撤销" &&
505
+ this.processStatus.status !== "已完成"
506
+ ) {
507
+ let obj = {};
508
+ obj.name = "催办";
509
+ obj.btnProps = { type: "default" };
510
+ obj.click = (name) => {
511
+ this.$refs.TopPopup2.handleOpen();
512
+ this.handleActionClose();
513
+ this.titleText = name;
514
+ this.popupContext = `确定${name}吗?`;
515
+ this.handleTipsType = "催办";
516
+ };
517
+ btnList.push(obj);
518
+ }
519
+
520
+ // 撤销
521
+ if (
522
+ this.processIntId &&
523
+ this.processStatus.createUid == this.userIdData &&
524
+ this.taskNode[0]?.taskState != 2 &&
525
+ this.processStatus.status !== "已驳回" &&
526
+ this.processStatus.status !== "已撤销" &&
527
+ this.processStatus.status !== "已完成"
528
+ ) {
529
+ let obj = {};
530
+ obj.name = "撤销";
531
+ obj.btnProps = { type: "default" };
532
+ obj.click = (name) => {
533
+ this.$refs.TopPopup2.handleOpen();
534
+ this.handleActionClose();
535
+ this.titleText = name;
536
+ this.popupContext = `确定${name}吗?`;
537
+ this.handleTipsType = "撤销";
538
+ };
539
+ btnList.push(obj);
540
+ }
541
+ console.log('btnList======',btnList);
542
+ return btnList;
543
+ },
544
+ // 底部高度
545
+ processCardHeight() {
546
+ console.log("btnList", this.operBtn);
547
+
548
+ let num = this.topNum + this.bottomNum - 10;
549
+ if (
550
+ this.isAdditional &&
551
+ !this.operBtn &&
552
+ !this.operBtn.length &&
553
+ !this.ProcessInsObj.end
554
+ ) {
555
+ num -= this.bottomNum;
556
+ }
557
+
558
+ if(this.hideHeader){
559
+ num -= 204
560
+ }
561
+
562
+ // console.log('====1',document.getElementById('process-header'));
563
+ // if(document.getElementById('process-header') != null){
564
+ // setTimeout(()=>{
565
+ // console.log('====',document.getElementById('process-header').style);
566
+ // },200)
567
+ // }
568
+
569
+ return `calc(100vh - ${num}px)`;
570
+ },
571
+ // 底部按钮定位
572
+ processBtn() {
573
+ console.log("btnList", this.operBtn);
574
+
575
+ if (
576
+ this.isAdditional &&
577
+ !this.operBtn &&
578
+ !this.operBtn.length &&
579
+ !this.ProcessInsObj.end
580
+ ) {
581
+ return `-${this.bottomNum}px`;
582
+ }
583
+ },
584
+ },
585
+ methods: {
586
+ handleGetHeight() {
587
+ this.$nextTick(() => {
588
+ setTimeout(() => {
589
+ let header = document.getElementById("process-header");
590
+ let footer = document.getElementById("process-footer");
591
+
592
+ this.bottomNum = footer ? footer.scrollHeight + 10 : 70;
593
+ this.topNum = header ? header.scrollHeight + 10 : 144;
594
+ console.log(this.bottomNum, "diss::", this.topNum);
595
+ }, 1000);
596
+ });
597
+ },
598
+ handleTestsss(val, vals) {
599
+ console.log("==========:::", val, vals);
600
+ },
601
+ // 测试
602
+ handleTestS() {
603
+ this.handleTips("提交成功!", false, "success");
604
+ },
605
+
606
+ // 重新提交
607
+ handleTest() {
608
+ this.visibleSong = true;
609
+ },
610
+ // 用户信息
611
+ async getUserInfo() {
612
+ let res = await this.request.get("/app/user/info");
613
+ if (res.code === 200) {
614
+ this.user = res.data || {};
615
+ }
616
+ },
617
+
618
+ // 流程查询
619
+ async handleGetSimulation(vars) {
620
+ this.handleTips("", true, "loading");
621
+ let params = {
622
+ processInstId: this.processInstId,
623
+ taskInstId: this.taskNode.length ? this.taskNode[0].taskId : "",
624
+ vars: vars,
625
+ errorTip: false,
626
+ };
627
+
628
+ let simulationData = await this.request.post(
629
+ `/aws/tis/simulation`,
630
+ params
631
+ );
632
+ console.log(simulationData);
633
+
634
+ if (simulationData.success) {
635
+ this.handleTips("", false, "success");
636
+ this.nextNodeData = simulationData.data;
637
+
638
+ for (let i = 0; i < this.nextNodeData.length; i++) {
639
+ this.approveNode = this.nextNodeData[i];
640
+ }
641
+ } else {
642
+ let taskIDCopy =
643
+ this.taskNode && this.taskNode.length
644
+ ? this.taskNode[0].taskId
645
+ : "";
646
+ this.outGatewayUserTaskModel = await this.getOutgoingProcessNode(
647
+ taskIDCopy,
648
+ ""
649
+ );
650
+ }
651
+ },
652
+ async getOutgoingProcessNode(taskId, processNodeId) {
653
+ let res = await this.request.get(
654
+ "/aws/repository/getOutgoingProcessNode",
655
+ {
656
+ params: {
657
+ taskId: taskId,
658
+ processNodeId: processNodeId,
659
+ },
660
+ }
661
+ );
662
+
663
+ if (res.code == 200) {
664
+ if (res.data && res.data.length) {
665
+ for (let i = 0; i < res.data.length; i++) {
666
+ let o = res.data[i];
667
+ if (
668
+ o.type != "UserTaskModel" &&
669
+ o.type != "EndEventModel"
670
+ ) {
671
+ let childNode = await this.getOutgoingProcessNode(
672
+ taskId,
673
+ o.id
674
+ );
675
+
676
+ if (childNode && childNode.length) {
677
+ await childNode.map((v, i) => {
678
+ v.nodeName =
679
+ v.incomingConditionItemList &&
680
+ v.incomingConditionItemList.length
681
+ ? v.incomingConditionItemList[0]
682
+ .compareValue
683
+ : "";
684
+ });
685
+ o.childNode = childNode;
686
+ }
687
+ }
688
+ }
689
+ this.handleTips("", false, "success");
690
+ return res.data;
691
+ }
692
+ this.handleTips("", false, "success");
693
+ return [];
694
+ }
695
+ return [];
696
+ },
697
+
698
+ // 集合
699
+ handleGet(task) {
700
+ this.taskNode = [].concat(task);
701
+ this.taskNodeShow = false;
702
+ this.actionShow = false;
703
+ this.handleGetProcessStatus();
704
+ this.handleGetUserTaskModel();
705
+ },
706
+ // 流程状态
707
+ handleGetProcessStatus() {
708
+ this.handleTips("", true, "loading");
709
+ this.request
710
+ .get("/aws/pis/getProcessStatus", {
711
+ params: {
712
+ processInstId: this.processInstId,
713
+ taskId: this.taskNode.length
714
+ ? this.taskNode[0].taskId
715
+ : "",
716
+ },
717
+ })
718
+ .then((res) => {
719
+ if (res.code == 200) {
720
+ // res.data.allUserNames = [];
721
+ this.processStatus = res.data;
722
+ this.$emit(
723
+ "processStatus",
724
+ this.processStatus,
725
+ this.taskNode
726
+ );
727
+ // this.canCheck
728
+ if (
729
+ this.processStatus.userNodeGroup &&
730
+ this.processStatus.userNodeGroup[
731
+ this.taskNode[0].nodeName
732
+ ] &&
733
+ this.processStatus.userNodeGroup[
734
+ this.taskNode[0].nodeName
735
+ ].length > 1
736
+ ) {
737
+ this.canCheck = false;
738
+ } else {
739
+ this.canCheck = true;
740
+ }
741
+ }
742
+ this.handleGetHeight();
743
+ })
744
+ .catch((error) => {
745
+ this.handleGetHeight();
746
+ });
747
+ },
748
+ // 按钮操作信息
749
+ handleGetUserTaskModel() {
750
+ if (this.taskNode && this.taskNode.length) {
751
+ this.request
752
+ .get(`/aws/repository/getUserTaskModel`, {
753
+ params: {
754
+ taskId: this.taskNode[0].taskId,
755
+ },
756
+ })
757
+ .then((res) => {
758
+ if (res.code == 200) {
759
+ this.taskObj = res.data;
760
+ }
761
+ this.handleGetHeight();
762
+ this.$refs.topTips.handleClose();
763
+ })
764
+ .catch((error) => {
765
+ this.handleGetHeight();
766
+ this.$refs.topTips.handleClose();
767
+ });
768
+ } else {
769
+ this.$refs.topTips.handleClose();
770
+ }
771
+ },
772
+
773
+ // 弹窗内部渲染
774
+ async showOperation(com, label, request, annex, type) {
775
+ if (this.beforeFunction) {
776
+ this.operationParam.beforeFunction = this.beforeFunction;
777
+ }
778
+
779
+ if (
780
+ this.processStatus.allUserNames &&
781
+ this.processStatus.allUserNames.length
782
+ ) {
783
+ if (this.taskNode[0] && this.taskNode[0].nodeId) {
784
+ let vars;
785
+ if (this.getVars) {
786
+ vars = this.getVars();
787
+ }
788
+
789
+ await this.handleGetSimulation(vars);
790
+ }
791
+ }
792
+
793
+ if (request) {
794
+ this.operationParam.request = request;
795
+ this.annexlabel = annex;
796
+ }
797
+ this.titleText = label;
798
+ this.operationCom = com;
799
+
800
+ this.operationParam.annex = annex;
801
+ this.operationParam.subjectId = this.formData.subjectId;
802
+ this.operationParam.processInstId = this.processIntId;
803
+ this.operationParam.taskInstId =
804
+ this.taskNode && this.taskNode.length
805
+ ? this.taskNode[0].taskId
806
+ : "";
807
+ this.operationParam.actionName = label;
808
+ this.operationParam.formData = this.formData;
809
+ this.operationParam.ProcessInsObj = this.ProcessInsObj;
810
+
811
+ // 个人信息
812
+ this.operationParam.userInfo = this.user;
813
+
814
+ // 下次节点数据
815
+ this.operationParam.nextNodeData = this.nextNodeData;
816
+ this.operationParam.outGatewayUserTaskModel = this.outGatewayUserTaskModel;
817
+
818
+ console.log(
819
+ "outGatewayUserTaskModel",
820
+ this.outGatewayUserTaskModel
821
+ );
822
+
823
+ this.operationParam.taskNode = this.taskNode;
824
+
825
+ this.operationParam.appId = this.processStatus.appId;
826
+ // 弹窗确认结束事件
827
+ this.operationParam.endFunction = this.endFunction;
828
+
829
+ // 公文配置参数
830
+ this.operationParam.isDocument = this.isDocument;
831
+ this.operationParam.isQuickReply = this.isQuickReply;
832
+ this.operationParam.isMsg = this.isMsg;
833
+ this.operationParam.isRequire = this.isRequire;
834
+ // 是否可选择
835
+ this.operationParam.canCheck = this.canCheck;
836
+
837
+ this.operationParam.isCheckType = this.isCheckType;
838
+ this.operationParam.isOrgType = this.isOrgType;
839
+ this.operationParam.isCodeType = this.isCodeType;
840
+ // 处理字段处理
841
+ let actionModel = this.taskObj.commentModels;
842
+ actionModel.some(
843
+ (item) =>
844
+ (this.operationParam.actionComplete = item?.isDefault
845
+ ? item.actionName
846
+ : "")
847
+ );
848
+ switch (type) {
849
+ case "抄送":
850
+ this.operationParam.visible = true;
851
+ this.cctaskTopPopup = true;
852
+ break;
853
+ default:
854
+ this.operationParam.visible = true;
855
+ this.TopPopup1 = true;
856
+ break;
857
+ }
858
+ },
859
+ // 弹窗取消
860
+ handleCancel() {
861
+ // console.log("handleCancel");
862
+ },
863
+ // 弹窗确认
864
+ async handleComfig() {
865
+ this.$refs.operationRef.confirm();
866
+ },
867
+ // 关闭弹窗TopPopup1
868
+ handleClosePopup1() {
869
+ this.TopPopup1 = false;
870
+ this.operationParam.visible = false;
871
+ },
872
+ handleClosecctaskTopPopup() {
873
+ this.cctaskTopPopup = false;
874
+ this.operationParam.visible = false;
875
+ },
876
+ // 确认弹窗(催办,撤销)
877
+ handleTipsComfig() {
878
+ this.$refs.TopPopup2.handleCancel();
879
+ if (this.handleTipsType == "催办") {
880
+ this.handleTips("", true, "loading");
881
+ this.request
882
+ .get("/aws/tis/reminders", {
883
+ params: { processInstId: this.processIntId },
884
+ })
885
+ .then((res) => {
886
+ if (res.code == 200) {
887
+ this.handleTips("催办成功", true, "success");
888
+ window.top && window.top.postMessage('success', '*')
889
+ this.endFunction("催办");
890
+ } else {
891
+ this.handleTips(res.msg, true, "error");
892
+ }
893
+ });
894
+ }
895
+ if (this.handleTipsType == "撤销") {
896
+ this.handleTips("", true, "loading");
897
+ this.request
898
+ .post("/aws/pis/revoke", {
899
+ processInstId: this.ProcessInsObj.id,
900
+ processBusinessKey: this.ProcessInsObj
901
+ .processBusinessKey,
902
+ })
903
+ .then((res) => {
904
+ if (res.code == 200) {
905
+ this.handleTips("撤销成功", true, "success");
906
+ window.top && window.top.postMessage('success', '*')
907
+ this.endFunction("撤销");
908
+ } else {
909
+ this.textTips = res.msg;
910
+ this.typeTips = "error";
911
+ this.handleTips(res.msg, true, "error");
912
+ }
913
+ });
914
+ }
915
+ },
916
+ handleTipsCancel() {
917
+ // console.log("handleTipsCancel");
918
+ },
919
+
920
+ // 当前流程进度状态回显
921
+ getColor(status) {
922
+ if (status == "审核中") return "#FFA52D";
923
+ if (status == "已驳回") return "#F14B4C";
924
+ if (status == "已撤销") return "#CECECE";
925
+ if (status == "已完成") return "#6DC743";
926
+
927
+ return "#1389FF";
928
+ },
929
+ // 额外按钮tips
930
+ handleActionOpen() {
931
+ this.actionShow = true;
932
+ },
933
+ // 关闭额外按钮弹窗
934
+ handleActionClose() {
935
+ this.actionShow = false;
936
+ },
937
+ // 按钮执行方法
938
+ actionClick(name) {
939
+ this.titleText = name;
940
+ this.actionShow = false;
941
+ },
942
+ // 按钮状态回显
943
+ getBtnStyle(type) {
944
+ switch (type) {
945
+ case "primary":
946
+ return `background-color:#3c9cff;color:#fff`;
947
+
948
+ case "danger":
949
+ return `background-color:rgb(255, 230, 230);color:rgb(255, 96, 96)`;
950
+
951
+ case "default":
952
+ return `background-color:rgb(241, 241, 241);color:rgb(51, 51, 51)`;
953
+ default:
954
+ return `background-color:rgb(241, 241, 241);color:rgb(51, 51, 51)`;
955
+ }
956
+ },
957
+ // 复活流程
958
+ async handleRestart() {
959
+ this.handleTips("", true, "loading");
960
+ await this.request
961
+ .get("/aws/repository/getProcessDefList", {
962
+ params: {
963
+ appId: this.processStatus.appId,
964
+ },
965
+ })
966
+ .then((res) => {
967
+ this.processDefList = res.data;
968
+ this.request
969
+ .get("/aws/pis/getProcessInstanceByBusinessKey", {
970
+ params: {
971
+ businessKey: this.formData.businessKey,
972
+ },
973
+ })
974
+ .then((res) => {
975
+ this.processBusiness = res.data;
976
+ this.request
977
+ .get("/aws/repository/getFirstProcessNode", {
978
+ params: {
979
+ processDefId: this.processBusiness
980
+ .processDefId,
981
+ },
982
+ })
983
+ .then((res) => {
984
+ this.getFirstProcessNode = res.data[0];
985
+ this.operationParam.getFirstProcessNode = this.getFirstProcessNode;
986
+ this.operationParam.formData = this.formData;
987
+ this.handleTips("", false, "success");
988
+
989
+ this.handleActionClose();
990
+ this.showOperation(
991
+ operation.restart,
992
+ "重新提交",
993
+ this.request
994
+ );
995
+ })
996
+ .catch((err) => {
997
+ this.handleTips("请求出错", true, "error");
998
+ });
999
+ })
1000
+ .catch((err) => {
1001
+ this.handleTips("请求出错", true, "error");
1002
+ });
1003
+ })
1004
+ .catch((err) => {
1005
+ this.handleTips("请求出错", true, "error");
1006
+ });
1007
+ },
1008
+ // tips公用方法(tips)
1009
+ handleTips(text, status, type) {
1010
+ this.textTips = text;
1011
+ this.statusTips = status;
1012
+ this.typeTips = type;
1013
+ this.$refs.topTips.handleOpen();
1014
+ },
1015
+ },
1016
+ });