ui-process-h5 0.1.36 → 1.0.1

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