cloud-web-corejs 1.0.54-dev.757 → 1.0.54-dev.759

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.
@@ -1,2221 +1,2221 @@
1
- /**version-1.0*/
2
- import {getToken} from "../../utils/auth";
3
- import settingConfig from "@/settings.js";
4
- import {selectDialogMixins} from "../../mixins/selectDialog";
5
-
6
- let configUtil = {
7
- baseUrl: process.env.VUE_APP_BASE_API,
8
- getToken,
9
- requireView: (url) => {
10
- return require("@/views" + url).default;
11
- },
12
- };
13
-
14
- let wfIndexMixin,
15
- wfStartMixin,
16
- wfContentMixin,
17
- wfModifyMixin,
18
- wfUrgingMixin,
19
- deleteTaskUserMixin,
20
- addTaskUserMixin;
21
-
22
- function getTarget(t, flag) {
23
- let target;
24
- if (t.parentVue) {
25
- target = t.parentVue;
26
- } else if (flag === 0) {
27
- target = t.$parent.$parent;
28
- } else {
29
- target = t.$parent.$parent.$parent;
30
- }
31
- return target;
32
- }
33
-
34
- function oaPublishEvent(that) {
35
- let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
36
- if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
37
- let win = window.opener;
38
- if (win && domain && domain.call) {
39
- var event = {type: "topic", name: "successReloadPage"};
40
- domain.call(win, 'fireEvent', [event]);
41
- }
42
- }
43
- }
44
-
45
- wfIndexMixin = {
46
- name: "wfView",
47
- props: {
48
- objId: [String, Number],
49
- wfCode: String,
50
- serviceId: String,
51
- },
52
- data() {
53
- return {
54
- wfReloadFlag: false,
55
- hasWf: false,
56
- wfStartVisible: false,
57
- paramData: "",
58
- showModifyDialog: false,
59
- showBillEdit: false,
60
- content: "",
61
- wfInfo: "",
62
- currentTask: "",
63
- taskParam: "",
64
- };
65
- },
66
- computed: {
67
- current_prefix() {
68
- return this.serviceId ? "/" + this.serviceId : "";
69
- },
70
- },
71
- created() {
72
- },
73
- watch: {
74
- wfCode(val) {
75
- this.getWfInfo();
76
- },
77
- objId(val) {
78
- this.getWfInfo();
79
- },
80
- },
81
- async mounted() {
82
- if (this.objId) {
83
- let hasWf = false;
84
- let wfInfo, currentTask, taskParam;
85
- await this.initWfInfo().then((res) => {
86
- if (res && res.type == "success") {
87
- if (res.objx && res.objx.procInstId) {
88
- hasWf = true;
89
- wfInfo = res.objx;
90
- }
91
- }
92
- });
93
-
94
- if (hasWf) {
95
- /* await this.getCurrentTask(wfInfo).then(res1 => {
96
- if (res1.type == 'success') {
97
- currentTask = res1.objx;
98
- }
99
- }); */
100
- /* if (wfInfo.taskId) {
101
- await this.getTaskParams(currentTask).then(res2 => {
102
- if (res2.type == 'success') {
103
- taskParam = res2.objx;
104
- }
105
- });
106
- } */
107
- }
108
- this.paramData = taskParam;
109
- this.wfInfo = wfInfo;
110
- this.currentTask = currentTask;
111
- this.taskParam = taskParam;
112
-
113
- let flag = true;
114
- this.$emit("onShow", {
115
- wfInfo: wfInfo,
116
- currentTask: currentTask,
117
- taskParam: taskParam,
118
- hasWf: hasWf,
119
- callback: (val) => {
120
- flag = false;
121
- if (val !== false && hasWf) {
122
- this.wfReloadFlag = true;
123
- }
124
- },
125
- });
126
- if (flag) {
127
- if (hasWf) {
128
- this.wfReloadFlag = true;
129
- }
130
- }
131
- }
132
- this.$on("toDo", (option) => {
133
- this.$emit(option.methd, option.param);
134
- });
135
- },
136
- methods: {
137
- getWfInfo() {
138
- if (this.wfCode && this.objId) {
139
- this.reload();
140
- } else {
141
- this.wfReloadFlag = false;
142
- }
143
- },
144
- openStartWfDialog(code) {
145
- this.wfStartVisible = true;
146
- },
147
- reload() {
148
- this.wfReloadFlag = false;
149
- this.$nextTick(() => {
150
- this.wfReloadFlag = true;
151
- });
152
- },
153
- manualCallback() {
154
- this.$emit("manualCallback");
155
- },
156
- async getCurrentTask(obj) {
157
- let that = getTarget(this, 0);
158
- return that.$http({
159
- url: "/agilebpm/wf_task/getCurrentTask",
160
- data: {
161
- procInstId: obj.procInstId,
162
- },
163
- method: "post",
164
- async: false,
165
- isLoading: true,
166
- modalStrictly: true,
167
- });
168
- },
169
- async initWfInfo() {
170
- let that = getTarget(this, 0);
171
- let id = this.objId;
172
- let code = this.wfCode;
173
- return that.$http({
174
- url: this.current_prefix + "/wf/getWfInfo",
175
- method: `post`,
176
- data: {
177
- objTypeCode: code,
178
- objId: id,
179
- },
180
- isLoading: true,
181
- modalStrictly: true,
182
- });
183
- },
184
- async getTaskParams(data) {
185
- let that = getTarget(this, 0);
186
- return that.$http({
187
- url: "/agilebpm/wf_task/getTaskParams",
188
- method: `post`,
189
- data: {
190
- taskId: data.taskId,
191
- },
192
- isLoading: true,
193
- modalStrictly: true,
194
- });
195
- },
196
- openWfModifyDialog() {
197
- let row = this.paramData;
198
- let url = row.url + ".vue";
199
- this.showModifyDialog = true;
200
- this.content = configUtil.requireView(url);
201
- this.$openEditView("showBillEdit");
202
- },
203
- modfyDialogClose() {
204
- this.showBillEdit = false;
205
- this.content = null;
206
- },
207
- },
208
- };
209
-
210
- wfContentMixin = {
211
- name: "wfContent",
212
- props: {
213
- objId: [String, Number],
214
- wfCode: String,
215
- serviceId: String,
216
- _wfInfo: Object,
217
- _taskParam: Object,
218
- parentVue: Object,
219
- wfConfig: Object,
220
- defaultShowWfContent: Boolean,
221
- },
222
- computed: {
223
- current_prefix() {
224
- return this.serviceId ? "/" + this.serviceId : "";
225
- },
226
- viewTarget() {
227
- return getTarget(this);
228
- },
229
- isHideWf() {
230
- let that = this.viewTarget;
231
- let _hideWf = that._hideWf || that.$attrs._hideWf;
232
- return _hideWf === true || _hideWf === 'true';
233
- }
234
- },
235
- data() {
236
- let showWfFold =
237
- settingConfig.showWfFold != null && settingConfig.showWfFold != undefined
238
- ? settingConfig.showWfFold
239
- : false;
240
- if (this.wfConfig.showWfFold != null && this.wfConfig.showWfFold != undefined) {
241
- showWfFold = this.wfConfig.showWfFold;
242
- }
243
- let showWfContent =
244
- showWfFold &&
245
- settingConfig.defaultShowWfContent != null &&
246
- settingConfig.defaultShowWfContent != undefined
247
- ? settingConfig.defaultShowWfContent
248
- : true;
249
- if (
250
- this.defaultShowWfContent != null &&
251
- this.defaultShowWfContent != undefined
252
- ) {
253
- showWfContent = this.defaultShowWfContent;
254
- }
255
-
256
- return {
257
- fileInfos: [],
258
- showUserDialog: false,
259
- showContent: true,
260
- objTypeCode: "",
261
- // objId: '',
262
- wfInfo: {},
263
- // currentTask: {},
264
- taskParam: {},
265
- wfImage: "",
266
- wfStartBtn: false,
267
- wfManualendBtn: false,
268
- wfSubmitBtn: false,
269
- wfRejectBtn: false,
270
- changeHandlerBtn: false,
271
- wftaskData: [],
272
- allWfTaskOpinions: [],
273
- vxeOption: {},
274
- rejectNodes: [],
275
- rejectDialogVisible: false,
276
- rejectForm: {
277
- rejectSubmitModel: null,
278
- nodeId: null,
279
- opinion: null,
280
- },
281
- formLabelWidth: "120px",
282
- agreeDialogVisible: false,
283
- agreeForm: {
284
- opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
285
- nodeId: null,
286
- },
287
- changeWfDialogVisible: false,
288
- changeWfForm: {},
289
- changeUserRows: [],
290
- taskStatuses: {
291
- start: {
292
- class: "blue",
293
- value: this.$t2('开始', 'components.wf.startStatus'),
294
- },
295
- approve: {
296
- class: "orgn",
297
- value: this.$t2('待审批', 'components.wf.approveStatus'),
298
- },
299
- submit: {
300
- class: "green",
301
- value: this.$t2('同意', 'components.wf.submitStatus'),
302
- },
303
- reject: {
304
- class: "red",
305
- value: this.$t2('驳回', 'components.wf.rejectStatus'),
306
- },
307
- transfer: {
308
- class: "green",
309
- value: this.$t2('转办', 'components.wf.transferStatus'),
310
- },
311
- addIncreaseSign: {
312
- class: "green",
313
- value: this.$t2('加签', 'components.wf.addIncreaseSignStatus'),
314
- },
315
- revoke: {
316
- class: "red",
317
- value: this.$t2('撤回', 'components.wf.revokeStatus'),
318
- },
319
- end: {
320
- class: "gray",
321
- value: this.$t2('结束', 'components.wf.endStatus'),
322
- },
323
- },
324
- opinion: "",
325
- showWfFold: showWfFold,
326
- showWfContent: showWfContent,
327
-
328
- urgingForm: {},
329
- urgingDialogVisible: false,
330
- urgingUserIds: [],
331
- urgingUsers: [],
332
- agreeNodes: [],
333
- showWfManualDialog: false,
334
-
335
- showDeleteTaskUserDialog: false,
336
- showAddTaskUserDialog: false,
337
- wfUserParam: {},
338
- wfUserParamForTransfer: {},//转办
339
- wfUserParamForAddSign: {},//加签
340
- wfUserParamForTalk: {},//沟通
341
- tabIndex: "1",
342
- linkupOption: {},
343
- talkForm: {
344
- receiverName: null,
345
- content: null,
346
- attachmentDTOs: [],
347
- replyId: null
348
- },
349
- showTalkUserDialog: false,
350
- showTalkDialog: false,
351
- showFlowImg: true,
352
- operateType: null,
353
- addIncreaseSignUsers: [],
354
- addIncreaseSignForm: {
355
- userNickNames: null,
356
- opinion: null
357
- },
358
- showAddIncreaseSignDialog: false,
359
- showOpeaImg: true,
360
- showSetCandidateDialog: false,
361
- toTalk: false,
362
- showAllWfOpinon: false,
363
-
364
- revokeDialogVisible: false,
365
- revokeForm: {opinion: null},
366
- showWfInfoTab: false,
367
-
368
- showWfMemo:false,
369
- wfMemoOption: {},
370
- wfMemoForm: {
371
- receiverName: null,
372
- content: null,
373
- attachmentDTOs: [],
374
- replyId: null
375
- },
376
- showWfMemoDialog: false,
377
- wfMemoData:[],
378
-
379
- showCandidate: false,
380
- candidateOption:{},
381
- candidateDatas:[],
382
- wfSendTaskId: null,
383
- showAddOpinionButton: false,
384
-
385
- addOpinionEnabled: false,
386
- modifyCurrentCandidateEnabled: false,
387
-
388
- //修改脚本
389
- showWfFlowEleScriptDialog: false
390
- };
391
- },
392
- provide() {
393
- return {
394
- getParentVue: () => this.parentVue,
395
- getWfInfo: () => this.wfInfo,
396
- getCurrentPrefix: () => this.current_prefix,
397
- getEditVueTarget: ()=> getTarget(this)
398
- };
399
- },
400
- created() {
401
- this.wfInfo = this._wfInfo;
402
- this.showFlowImg = settingConfig.expandWfImage === false ? false : true;
403
- this.showAllWfOpinon = settingConfig.showAllWfOpinon === true;
404
- },
405
- mounted() {
406
- this.initOperateType();
407
- this.initForAll();
408
- },
409
- methods: {
410
- openWfFlowEleScriptDialog(){
411
- this.showWfFlowEleScriptDialog = true
412
- },
413
- initWfParam13(){
414
- //初始化补充意见权限
415
- let that = getTarget(this);
416
- return that.$http({
417
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
418
- method: `post`,
419
- data: {attributeKey: "param13"},
420
- success: (res) => {
421
- this.addOpinionEnabled = res?.objx === true;
422
- if(this.addOpinionEnabled){
423
- this.wfSendTaskId = this.getViewParam('wfSendTaskId');
424
- this.showAddOpinionButton = !!this.wfSendTaskId;
425
- }
426
- },
427
- });
428
- },
429
-
430
- initWfParam14(){
431
- //初始化修改当前候选人权限
432
- let that = getTarget(this);
433
- return that.$http({
434
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
435
- method: `post`,
436
- data: {attributeKey: "param14"},
437
- success: (res) => {
438
- this.modifyCurrentCandidateEnabled = res?.objx === true;
439
- },
440
- });
441
- },
442
- getViewParam(key){
443
- let that = this.viewTarget;
444
- let value = that[key] || that.$attrs[key];
445
- return value;
446
- },
447
- initCandidate(){
448
- // 是否显示"节点候选人"选项卡
449
- let that = getTarget(this);
450
- that.$http({
451
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
452
- method: `post`,
453
- data: {attributeKey: "param11"},
454
- isLoading: true,
455
- success: (res) => {
456
- this.showCandidate = res?.objx === true;
457
- if(this.showCandidate){
458
- this.$nextTick(()=>{
459
- this.initCandidateTable();
460
- })
461
- }
462
- },
463
- });
464
- },
465
- initCandidateTable(){
466
- let that = this;
467
- let tableOption = {
468
- vue: that,
469
- tableRef: 'table-candidate',
470
- tableName: 'wf_candidate-list',
471
- path: this.current_prefix + '/wf/getAllNodes',
472
- param: () => {
473
- return {
474
- stringOne: this.wfInfo.uuid
475
- }
476
- },
477
- config: {
478
- height: 350,
479
- proxyConfig: {
480
- props: {
481
- result: "objx", // 配置响应结果列表字段
482
- total: "objx.length", // 配置响应结果总页数字段
483
- },
484
- },
485
- pagerConfig:{
486
- autoHidden: true
487
- }
488
- },
489
- columns: [
490
- {type: 'checkbox', width: 50, resizable: false, fixed: 'left'},
491
- {title: this.$t2('节点名称', 'components.wf.nodeName'), field: 'nodeName', width: 250, fixed: 'left'},
492
- {
493
- field: 'wfTaskCandidates',
494
- title: this.$t2('候选人', 'components.wf.candidate'),
495
- width: 450,
496
- slots: {
497
- default: ({row, rowIndex}) => {
498
- return row.wfTaskCandidateDTOs ? row.wfTaskCandidateDTOs.map(item => item.name).join(",") : null;
499
- },
500
- },
501
- },
502
- {
503
- width: 47,
504
- fixed: 'right',
505
- title: '',
506
- sortable: false,
507
- }
508
- ]
509
- };
510
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
511
- that.candidateOption = opts;
512
- });
513
- },
514
- initOperateType() {
515
- if (this.operateType) {
516
- let wfInfo = this.wfInfo;
517
- if (wfInfo.toSubmit) {
518
- this.openAgreeDialog('submit');
519
- } else if (wfInfo.toReject) {
520
- this.rejectWfTask('reject');
521
- } else if (wfInfo.toAddIncreaseSign) {
522
- this.openAddIncreaseSign('addIncreaseSign')
523
- } else if (wfInfo.toRevoke) {
524
- this.openRevokeDialog('revoke')
525
- } else if (wfInfo.toLinkup) {
526
- this.openTalkDialog(null, null, 'talk');
527
- } else {
528
- this.operateType = null;
529
- }
530
- }
531
- },
532
- initForAll() {
533
- let that = getTarget(this);
534
- this.initWf(() => {
535
- if (this.wfInfo.procInstId) {
536
- this.initCurrentTask(this.wfInfo.procInstId, () => {
537
- this.initWftask(this.wfInfo.procInstId);
538
- this.getAllWfTaskOpinions();
539
- });
540
- this.initWfUserParam();
541
- this.initTabIndex();
542
- this.initShowTaskInfo();
543
- //初始化附言
544
- this.getIsShowWfMemo();
545
- // 是否显示"节点候选人"选项卡
546
- this.initCandidate()
547
-
548
- //初始化补充意见权限
549
- this.initWfParam13();
550
-
551
- //初始化修改当前候选人权限
552
- this.initWfParam14();
553
-
554
- }
555
- });
556
- },
557
- initTabIndex() {
558
- let that = getTarget(this);
559
- that.$http({
560
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
561
- method: `post`,
562
- data: {attributeKey: "param7"},
563
- isLoading: true,
564
- success: (res) => {
565
- let val = res !== null ? res.objx === true : false;
566
- this.toTalk = val;
567
- let flag = false;
568
- if (val) {
569
- let flag1 = that.$attrs._isNotifyMessage == true || that.$attrs._isNotifyMessage == "true";
570
- if (flag1) {
571
- this.tabIndex = "2";
572
- }
573
- if (settingConfig.autoOpenWfLinkup) {
574
- flag = true;
575
- let flag2 = that.$attrs._wfNotifyType == "wfLinkup";
576
- let flag3 = flag1 && flag2;
577
- if (flag3) {
578
- this.$nextTick(() => {
579
- let wfTabPane = this.$refs.wfTabPane;
580
- if (!wfTabPane.showContent) {
581
- wfTabPane.handleFold();
582
- }
583
- });
584
- }
585
- }
586
- }
587
- this.initLinkup(flag);
588
- }
589
- });
590
-
591
- },
592
- initWf(done) {
593
- var data = this.wfInfo;
594
- if (data && data.procInstId) {
595
- /** 流程状态:0未启动,1审核中,2已完成,3驳回,4中断 */
596
- var statuses = {
597
- 1: '<span class="tag">' + this.$t2('审核中', 'components.wf.wfStatus1') + '</span>',
598
- 3: '<span class="tag red">' + this.$t2('已驳回', 'components.wf.wfStatus2') + '</span>',
599
- 2: '<span class="tag green">' + this.$t2('已完成', 'components.wf.wfStatus3') + '</span>',
600
- };
601
- var statusStr = "";
602
- if (data.stat != null) {
603
- statusStr = statuses[data.stat] || "";
604
- }
605
- data.statusStr = statusStr;
606
- this.wfInfo = data;
607
-
608
- this.wfStartBtn = false;
609
- if (data.status != 2 && data.starterId) {
610
- this.wfManualendBtn = true;
611
- }
612
- this.wfSubmitBtn = false;
613
- this.wfRejectBtn = false;
614
-
615
- var url =
616
- this.current_prefix +
617
- "/wf/flowImage?procInstId=" +
618
- data.procInstId +
619
- "&_r=" +
620
- Math.random() +
621
- "&access_token=" +
622
- configUtil.getToken();
623
- this.wfImage = configUtil.baseUrl + url;
624
- done();
625
- }
626
- },
627
- initCurrentTask(procInstId, done) {
628
- if (this.wfInfo.taskId) {
629
- this.wfSubmitBtn = true;
630
- this.wfRejectBtn = true;
631
- this.changeHandlerBtn = true;
632
- }
633
- done();
634
- },
635
- initWftask(procInstId) {
636
- let that = getTarget(this);
637
- that.$http({
638
- url: this.current_prefix + "/wf/getWfTaskOpinionMerge",
639
- data: {
640
- stringOne: procInstId,
641
- },
642
- method: "post",
643
- async: false,
644
- isLoading: true,
645
- modalStrictly: true,
646
- success: (resultmsg) => {
647
- var datas = resultmsg.objx || [];
648
- this.wftaskData = datas;
649
- },
650
- });
651
- },
652
- getAllWfTaskOpinions() {
653
- if (!this.showAllWfOpinon) {
654
- return;
655
- }
656
- let that = getTarget(this);
657
- let wfInfo = this.wfInfo;
658
- that.$http({
659
- url: this.current_prefix + "/wf/getAllWfTaskOpinions",
660
- data: {
661
- objId: wfInfo.objId,
662
- objTypeCode: wfInfo.objTypeCode
663
- },
664
- method: "post",
665
- async: false,
666
- isLoading: true,
667
- modalStrictly: true,
668
- success: (resultmsg) => {
669
- var datas = resultmsg.objx || [];
670
- this.allWfTaskOpinions = datas;
671
- },
672
- });
673
- },
674
- openManualDialog(operateType) {
675
- this.operateType = operateType;
676
- this.showWfManualDialog = true;
677
- },
678
- manualEndWf() {
679
- this.showWfManualDialog = false;
680
- let that = getTarget(this);
681
- var procInstId = this.wfInfo.procInstId;
682
- var taskId = this.wfInfo.taskId ? this.wfInfo.taskId : "";
683
- var data = JSON.stringify({
684
- uuid: this.wfInfo.uuid,
685
- });
686
- that.$http({
687
- url: this.current_prefix + "/wf/interrupt",
688
- data: data,
689
- method: "post",
690
- headers: {
691
- "Content-Type": "application/json;charset=utf-8",
692
- },
693
- isLoading: true,
694
- success: (resultMsg) => {
695
- that.$message({
696
- message: resultMsg.content,
697
- type: "success",
698
- duration: 500,
699
- onClose: (t) => {
700
- this.reloadContent();
701
- this.closeWinOnCheck(3);
702
- },
703
- });
704
- },
705
- });
706
- },
707
- async rejectWfTask(operateType) {
708
- this.handleReminderContent("rejectReminder", async ()=>{
709
- let that = getTarget(this);
710
- var procInstId = this.wfInfo.procInstId;
711
- var taskId = this.wfInfo.taskId;
712
- var destinations = [];
713
-
714
- await that.$http({
715
- url: this.current_prefix + "/wf/getPreIncomeNodes",
716
- data: {
717
- stringOne: taskId,
718
- },
719
- method: "post",
720
- //contentType: 'application/json;charset=utf-8',
721
- async: false,
722
- isLoading: true,
723
- success: (resultMsg) => {
724
- destinations = (resultMsg.objx || []).reverse();
725
- },
726
- });
727
-
728
- if (destinations == null) {
729
- return false;
730
- }
731
- if (destinations.length == 0) {
732
- that.$message({
733
- message: this.$t2('无法驳回,没有目标节点', 'components.wf.rejectWarnMsg1'),
734
- type: "error",
735
- duration: 2 * 1000,
736
- });
737
- return false;
738
- }
739
- this.operateType = operateType;
740
- let rejectSubmitModel = null;
741
- if (this.wfInfo.toNextNode === 1) {
742
- rejectSubmitModel = this.wfInfo.toNextNode
743
- } else {
744
- rejectSubmitModel = this.wfInfo.toRejectNode == false ? 2 : null
745
- }
746
- this.rejectForm.rejectSubmitModel = rejectSubmitModel;
747
- this.rejectForm.nodeId = destinations[0].nodeId;
748
- this.rejectForm.opinion = "";
749
- this.rejectNodes = destinations;
750
- this.rejectDialogVisible = true;
751
- })
752
-
753
- },
754
- subRejectForm() {
755
- let that = getTarget(this);
756
- var procInstId = this.wfInfo.procInstId;
757
- var taskId = this.wfInfo.taskId;
758
-
759
- if (!this.rejectForm.nodeId) {
760
- that.$message({
761
- message: this.$t2('请选择驳回节点', 'components.wf.rejectWarnMsg2'),
762
- type: "error",
763
- duration: 2 * 1000,
764
- });
765
- return false;
766
- }
767
-
768
- if (!this.rejectForm.opinion) {
769
- that.$message({
770
- message: this.$t2('请输入驳回意见', 'components.wf.rejectWarnMsg3'),
771
- type: "error",
772
- duration: 2 * 1000,
773
- });
774
- return false;
775
- }
776
-
777
- var data = JSON.stringify({
778
- taskId: taskId,
779
- uuid: this.wfInfo.uuid,
780
- nodeId: this.rejectForm.nodeId,
781
- suggestion: this.rejectForm.opinion,
782
- rejectSubmitModel: this.rejectForm.rejectSubmitModel
783
- });
784
- this.rejectDialogVisible = false;
785
- that.$http({
786
- url: this.current_prefix + "/wf/reject",
787
- data: data,
788
- method: "post",
789
- headers: {
790
- "Content-Type": "application/json;charset=utf-8",
791
- },
792
- isLoading: true,
793
- success: (resultMsg) => {
794
- that.$message({
795
- message: resultMsg.content,
796
- type: "success",
797
- duration: 500,
798
- onClose: (t) => {
799
- this.reloadContent();
800
- this.closeWinOnCheck(2);
801
- },
802
- });
803
- },
804
- });
805
- },
806
- handleReminderContent(scriptType, callback){
807
- let that = getTarget(this);
808
- that.$http({
809
- url: this.current_prefix + "/wf/getReminderContent",
810
- data: {
811
- scriptType,
812
- taskId: this.wfInfo.taskId,
813
- uuid: this.wfInfo.uuid,
814
- },
815
- method: "post",
816
- isLoading: true,
817
- errorMsg: false,
818
- success: (res) => {
819
- if(res.objx){
820
- that.$baseConfirm(res.objx).then(() => {
821
- callback && callback();
822
- });
823
- }else{
824
- callback && callback();
825
- }
826
- },
827
- error: (e) => {
828
- if(e.response.status === 404){
829
- callback && callback();
830
- }else{
831
- that.$errorMsg({
832
- content: e.message,
833
- type: 'error',
834
- });
835
- }
836
- },
837
- });
838
- },
839
- openAgreeDialog(operateType) {
840
- const done = () => {
841
- this.handleReminderContent("submitReminder", ()=>{
842
- this.operateType = operateType;
843
- let that = getTarget(this);
844
- this.agreeForm = {
845
- opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
846
- nodeId: null,
847
- };
848
- this.agreeNodes = [];
849
- that.$http({
850
- url: this.current_prefix + "/wf/getNextOutgoingNodes",
851
- data: {
852
- stringOne: this.wfInfo.taskId,
853
- },
854
- method: "post",
855
- async: false,
856
- isLoading: true,
857
- success: (res) => {
858
- let nodes = res.objx || [];
859
- /*if (tq == true) {
860
- nodes.reverse();
861
- }*/
862
- if (nodes.length) {
863
- this.agreeForm.nodeId = nodes[0].nodeId;
864
- }
865
- this.agreeNodes = nodes;
866
- this.agreeDialogVisible = true;
867
- },
868
- });
869
- })
870
- }
871
- let wfConfig = this.wfConfig;
872
- if (wfConfig.onClickAgree) {
873
- wfConfig.onClickAgree(done)
874
- } else {
875
- done();
876
- }
877
- },
878
- subAgreeForm() {
879
- let wfConfig = this.wfConfig;
880
- let done = () => {
881
- this.subAgreeHandle();
882
- }
883
- if (wfConfig.onBeforeAgree) {
884
- wfConfig.onBeforeAgree(done)
885
- } else {
886
- done();
887
- }
888
- },
889
-
890
- subAgreeHandle() {
891
- let that = getTarget(this);
892
- let nodeId = null;
893
- if (this.agreeNodes.length) {
894
- if (!this.agreeForm.nodeId) {
895
- that.$message({
896
- message: this.$t2('请选择节点', 'components.wf.agreeWarnMsg1'),
897
- type: "error",
898
- duration: 2 * 1000,
899
- });
900
- return;
901
- }
902
- nodeId = this.agreeForm.nodeId;
903
- }
904
-
905
- var procInstId = this.wfInfo.procInstId;
906
- var taskId = this.wfInfo.taskId;
907
- var memo = this.agreeForm.opinion || this.$t2('同意', 'components.wf.defaultAgreeOption');
908
- var data = JSON.stringify({
909
- taskId: taskId,
910
- uuid: this.wfInfo.uuid,
911
- suggestion: memo,
912
- nodeId: nodeId,
913
- });
914
- this.agreeDialogVisible = false;
915
- that.$http({
916
- url: this.current_prefix + "/wf/submit",
917
- data: data,
918
- method: "post",
919
- headers: {
920
- "Content-Type": "application/json;charset=utf-8",
921
- },
922
- isLoading: true,
923
- success: (resultMsg) => {
924
- if (resultMsg.objx && resultMsg.objx.code == "999999") {
925
- this.errorSubmit({
926
- taskId: taskId,
927
- uuid: this.wfInfo.uuid,
928
- suggestion: memo,
929
- errorMsg: resultMsg.objx.errorMsg
930
- });
931
- } else {
932
- that.$message({
933
- message: resultMsg.content,
934
- type: "success",
935
- duration: 500,
936
- onClose: (t) => {
937
- this.reloadContent();
938
- this.closeWinOnCheck(1);
939
- },
940
- });
941
- }
942
- },
943
- });
944
- },
945
- errorSubmit(data) {
946
- let that = getTarget(this);
947
- that.$http({
948
- url: this.current_prefix + "/wf/errorSubmit",
949
- data: data,
950
- method: "post",
951
- isLoading: true,
952
- success: (resultMsg) => {
953
- that.$message({
954
- message: resultMsg.content,
955
- type: "success",
956
- duration: 500,
957
- onClose: (t) => {
958
- this.reloadContent();
959
- this.closeWinOnCheck(1);
960
- },
961
- });
962
- },
963
- });
964
- },
965
- openChangeWfForm(operateType) {
966
- this.operateType = operateType;
967
- this.changeWfDialogVisible = true;
968
- this.changeUserRows = [];
969
- this.changeWfForm = {
970
- userIds: [],
971
- userNickNames: null,
972
- opinion: null,
973
- };
974
- },
975
- subChangeWfForm() {
976
- let that = getTarget(this);
977
- var procInstId = this.wfInfo.procInstId;
978
- var taskId = this.wfInfo.taskId;
979
-
980
- var userIds = this.changeWfForm.userIds || [];
981
- var opinion = this.changeWfForm.opinion || null;
982
-
983
- if (!userIds.length) {
984
- that.$message({
985
- message: this.$t2('请选择转办人', 'components.wf.transferWarnMsg1'),
986
- type: "error",
987
- duration: 2000,
988
- onClose: (t) => {
989
- },
990
- });
991
- return false;
992
- }
993
-
994
- var data = JSON.stringify({
995
- taskId: taskId,
996
- uuid: this.wfInfo.uuid,
997
- transferTo: userIds,
998
- suggestion: opinion,
999
- });
1000
- this.changeWfDialogVisible = false;
1001
- that.$http({
1002
- url: this.current_prefix + "/wf/transfer",
1003
- data: data,
1004
- method: "post",
1005
- headers: {
1006
- "Content-Type": "application/json;charset=utf-8",
1007
- },
1008
- isLoading: true,
1009
- success: (resultMsg) => {
1010
- that.$message({
1011
- message: resultMsg.content,
1012
- type: "success",
1013
- duration: 500,
1014
- onClose: (t) => {
1015
- this.reloadContent();
1016
- this.closeWinOnCheck(4);
1017
- },
1018
- });
1019
- },
1020
- });
1021
- },
1022
- userConfirm(rows) {
1023
- if (rows.length > 0) {
1024
- let changeUserRows = this.changeUserRows;
1025
- let ids = changeUserRows.map((changeUserRow) => changeUserRow.id);
1026
- let addRows = rows.filter((row) => !ids.includes(row.id));
1027
- changeUserRows.push(...addRows);
1028
-
1029
- let row = rows[0];
1030
- this.changeWfForm.userIds = changeUserRows.map(
1031
- (changeUserRow) => changeUserRow.id
1032
- );
1033
- this.changeWfForm.userNickNames = changeUserRows
1034
- .map((changeUserRow) => changeUserRow.nickName)
1035
- .join(",");
1036
- }
1037
- },
1038
- reloadContent() {
1039
- let that = getTarget(this);
1040
- oaPublishEvent(that);
1041
- that.$baseReload();
1042
- },
1043
- closeWinOnCheck(flag) {
1044
- //_closeWindowOnCheck=true, 1提交,2驳回,3中断,4转办时,5沟通 关闭窗口
1045
- let that = getTarget(this);
1046
- let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
1047
- if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
1048
- window.close && window.close();
1049
- }
1050
- let _handleCallback = that.$attrs._handleCallback || that._handleCallback;
1051
- _handleCallback && _handleCallback(flag);
1052
- },
1053
- manualCallback() {
1054
- this.$emit("manualCallback");
1055
- },
1056
- openUrgingDialog(operateType) {
1057
- this.operateType = operateType;
1058
- this.urgingDialogVisible = true;
1059
- },
1060
- openDeleteTaskUserDialog(operateType) {
1061
- this.operateType = operateType;
1062
- this.showDeleteTaskUserDialog = true;
1063
- },
1064
- openAddTaskUserDialog(operateType) {
1065
- this.operateType = operateType;
1066
- this.showAddTaskUserDialog = true;
1067
- },
1068
- openAddIncreaseSign(operateType) {
1069
- this.operateType = operateType;
1070
- this.addIncreaseSignUsers = [];
1071
- this.addIncreaseSignForm = {userNickNames: null};
1072
- this.showAddIncreaseSignDialog = true;
1073
- },
1074
- initWfUserParam(callback) {
1075
- this.initTransferUserParam();//转办
1076
- this.initAddSignUserParam();//加签
1077
- this.initTalkUserParam();//沟通
1078
- },
1079
- //
1080
- initTransferUserParam(callback) {
1081
- //初始化转办用户参数
1082
- let that = getTarget(this);
1083
- return that.$http({
1084
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1085
- method: `post`,
1086
- data: {attributeKey: "param1"},
1087
- isLoading: true,
1088
- modalStrictly: true,
1089
- success: (res) => {
1090
- this.wfUserParamForTransfer = res.objx || {};
1091
- callback && callback();
1092
- },
1093
- });
1094
- },
1095
- initAddSignUserParam(callback) {
1096
- //初始化加签用户参数
1097
- let that = getTarget(this);
1098
- return that.$http({
1099
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1100
- method: `post`,
1101
- data: {attributeKey: "param2"},
1102
- isLoading: true,
1103
- modalStrictly: true,
1104
- success: (res) => {
1105
- this.wfUserParamForAddSign = res.objx || {};
1106
- callback && callback();
1107
- },
1108
- });
1109
- },
1110
- initTalkUserParam(callback) {
1111
- //初始化沟通用户参数
1112
- let that = getTarget(this);
1113
- return that.$http({
1114
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1115
- method: `post`,
1116
- data: {attributeKey: "param3"},
1117
- isLoading: true,
1118
- modalStrictly: true,
1119
- success: (res) => {
1120
- this.wfUserParamForTalk = res.objx || {};
1121
- callback && callback();
1122
- },
1123
- });
1124
- },
1125
- //
1126
- resetLinkup() {
1127
- this.formData = {};
1128
- this.$refs["table-linkup"].commitProxy("reload");
1129
- },
1130
- searchLinkup() {
1131
- this.$refs["table-linkup"].commitProxy("reload");
1132
- },
1133
- initLinkup(flag) {
1134
- let h = this.$createElement;
1135
- let statusMap = {
1136
- 0: this.$t2('未完成', 'components.wf.talkStatus0'),
1137
- 1: this.$t2('已完成', 'components.wf.talkStatus1'),
1138
- 2: this.$t2('已取消', 'components.wf.talkStatus2')
1139
- };
1140
- let tableOption = {
1141
- vue: this,
1142
- tableRef: "table-linkup",
1143
- tableName: "wf_table-linkup",
1144
- path: this.current_prefix + "/wf_linkup/listPage",
1145
- param: () => {
1146
- return {
1147
- uuid: this.wfInfo.uuid,
1148
- };
1149
- },
1150
- config: {
1151
- height: 350
1152
- },
1153
- columns: [
1154
- {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1155
- {
1156
- title: this.$t2('任务名称', 'components.wf.taskName'),
1157
- field: "taskName",
1158
- width: 150,
1159
- fixed: "left",
1160
- },
1161
- {
1162
- title: this.$t2('发送人', 'components.wf.senderName'),
1163
- field: "senderName",
1164
- width: 150,
1165
- slots: {
1166
- default: "sender",
1167
- },
1168
- },
1169
- {
1170
- title: this.$t2('接收人', 'components.wf.receiverName'),
1171
- field: "receiverName",
1172
- width: 150,
1173
- slots: {
1174
- default: "receiver",
1175
- },
1176
- },
1177
- {
1178
- title: this.$t2('沟通内容', 'components.wf.talkContent'),
1179
- field: "content",
1180
- width: 250,
1181
- showOverflow: false,
1182
- slots: {
1183
- default: ({row, rowIndex}) => {
1184
- return row.replyId ? ("[" + this.$t2('回复', 'components.wf.reply') + "]" + row.content) : row.content;
1185
- },
1186
- },
1187
- },
1188
- {
1189
- width: 150,
1190
- title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1191
- field: "attachmentImage",
1192
- sortable: false,
1193
- slots: {
1194
- default: ({row, rowIndex}) => {
1195
- let option = {
1196
- title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1197
- edit: false,
1198
- rows: (done) => {
1199
- done(row.attachmentDTOs);
1200
- },
1201
- };
1202
- return [
1203
- h("base-attachment", {
1204
- props: {
1205
- option: option,
1206
- imageLazy: false
1207
- },
1208
- }),
1209
- ];
1210
- },
1211
- },
1212
- },
1213
-
1214
- {
1215
- title: this.$t2('状态', 'components.wf.status'),
1216
- field: "status",
1217
- width: 150,
1218
- slots: {
1219
- default: ({row, rowIndex}) => {
1220
- return statusMap[row.status] || "";
1221
- },
1222
- },
1223
- },
1224
- {
1225
- title: this.$t2('创建时间', 'system.label.createDate'),
1226
- field: "createDate",
1227
- width: 150,
1228
- },
1229
- {
1230
- width: 80,
1231
- fixed: "right",
1232
- title: "",
1233
- sortable: false,
1234
- slots: {
1235
- default: "operate"
1236
- }
1237
- },
1238
- ],
1239
- callback: (rows) => {
1240
- if (rows.length && flag) {
1241
- let row = rows[0];
1242
- if (row.replyToSender) {
1243
- this.$nextTick(() => {
1244
- this.tabIndex = "2";
1245
- this.openTalkDialog(row.sender, row.senderName, 'talk', 1, row.id)
1246
- });
1247
- }
1248
- }
1249
- }
1250
- };
1251
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1252
- this.linkupOption = opts;
1253
- });
1254
- },
1255
- cancelTalk(row) {
1256
- let that = getTarget(this);
1257
- that.$baseConfirm(this.$t2('您确定要取消沟通记录吗?', 'components.wf.cancelTalkTip')).then(() => {
1258
- that.$http({
1259
- url: this.current_prefix + "/wf_linkup/cancel",
1260
- data: {id: row.id},
1261
- method: "post",
1262
- loadingTarget: document.body,
1263
- isLoading: true,
1264
- success: (resultMsg) => {
1265
- that.$message({
1266
- message: resultMsg.content,
1267
- type: "success",
1268
- duration: 500,
1269
- onClose: (t) => {
1270
- this.reloadContent();
1271
- },
1272
- });
1273
- },
1274
- });
1275
- });
1276
- },
1277
- openTalkDialog(receiver, receiverName, operateType, flag, replyId) {
1278
- this.operateType = operateType;
1279
- /*this.talkForm.receiver = receiver || null;
1280
- this.talkForm.receiverName = receiverName || null;
1281
- this.talkForm.replyId = replyId || null;
1282
- this.talkForm.content = null;
1283
- this.talkForm.attachmentDTOs = [];*/
1284
- this.initTalkForm(receiver, receiverName, replyId)
1285
- this.showTalkDialog = true;
1286
- if (flag == 1) {
1287
- let opeaBtnDom = this.$refs.opeaBtn;
1288
- opeaBtnDom && opeaBtnDom.scrollIntoView();
1289
- }
1290
- },
1291
- initTalkForm(receiver, receiverName, replyId) {
1292
- this.talkForm.receiver = receiver || null;
1293
- this.talkForm.receiverName = receiverName || null;
1294
- this.talkForm.replyId = replyId || null;
1295
- this.talkForm.content = null;
1296
- this.talkForm.attachmentDTOs = [];
1297
- },
1298
- submitTalkForm() {
1299
- let that = getTarget(this);
1300
- var procInstId = this.wfInfo.procInstId;
1301
- var taskId = this.wfInfo.taskId;
1302
-
1303
- if (!this.talkForm.receiver) {
1304
- that.$message({
1305
- message: this.$t2('请选择接收人', 'components.wf.talkWarnMsg1'),
1306
- type: "error",
1307
- duration: 2 * 1000,
1308
- });
1309
- return false;
1310
- }
1311
- if (!this.talkForm.content) {
1312
- that.$message({
1313
- message: this.$t2('请输入沟通内容', 'components.wf.talkWarnMsg2'),
1314
- type: "error",
1315
- duration: 2 * 1000,
1316
- });
1317
- return false;
1318
- }
1319
-
1320
- var data = {
1321
- taskId: taskId,
1322
- uuid: this.wfInfo.uuid,
1323
- receiver: this.talkForm.receiver,
1324
- receiverName: this.talkForm.receiverName,
1325
- replyId: this.talkForm.replyId,
1326
- content: this.talkForm.content,
1327
- attachmentDTOs: this.talkForm.attachmentDTOs,
1328
- notifyType: "wfLinkup",
1329
- };
1330
- this.showTalkDialog = false;
1331
- that.$http({
1332
- url: this.current_prefix + "/wf_linkup/save",
1333
- data: data,
1334
- method: "post",
1335
- isLoading: true,
1336
- success: (resultMsg) => {
1337
- that.$message({
1338
- message: resultMsg.content,
1339
- type: "success",
1340
- duration: 500,
1341
- onClose: (t) => {
1342
- this.reloadContent();
1343
- this.closeWinOnCheck(5);
1344
- },
1345
- });
1346
- },
1347
- });
1348
- },
1349
- openTalkUserDialog() {
1350
- this.showTalkUserDialog = true;
1351
- },
1352
- confirmTalkUserDialog(rows) {
1353
- if (rows.length > 0) {
1354
- let row = rows[0];
1355
- if (this.talkForm.receiver != row.id) {
1356
- this.talkForm.replyId = null;
1357
- }
1358
- this.talkForm.receiver = row.id;
1359
- this.talkForm.receiverName = row.nickName;
1360
- }
1361
- },
1362
- confirmUrging() {
1363
- this.reloadContent();
1364
- },
1365
- confirmDeleteTaskUser() {
1366
- this.reloadContent();
1367
- },
1368
- confirmAddTaskUser(rows) {
1369
- this.addIncreaseSignUsers = rows;
1370
- this.addIncreaseSignForm.userNickNames = rows.map(row => row.nickName).join(',');
1371
- // this.reloadContent();
1372
- },
1373
- submitAddTaskUserForm(flag) {
1374
- let that = getTarget(this);
1375
- let userIds = this.addIncreaseSignUsers.map((checkRow) => checkRow.id);
1376
- if (userIds.length == 0) {
1377
- that.$message({
1378
- message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
1379
- type: "error",
1380
- duration: 2000,
1381
- onClose: (t) => {
1382
- },
1383
- });
1384
- return false;
1385
- }
1386
- let toDo = () => {
1387
- var data = JSON.stringify({
1388
- uuid: this.wfInfo.uuid,
1389
- taskId: this.wfInfo.taskId,
1390
- userIds: userIds,
1391
- suggestion: this.addIncreaseSignForm.opinion
1392
-
1393
- });
1394
- this.agreeDialogVisible = false;
1395
- that.$http({
1396
- url: this.current_prefix + "/wf/addIncreaseSign",
1397
- data: data,
1398
- method: "post",
1399
- loadingTarget: document.body,
1400
- headers: {
1401
- "Content-Type": "application/json;charset=utf-8",
1402
- },
1403
- isLoading: true,
1404
- success: (resultMsg) => {
1405
- this.showAddIncreaseSignDialog = false
1406
- that.$message({
1407
- message: resultMsg.content,
1408
- type: "success",
1409
- duration: 500,
1410
- onClose: (t) => {
1411
- this.reloadContent();
1412
- },
1413
- });
1414
- },
1415
- });
1416
- }
1417
- if (flag === 0) {
1418
- toDo();
1419
- } else {
1420
- that.$baseConfirm(this.$t2('您确定要加签吗?', 'components.wf.addIncreaseSignConfirmTip')).then(() => {
1421
- toDo();
1422
- });
1423
- }
1424
- },
1425
- openSetCandidateDialog(operateType) {
1426
- this.operateType = operateType;
1427
- this.showSetCandidateDialog = true;
1428
- },
1429
- closeSetCandidateDialog() {
1430
- this.showSetCandidateDialog = false;
1431
- this.reloadContent();
1432
- },
1433
- openRevokeDialog(operateType) {
1434
- this.operateType = operateType;
1435
- this.revokeForm = {opinion: null}
1436
- this.revokeDialogVisible = true;
1437
- },
1438
- subRevokeForm(flag) {
1439
- //撤回
1440
- let that = getTarget(this);
1441
- let toDo = () => {
1442
- var data = JSON.stringify({
1443
- uuid: this.wfInfo.uuid,
1444
- taskId: this.wfInfo.taskId,
1445
- suggestion: this.revokeForm.opinion,
1446
- });
1447
- this.revokeDialogVisible = false;
1448
- that.$http({
1449
- url: this.current_prefix + "/wf/revoke",
1450
- data: data,
1451
- method: "post",
1452
- loadingTarget: document.body,
1453
- headers: {
1454
- "Content-Type": "application/json;charset=utf-8",
1455
- },
1456
- isLoading: true,
1457
- success: (resultMsg) => {
1458
- that.$message({
1459
- message: resultMsg.content,
1460
- type: "success",
1461
- duration: 500,
1462
- onClose: (t) => {
1463
- this.reloadContent();
1464
- },
1465
- });
1466
- },
1467
- });
1468
- }
1469
- if (flag === 0) {
1470
- toDo();
1471
- } else {
1472
- that.$baseConfirm(this.$t2('您确定要撤回吗?', 'components.wf.revokeConfirmTip')).then(() => {
1473
- toDo();
1474
- });
1475
- }
1476
- },
1477
- initShowTaskInfo(callback) {
1478
- //初始化转办用户参数
1479
- let that = getTarget(this);
1480
- return that.$http({
1481
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1482
- method: `post`,
1483
- data: {attributeKey: "param9"},
1484
- isLoading: true,
1485
- modalStrictly: true,
1486
- success: (res) => {
1487
- this.showWfInfoTab = res.objx !== 1;
1488
- callback && callback();
1489
- },
1490
- });
1491
- },
1492
- getIsShowWfMemo(){
1493
- let that = getTarget(this);
1494
- that.$http({
1495
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1496
- method: `post`,
1497
- data: {attributeKey: "param10"},
1498
- isLoading: true,
1499
- success: (res) => {
1500
- this.showWfMemo = res?.objx === true;
1501
- if(this.showWfMemo){
1502
- this.$nextTick(()=>{
1503
- this.initWfMemo();
1504
- })
1505
- }
1506
- },
1507
- });
1508
- },
1509
-
1510
- initWfMemo() {
1511
- this.wfMemoSearchEvent();
1512
- /* let h = this.$createElement;
1513
- let tableOption = {
1514
- vue: this,
1515
- tableRef: "table-wfMemo",
1516
- tableName: "wf_table-wfMemo",
1517
- path: this.current_prefix + "/wf_memo/listPage",
1518
- param: () => {
1519
- return {
1520
- uuid: this.wfInfo.uuid,
1521
- };
1522
- },
1523
- config: {
1524
- height: 350
1525
- },
1526
- columns: [
1527
- {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1528
- {
1529
- title: this.$t1('操作人'),
1530
- field: "operatorName",
1531
- width: 150,
1532
- fixed: "left",
1533
- },
1534
- {
1535
- title: this.$t1('内容'),
1536
- field: "content",
1537
- width: 250,
1538
- showOverflow: false
1539
- },
1540
- {
1541
- width: 150,
1542
- title: this.$t1('附件'),
1543
- field: "attachmentImage",
1544
- sortable: false,
1545
- slots: {
1546
- default: ({row, rowIndex}) => {
1547
- let option = {
1548
- title: this.$t1('附件'),
1549
- edit: false,
1550
- rows: (done) => {
1551
- done(row.attachmentDTOs);
1552
- },
1553
- };
1554
- return [
1555
- h("base-attachment", {
1556
- props: {
1557
- option: option,
1558
- imageLazy: false
1559
- },
1560
- }),
1561
- ];
1562
- },
1563
- },
1564
- },
1565
- {
1566
- title: this.$t2('创建时间', 'system.label.createDate'),
1567
- field: "createDate",
1568
- width: 150,
1569
- },
1570
- {
1571
- width: 80,
1572
- fixed: "right",
1573
- title: "",
1574
- sortable: false
1575
- },
1576
- ]
1577
- };
1578
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1579
- this.wfMemoOption = opts;
1580
- }); */
1581
- },
1582
- wfMemoSearchEvent(){
1583
- // this.$refs['table-wfMemo'].commitProxy('reload');
1584
- let that = getTarget(this);
1585
- that.$http({
1586
- url: this.current_prefix + "/wf_memo/listPage",
1587
- method: `post`,
1588
- data: {
1589
- uuid: this.wfInfo.uuid,
1590
- },
1591
- isLoading: true,
1592
- success: (res) => {
1593
- let rows = res?.objx?.records || [];
1594
- this.wfMemoData = rows;
1595
- },
1596
- });
1597
- },
1598
- openWfMemoDialog(row) {
1599
- if(row){
1600
- this.wfMemoForm = this.$baseLodash.cloneDeep(row);
1601
- }else{
1602
- this.wfMemoForm = {
1603
- uuid: this.wfInfo.uuid,
1604
- content:null,
1605
- attachmentDTOs: []
1606
- }
1607
- }
1608
- this.showWfMemoDialog = true;
1609
- },
1610
- submitWfMemoForm() {
1611
- let that = getTarget(this);
1612
-
1613
- if (!this.wfMemoForm.content) {
1614
- that.$message({
1615
- message: this.$t1('请输入内容'),
1616
- type: "error",
1617
- duration: 2 * 1000,
1618
- });
1619
- return false;
1620
- }
1621
-
1622
- this.showWfMemoDialog = false;
1623
- that.$http({
1624
- url: this.current_prefix + "/wf_memo/save",
1625
- data: this.wfMemoForm,
1626
- method: "post",
1627
- isLoading: true,
1628
- success: (resultMsg) => {
1629
- that.$message({
1630
- message: resultMsg.content,
1631
- type: "success"
1632
- });
1633
- this.wfMemoSearchEvent();
1634
- },
1635
- });
1636
- },
1637
- }
1638
- };
1639
-
1640
- wfStartMixin = {
1641
- name: "wfStartDialog",
1642
- props: {
1643
- dataId: [String, Number],
1644
- code: [String, Number],
1645
- serviceId: String,
1646
- startParam: Object,
1647
- visible: Boolean,
1648
- parentVue: Object,
1649
- wfName: String,
1650
- formCode: String,
1651
- option: Object
1652
- },
1653
- data() {
1654
- return {
1655
- showDialog: false,
1656
- wfStartForm: {},
1657
- wfDefItems: [],
1658
-
1659
- startFormData:{},
1660
- wfUserRangeEnabled: false,
1661
- preStartResult:[],
1662
- showSetCandidateDialog2:false,
1663
- wfSubmitted: false
1664
- };
1665
- },
1666
- computed: {
1667
- current_prefix() {
1668
- return this.serviceId ? "/" + this.serviceId : "";
1669
- },
1670
- },
1671
- mounted() {
1672
- this.initWfInfo(this.code);
1673
- // this.showDialog = true;
1674
- },
1675
- methods: {
1676
- preStart(){
1677
- let that = getTarget(this);
1678
- return new Promise(resolve=>{
1679
- return that.$http({
1680
- url: this.current_prefix + "/wf/preStart",
1681
- method: `post`,
1682
- data: this.startFormData,
1683
- success: (res) => {
1684
- resolve(res.objx);
1685
- },
1686
- });
1687
- })
1688
- },
1689
- initWfUserRangeParam(){
1690
- let that = getTarget(this);
1691
- return that.$http({
1692
- url: USER_PREFIX + "/wf_diy_attribute/getValue",
1693
- method: `post`,
1694
- data: {attributeKey: "param12"},
1695
- success: (res) => {
1696
- this.wfUserRangeEnabled = res?.objx === true;
1697
- },
1698
- });
1699
- },
1700
- openSetCandidateDialog(){
1701
- this.showSetCandidateDialog2 = true;
1702
- },
1703
- confirmSetCandidateDialog(rows){
1704
- let formData = {
1705
- ...this.startFormData,
1706
- wfNodeDTOs: rows
1707
- }
1708
- this.startSubmitHanlde(formData);
1709
- },
1710
- async initWfInfo(code) {
1711
- let that = getTarget(this);
1712
- var wfDefItems = null;
1713
- var objId = this.dataId;
1714
-
1715
- await this.initWfUserRangeParam();
1716
- await that.$http({
1717
- url: this.current_prefix + "/wf_obj_config_item/list",
1718
- data: {
1719
- objTypeCode: code,
1720
- enabled: true,
1721
- objId: objId
1722
- },
1723
- method: "post",
1724
- //contentType: 'application/json;charset=utf-8',
1725
- async: false,
1726
- isLoading: true,
1727
- error: (error) => {
1728
- this.close();
1729
- },
1730
- success: (resultMsg) => {
1731
- wfDefItems = resultMsg.objx || [];
1732
- },
1733
- });
1734
-
1735
- if (!wfDefItems || wfDefItems.length == 0) {
1736
- that.$baseAlert(this.$t2('无法启动,没有流程单据', 'components.wf.startWarnMsg1'));
1737
- this.close();
1738
- return false;
1739
- }
1740
-
1741
- (this.wfStartForm = {
1742
- wfCode: code,
1743
- }),
1744
- (this.wfDefItems = wfDefItems);
1745
- this.$set(this.wfStartForm, "modelId", wfDefItems[0].modelId);
1746
- if (wfDefItems.length == 1) {
1747
- if (
1748
- settingConfig.withoutConfrimByOneWf === true ||
1749
- (this.option && this.option.skipStartConfirm)
1750
- ) {
1751
- this.startSubmit();
1752
- } else {
1753
- let customStartTip = this.option && this.option.startConfirmText;
1754
- if (typeof customStartTip === "function") {
1755
- customStartTip = await customStartTip.call(
1756
- this.parentVue || this,
1757
- {
1758
- objId: this.dataId,
1759
- wfCode: this.code,
1760
- formCode: this.formCode,
1761
- startParam: this.startParam,
1762
- }
1763
- );
1764
- }
1765
- let wfStartOperateName =
1766
- settingConfig.wfStartOperateName ||
1767
- settingConfig.wfStartButtonName ||
1768
- "启动流程";
1769
- let defaultStartTip = "您确定要" + wfStartOperateName + "吗?";
1770
- let startTip;
1771
- if (typeof customStartTip === "string" && customStartTip.trim()) {
1772
- startTip = customStartTip;
1773
- } else {
1774
- startTip = this.$t2(defaultStartTip, 'components.wf.startTip');
1775
- }
1776
- that
1777
- .$baseConfirm(startTip)
1778
- .then(() => {
1779
- this.startSubmit();
1780
- });
1781
- }
1782
- } else {
1783
- this.showDialog = true;
1784
- }
1785
- },
1786
- startSubmit() {
1787
- var modelId = this.wfStartForm.modelId;
1788
- if (!modelId) {
1789
- that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1790
- return false;
1791
- }
1792
- let option = this.option;
1793
- if (option.onBeforeStartSubmit) {
1794
- option.onBeforeStartSubmit(() => {
1795
- this.subWfStartForm();
1796
- })
1797
- } else {
1798
- this.subWfStartForm();
1799
- }
1800
- },
1801
- async subWfStartForm() {
1802
- let that = getTarget(this);
1803
- var modelId = this.wfStartForm.modelId;
1804
- if (!modelId) {
1805
- that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1806
- return false;
1807
- }
1808
-
1809
- let option = this.option;
1810
-
1811
- var objId = this.dataId;
1812
-
1813
- let startParam = this.startParam || {};
1814
- let formCode = this.formCode || null;
1815
-
1816
- var data = {
1817
- modelId: modelId,
1818
- objTypeCode: this.code,
1819
- objId: objId,
1820
- formData: startParam,
1821
- formCode: formCode
1822
- // name:this.wfName
1823
- };
1824
- this.startFormData = data;
1825
-
1826
- if(this.wfUserRangeEnabled){
1827
- this.preStartResult = await this.preStart() || []
1828
- if(this.preStartResult.length){
1829
- this.openSetCandidateDialog()
1830
- return
1831
- }
1832
- }
1833
- this.startSubmitHanlde(this.startFormData);
1834
-
1835
- },
1836
- startSubmitHanlde(formData){
1837
- this.wfSubmitted = true; // 标记已进入提交,避免随后关闭弹框误判为「取消」
1838
- this.showDialog = false;
1839
- let that = getTarget(this);
1840
- let option = this.option;
1841
- that.$http({
1842
- url: this.current_prefix + "/wf/start",
1843
- data: formData,
1844
- method: "post",
1845
- /* headers: {
1846
- "Content-Type": "application/json;charset=utf-8",
1847
- }, */
1848
- isLoading: true,
1849
- callback: (resultMsg) => {
1850
- if (resultMsg.type == "success") {
1851
- that.$message({
1852
- message: resultMsg.content,
1853
- type: "success",
1854
- duration: 500,
1855
- onClose: (t) => {
1856
- if (!option.onStartSuccess) {
1857
- that.$baseReload();
1858
- } else {
1859
- option.onStartSuccess();
1860
- }
1861
- if (resultMsg.objx) {
1862
- that.$baseAlert(resultMsg.objx)
1863
- }
1864
- },
1865
- });
1866
- } else {
1867
- option.onStartFail && option.onStartFail()
1868
- }
1869
-
1870
- }
1871
- });
1872
- },
1873
- handleWfCancel() {
1874
- // 未进入提交就关闭 = 取消启动,回调通用 onCancel(一次性,避免多个弹框关闭重复触发)
1875
- if (this.wfSubmitted) return;
1876
- this.wfSubmitted = true;
1877
- this.option && this.option.onCancel && this.option.onCancel();
1878
- },
1879
- close() {
1880
- this.handleWfCancel();
1881
- this.$emit("update:visible", false);
1882
- },
1883
- },
1884
- watch: {
1885
- showSetCandidateDialog2(val, oldVal) {
1886
- // 候选人弹框未提交就关闭 = 取消启动
1887
- if (oldVal && !val) this.handleWfCancel();
1888
- },
1889
- },
1890
- };
1891
-
1892
- wfModifyMixin = {
1893
- name: "wfModifyMixin",
1894
- props: {
1895
- dataId: [String, Number],
1896
- code: [String, Number],
1897
- visible: Boolean,
1898
- paramData: Object,
1899
- parentVue: Object,
1900
- wfInfo: Object,
1901
- title: String
1902
- },
1903
- data() {
1904
- return {
1905
- showModifyDialog: false,
1906
- showBillEdit: false,
1907
- content: "",
1908
- };
1909
- },
1910
- async mounted() {
1911
- this.openWfModifyDialog(this.code);
1912
- },
1913
- methods: {
1914
- openWfModifyDialog() {
1915
- let row = this.paramData;
1916
- let url = row.url + ".vue";
1917
- this.showModifyDialog = true;
1918
- this.content = configUtil.requireView(url);
1919
- this.$openEditView("showBillEdit");
1920
- },
1921
- modfyDialogClose() {
1922
- this.showBillEdit = false;
1923
- this.content = null;
1924
- },
1925
- refreshEdit() {
1926
- this.showModifyDialog = false;
1927
- this.parentVue.$baseReload()
1928
- }
1929
- },
1930
- };
1931
-
1932
- wfUrgingMixin = {
1933
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
1934
- mixins: [selectDialogMixins],
1935
- created() {
1936
- this.initSetting();
1937
- },
1938
- mounted() {
1939
- this.initTableM1();
1940
- },
1941
- data() {
1942
- return {
1943
- showDialog: true,
1944
- selectMulti: true,
1945
- vxeOption: {},
1946
- };
1947
- },
1948
- methods: {
1949
- initTableM1() {
1950
- var that = this;
1951
- let tableOption = {
1952
- vue: that,
1953
- tableRef: "table-m1",
1954
- tableName: "wf_urgingDialog-m1",
1955
- path: this.current_prefix + "/wf/getTaskCandidates",
1956
- param: () => {
1957
- return {stringOne: this.wfInfo.uuid};
1958
- },
1959
- config: {
1960
- checkboxConfig: {
1961
- checkStrictly: true,
1962
- showHeader: this.selectMulti,
1963
- trigger: "row",
1964
- },
1965
- proxyConfig: {
1966
- props: {
1967
- result: "objx", // 配置响应结果列表字段
1968
- total: "objx.length", // 配置响应结果总页数字段
1969
- },
1970
- },
1971
- },
1972
- columns: [
1973
- {type: "checkbox", width: 50, resizable: false, fixed: "left"},
1974
- {title: this.$t2('催办人', 'components.wf.urgingUser'), field: "name", width: 250, fixed: "left"},
1975
- {title: this.$t2('催办人ID', 'components.wf.urgingUserId'), field: "id", width: 150},
1976
- {
1977
- width: 47,
1978
- fixed: "right",
1979
- title: "",
1980
- sortable: false,
1981
- },
1982
- ],
1983
- };
1984
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1985
- that.vxeOption = opts;
1986
- });
1987
- },
1988
- dialogConfirm() {
1989
- this.dialogPrimary();
1990
- this.$emit("confirm");
1991
- },
1992
- subUrgingForm() {
1993
- let that = this;
1994
- let urgingUserIds = this.checkRows.map((checkRow) => checkRow.id);
1995
- if (urgingUserIds.length == 0) {
1996
- that.$message({
1997
- message: this.$t2('请选择催办人', 'components.wf.urgingWarnMsg1'),
1998
- type: "error",
1999
- duration: 2000,
2000
- onClose: (t) => {
2001
- },
2002
- });
2003
- return false;
2004
- }
2005
- that.$baseConfirm(this.$t2('您确定要催办吗?', 'components.wf.urgingConfirmTip')).then(() => {
2006
- var data = JSON.stringify({
2007
- uuid: this.wfInfo.uuid,
2008
- taskId: this.wfInfo.taskId,
2009
- notifyType: "wfUrging",
2010
- userIds: urgingUserIds,
2011
- });
2012
- this.agreeDialogVisible = false;
2013
- that.$http({
2014
- url: this.current_prefix + "/wf/urging",
2015
- data: data,
2016
- method: "post",
2017
- loadingTarget: document.body,
2018
- headers: {
2019
- "Content-Type": "application/json;charset=utf-8",
2020
- },
2021
- isLoading: true,
2022
- success: (resultMsg) => {
2023
- that.$message({
2024
- message: resultMsg.content,
2025
- type: "success",
2026
- duration: 500,
2027
- onClose: (t) => {
2028
- // this.reloadContent();
2029
- this.dialogConfirm();
2030
- },
2031
- });
2032
- },
2033
- });
2034
- });
2035
- },
2036
- },
2037
- };
2038
-
2039
- deleteTaskUserMixin = {
2040
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2041
- mixins: [selectDialogMixins],
2042
- created() {
2043
- this.initSetting();
2044
- },
2045
- mounted() {
2046
- this.initTableM1();
2047
- },
2048
- data() {
2049
- return {
2050
- showDialog: true,
2051
- selectMulti: true,
2052
- vxeOption: {},
2053
- };
2054
- },
2055
- methods: {
2056
- initTableM1() {
2057
- var that = this;
2058
- let tableOption = {
2059
- vue: that,
2060
- tableRef: "table-m1",
2061
- tableName: "wf_deleteTaskUserDialog-m1",
2062
- path: this.current_prefix + "/wf/getIncreaseSign",
2063
- param: () => {
2064
- return {
2065
- uuid: this.wfInfo.uuid,
2066
- taskId: this.wfInfo.taskId,
2067
- };
2068
- },
2069
- config: {
2070
- checkboxConfig: {
2071
- checkStrictly: true,
2072
- showHeader: this.selectMulti,
2073
- trigger: "row",
2074
- },
2075
- proxyConfig: {
2076
- props: {
2077
- result: "objx", // 配置响应结果列表字段
2078
- total: "objx.length", // 配置响应结果总页数字段
2079
- },
2080
- },
2081
- },
2082
- columns: [
2083
- {type: "checkbox", width: 50, resizable: false, fixed: "left"},
2084
- {title: this.$t2('候选人', 'components.wf.candidate'), field: "name", width: 250, fixed: "left"},
2085
- {title: this.$t2('候选人ID', 'components.wf.candidateId'), field: "id", width: 150},
2086
- {
2087
- width: 47,
2088
- fixed: "right",
2089
- title: "",
2090
- sortable: false,
2091
- },
2092
- ],
2093
- };
2094
- this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
2095
- that.vxeOption = opts;
2096
- });
2097
- },
2098
- dialogConfirm() {
2099
- this.dialogPrimary();
2100
- // this.$emit("confirm");
2101
- },
2102
- subForm() {
2103
- let that = this;
2104
- let userIds = this.checkRows.map((checkRow) => checkRow.id);
2105
- if (userIds.length == 0) {
2106
- that.$message({
2107
- message: this.$t2('请选择候选人', 'components.wf.deleteIncreaseSignWarnMsg1'),
2108
- type: "error",
2109
- duration: 2000,
2110
- onClose: (t) => {
2111
- },
2112
- });
2113
- return false;
2114
- }
2115
- that.$baseConfirm(this.$t2('您确定要减签选中的候选人吗?', 'components.wf.deleteIncreaseSignTip')).then(() => {
2116
- var data = JSON.stringify({
2117
- uuid: this.wfInfo.uuid,
2118
- taskId: this.wfInfo.taskId,
2119
- userIds: userIds,
2120
- });
2121
- this.agreeDialogVisible = false;
2122
- that.$http({
2123
- url: this.current_prefix + "/wf/deleteIncreaseSign",
2124
- data: data,
2125
- method: "post",
2126
- loadingTarget: document.body,
2127
- headers: {
2128
- "Content-Type": "application/json;charset=utf-8",
2129
- },
2130
- isLoading: true,
2131
- success: (resultMsg) => {
2132
- that.$message({
2133
- message: resultMsg.content,
2134
- type: "success",
2135
- duration: 500,
2136
- onClose: (t) => {
2137
- this.dialogConfirm();
2138
- },
2139
- });
2140
- },
2141
- });
2142
- });
2143
- },
2144
- },
2145
- };
2146
-
2147
- addTaskUserMixin = {
2148
- props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2149
- mixins: [selectDialogMixins],
2150
- data() {
2151
- return {
2152
- showDialog: true,
2153
- selectMulti: true,
2154
- vxeOption: {},
2155
- };
2156
- },
2157
- created() {
2158
- this.initSetting();
2159
- },
2160
- mounted() {
2161
- this.initTableM1();
2162
- },
2163
- methods: {
2164
- dialogConfirm() {
2165
- this.dialogPrimary();
2166
- // this.$emit('confirm');
2167
- },
2168
- subForm() {
2169
- let that = this;
2170
- let userIds = this.checkRows.map((checkRow) => checkRow.id);
2171
- if (userIds.length == 0) {
2172
- that.$message({
2173
- message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
2174
- type: "error",
2175
- duration: 2000,
2176
- onClose: (t) => {
2177
- },
2178
- });
2179
- return false;
2180
- }
2181
- that.$baseConfirm(this.$t2('您确定要加签选中的候选人吗?', 'components.wf.addIncreaseSignConfirmTip2')).then(() => {
2182
- var data = JSON.stringify({
2183
- uuid: this.wfInfo.uuid,
2184
- taskId: this.wfInfo.taskId,
2185
- userIds: userIds,
2186
- });
2187
- this.agreeDialogVisible = false;
2188
- that.$http({
2189
- url: this.current_prefix + "/wf/addIncreaseSign",
2190
- data: data,
2191
- method: "post",
2192
- loadingTarget: document.body,
2193
- headers: {
2194
- "Content-Type": "application/json;charset=utf-8",
2195
- },
2196
- isLoading: true,
2197
- success: (resultMsg) => {
2198
- that.$message({
2199
- message: resultMsg.content,
2200
- type: "success",
2201
- duration: 500,
2202
- onClose: (t) => {
2203
- this.dialogConfirm();
2204
- },
2205
- });
2206
- },
2207
- });
2208
- });
2209
- },
2210
- },
2211
- };
2212
-
2213
- export {
2214
- wfIndexMixin,
2215
- wfStartMixin,
2216
- wfContentMixin,
2217
- wfModifyMixin,
2218
- wfUrgingMixin,
2219
- deleteTaskUserMixin,
2220
- addTaskUserMixin,
2221
- };
1
+ /**version-1.0*/
2
+ import {getToken} from "../../utils/auth";
3
+ import settingConfig from "@/settings.js";
4
+ import {selectDialogMixins} from "../../mixins/selectDialog";
5
+
6
+ let configUtil = {
7
+ baseUrl: process.env.VUE_APP_BASE_API,
8
+ getToken,
9
+ requireView: (url) => {
10
+ return require("@/views" + url).default;
11
+ },
12
+ };
13
+
14
+ let wfIndexMixin,
15
+ wfStartMixin,
16
+ wfContentMixin,
17
+ wfModifyMixin,
18
+ wfUrgingMixin,
19
+ deleteTaskUserMixin,
20
+ addTaskUserMixin;
21
+
22
+ function getTarget(t, flag) {
23
+ let target;
24
+ if (t.parentVue) {
25
+ target = t.parentVue;
26
+ } else if (flag === 0) {
27
+ target = t.$parent.$parent;
28
+ } else {
29
+ target = t.$parent.$parent.$parent;
30
+ }
31
+ return target;
32
+ }
33
+
34
+ function oaPublishEvent(that) {
35
+ let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
36
+ if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
37
+ let win = window.opener;
38
+ if (win && domain && domain.call) {
39
+ var event = {type: "topic", name: "successReloadPage"};
40
+ domain.call(win, 'fireEvent', [event]);
41
+ }
42
+ }
43
+ }
44
+
45
+ wfIndexMixin = {
46
+ name: "wfView",
47
+ props: {
48
+ objId: [String, Number],
49
+ wfCode: String,
50
+ serviceId: String,
51
+ },
52
+ data() {
53
+ return {
54
+ wfReloadFlag: false,
55
+ hasWf: false,
56
+ wfStartVisible: false,
57
+ paramData: "",
58
+ showModifyDialog: false,
59
+ showBillEdit: false,
60
+ content: "",
61
+ wfInfo: "",
62
+ currentTask: "",
63
+ taskParam: "",
64
+ };
65
+ },
66
+ computed: {
67
+ current_prefix() {
68
+ return this.serviceId ? "/" + this.serviceId : "";
69
+ },
70
+ },
71
+ created() {
72
+ },
73
+ watch: {
74
+ wfCode(val) {
75
+ this.getWfInfo();
76
+ },
77
+ objId(val) {
78
+ this.getWfInfo();
79
+ },
80
+ },
81
+ async mounted() {
82
+ if (this.objId) {
83
+ let hasWf = false;
84
+ let wfInfo, currentTask, taskParam;
85
+ await this.initWfInfo().then((res) => {
86
+ if (res && res.type == "success") {
87
+ if (res.objx && res.objx.procInstId) {
88
+ hasWf = true;
89
+ wfInfo = res.objx;
90
+ }
91
+ }
92
+ });
93
+
94
+ if (hasWf) {
95
+ /* await this.getCurrentTask(wfInfo).then(res1 => {
96
+ if (res1.type == 'success') {
97
+ currentTask = res1.objx;
98
+ }
99
+ }); */
100
+ /* if (wfInfo.taskId) {
101
+ await this.getTaskParams(currentTask).then(res2 => {
102
+ if (res2.type == 'success') {
103
+ taskParam = res2.objx;
104
+ }
105
+ });
106
+ } */
107
+ }
108
+ this.paramData = taskParam;
109
+ this.wfInfo = wfInfo;
110
+ this.currentTask = currentTask;
111
+ this.taskParam = taskParam;
112
+
113
+ let flag = true;
114
+ this.$emit("onShow", {
115
+ wfInfo: wfInfo,
116
+ currentTask: currentTask,
117
+ taskParam: taskParam,
118
+ hasWf: hasWf,
119
+ callback: (val) => {
120
+ flag = false;
121
+ if (val !== false && hasWf) {
122
+ this.wfReloadFlag = true;
123
+ }
124
+ },
125
+ });
126
+ if (flag) {
127
+ if (hasWf) {
128
+ this.wfReloadFlag = true;
129
+ }
130
+ }
131
+ }
132
+ this.$on("toDo", (option) => {
133
+ this.$emit(option.methd, option.param);
134
+ });
135
+ },
136
+ methods: {
137
+ getWfInfo() {
138
+ if (this.wfCode && this.objId) {
139
+ this.reload();
140
+ } else {
141
+ this.wfReloadFlag = false;
142
+ }
143
+ },
144
+ openStartWfDialog(code) {
145
+ this.wfStartVisible = true;
146
+ },
147
+ reload() {
148
+ this.wfReloadFlag = false;
149
+ this.$nextTick(() => {
150
+ this.wfReloadFlag = true;
151
+ });
152
+ },
153
+ manualCallback() {
154
+ this.$emit("manualCallback");
155
+ },
156
+ async getCurrentTask(obj) {
157
+ let that = getTarget(this, 0);
158
+ return that.$http({
159
+ url: "/agilebpm/wf_task/getCurrentTask",
160
+ data: {
161
+ procInstId: obj.procInstId,
162
+ },
163
+ method: "post",
164
+ async: false,
165
+ isLoading: true,
166
+ modalStrictly: true,
167
+ });
168
+ },
169
+ async initWfInfo() {
170
+ let that = getTarget(this, 0);
171
+ let id = this.objId;
172
+ let code = this.wfCode;
173
+ return that.$http({
174
+ url: this.current_prefix + "/wf/getWfInfo",
175
+ method: `post`,
176
+ data: {
177
+ objTypeCode: code,
178
+ objId: id,
179
+ },
180
+ isLoading: true,
181
+ modalStrictly: true,
182
+ });
183
+ },
184
+ async getTaskParams(data) {
185
+ let that = getTarget(this, 0);
186
+ return that.$http({
187
+ url: "/agilebpm/wf_task/getTaskParams",
188
+ method: `post`,
189
+ data: {
190
+ taskId: data.taskId,
191
+ },
192
+ isLoading: true,
193
+ modalStrictly: true,
194
+ });
195
+ },
196
+ openWfModifyDialog() {
197
+ let row = this.paramData;
198
+ let url = row.url + ".vue";
199
+ this.showModifyDialog = true;
200
+ this.content = configUtil.requireView(url);
201
+ this.$openEditView("showBillEdit");
202
+ },
203
+ modfyDialogClose() {
204
+ this.showBillEdit = false;
205
+ this.content = null;
206
+ },
207
+ },
208
+ };
209
+
210
+ wfContentMixin = {
211
+ name: "wfContent",
212
+ props: {
213
+ objId: [String, Number],
214
+ wfCode: String,
215
+ serviceId: String,
216
+ _wfInfo: Object,
217
+ _taskParam: Object,
218
+ parentVue: Object,
219
+ wfConfig: Object,
220
+ defaultShowWfContent: Boolean,
221
+ },
222
+ computed: {
223
+ current_prefix() {
224
+ return this.serviceId ? "/" + this.serviceId : "";
225
+ },
226
+ viewTarget() {
227
+ return getTarget(this);
228
+ },
229
+ isHideWf() {
230
+ let that = this.viewTarget;
231
+ let _hideWf = that._hideWf || that.$attrs._hideWf;
232
+ return _hideWf === true || _hideWf === 'true';
233
+ }
234
+ },
235
+ data() {
236
+ let showWfFold =
237
+ settingConfig.showWfFold != null && settingConfig.showWfFold != undefined
238
+ ? settingConfig.showWfFold
239
+ : false;
240
+ if (this.wfConfig.showWfFold != null && this.wfConfig.showWfFold != undefined) {
241
+ showWfFold = this.wfConfig.showWfFold;
242
+ }
243
+ let showWfContent =
244
+ showWfFold &&
245
+ settingConfig.defaultShowWfContent != null &&
246
+ settingConfig.defaultShowWfContent != undefined
247
+ ? settingConfig.defaultShowWfContent
248
+ : true;
249
+ if (
250
+ this.defaultShowWfContent != null &&
251
+ this.defaultShowWfContent != undefined
252
+ ) {
253
+ showWfContent = this.defaultShowWfContent;
254
+ }
255
+
256
+ return {
257
+ fileInfos: [],
258
+ showUserDialog: false,
259
+ showContent: true,
260
+ objTypeCode: "",
261
+ // objId: '',
262
+ wfInfo: {},
263
+ // currentTask: {},
264
+ taskParam: {},
265
+ wfImage: "",
266
+ wfStartBtn: false,
267
+ wfManualendBtn: false,
268
+ wfSubmitBtn: false,
269
+ wfRejectBtn: false,
270
+ changeHandlerBtn: false,
271
+ wftaskData: [],
272
+ allWfTaskOpinions: [],
273
+ vxeOption: {},
274
+ rejectNodes: [],
275
+ rejectDialogVisible: false,
276
+ rejectForm: {
277
+ rejectSubmitModel: null,
278
+ nodeId: null,
279
+ opinion: null,
280
+ },
281
+ formLabelWidth: "120px",
282
+ agreeDialogVisible: false,
283
+ agreeForm: {
284
+ opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
285
+ nodeId: null,
286
+ },
287
+ changeWfDialogVisible: false,
288
+ changeWfForm: {},
289
+ changeUserRows: [],
290
+ taskStatuses: {
291
+ start: {
292
+ class: "blue",
293
+ value: this.$t2('开始', 'components.wf.startStatus'),
294
+ },
295
+ approve: {
296
+ class: "orgn",
297
+ value: this.$t2('待审批', 'components.wf.approveStatus'),
298
+ },
299
+ submit: {
300
+ class: "green",
301
+ value: this.$t2('同意', 'components.wf.submitStatus'),
302
+ },
303
+ reject: {
304
+ class: "red",
305
+ value: this.$t2('驳回', 'components.wf.rejectStatus'),
306
+ },
307
+ transfer: {
308
+ class: "green",
309
+ value: this.$t2('转办', 'components.wf.transferStatus'),
310
+ },
311
+ addIncreaseSign: {
312
+ class: "green",
313
+ value: this.$t2('加签', 'components.wf.addIncreaseSignStatus'),
314
+ },
315
+ revoke: {
316
+ class: "red",
317
+ value: this.$t2('撤回', 'components.wf.revokeStatus'),
318
+ },
319
+ end: {
320
+ class: "gray",
321
+ value: this.$t2('结束', 'components.wf.endStatus'),
322
+ },
323
+ },
324
+ opinion: "",
325
+ showWfFold: showWfFold,
326
+ showWfContent: showWfContent,
327
+
328
+ urgingForm: {},
329
+ urgingDialogVisible: false,
330
+ urgingUserIds: [],
331
+ urgingUsers: [],
332
+ agreeNodes: [],
333
+ showWfManualDialog: false,
334
+
335
+ showDeleteTaskUserDialog: false,
336
+ showAddTaskUserDialog: false,
337
+ wfUserParam: {},
338
+ wfUserParamForTransfer: {},//转办
339
+ wfUserParamForAddSign: {},//加签
340
+ wfUserParamForTalk: {},//沟通
341
+ tabIndex: "1",
342
+ linkupOption: {},
343
+ talkForm: {
344
+ receiverName: null,
345
+ content: null,
346
+ attachmentDTOs: [],
347
+ replyId: null
348
+ },
349
+ showTalkUserDialog: false,
350
+ showTalkDialog: false,
351
+ showFlowImg: true,
352
+ operateType: null,
353
+ addIncreaseSignUsers: [],
354
+ addIncreaseSignForm: {
355
+ userNickNames: null,
356
+ opinion: null
357
+ },
358
+ showAddIncreaseSignDialog: false,
359
+ showOpeaImg: true,
360
+ showSetCandidateDialog: false,
361
+ toTalk: false,
362
+ showAllWfOpinon: false,
363
+
364
+ revokeDialogVisible: false,
365
+ revokeForm: {opinion: null},
366
+ showWfInfoTab: false,
367
+
368
+ showWfMemo:false,
369
+ wfMemoOption: {},
370
+ wfMemoForm: {
371
+ receiverName: null,
372
+ content: null,
373
+ attachmentDTOs: [],
374
+ replyId: null
375
+ },
376
+ showWfMemoDialog: false,
377
+ wfMemoData:[],
378
+
379
+ showCandidate: false,
380
+ candidateOption:{},
381
+ candidateDatas:[],
382
+ wfSendTaskId: null,
383
+ showAddOpinionButton: false,
384
+
385
+ addOpinionEnabled: false,
386
+ modifyCurrentCandidateEnabled: false,
387
+
388
+ //修改脚本
389
+ showWfFlowEleScriptDialog: false
390
+ };
391
+ },
392
+ provide() {
393
+ return {
394
+ getParentVue: () => this.parentVue,
395
+ getWfInfo: () => this.wfInfo,
396
+ getCurrentPrefix: () => this.current_prefix,
397
+ getEditVueTarget: ()=> getTarget(this)
398
+ };
399
+ },
400
+ created() {
401
+ this.wfInfo = this._wfInfo;
402
+ this.showFlowImg = settingConfig.expandWfImage === false ? false : true;
403
+ this.showAllWfOpinon = settingConfig.showAllWfOpinon === true;
404
+ },
405
+ mounted() {
406
+ this.initOperateType();
407
+ this.initForAll();
408
+ },
409
+ methods: {
410
+ openWfFlowEleScriptDialog(){
411
+ this.showWfFlowEleScriptDialog = true
412
+ },
413
+ initWfParam13(){
414
+ //初始化补充意见权限
415
+ let that = getTarget(this);
416
+ return that.$http({
417
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
418
+ method: `post`,
419
+ data: {attributeKey: "param13"},
420
+ success: (res) => {
421
+ this.addOpinionEnabled = res?.objx === true;
422
+ if(this.addOpinionEnabled){
423
+ this.wfSendTaskId = this.getViewParam('wfSendTaskId');
424
+ this.showAddOpinionButton = !!this.wfSendTaskId;
425
+ }
426
+ },
427
+ });
428
+ },
429
+
430
+ initWfParam14(){
431
+ //初始化修改当前候选人权限
432
+ let that = getTarget(this);
433
+ return that.$http({
434
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
435
+ method: `post`,
436
+ data: {attributeKey: "param14"},
437
+ success: (res) => {
438
+ this.modifyCurrentCandidateEnabled = res?.objx === true;
439
+ },
440
+ });
441
+ },
442
+ getViewParam(key){
443
+ let that = this.viewTarget;
444
+ let value = that[key] || that.$attrs[key];
445
+ return value;
446
+ },
447
+ initCandidate(){
448
+ // 是否显示"节点候选人"选项卡
449
+ let that = getTarget(this);
450
+ that.$http({
451
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
452
+ method: `post`,
453
+ data: {attributeKey: "param11"},
454
+ isLoading: true,
455
+ success: (res) => {
456
+ this.showCandidate = res?.objx === true;
457
+ if(this.showCandidate){
458
+ this.$nextTick(()=>{
459
+ this.initCandidateTable();
460
+ })
461
+ }
462
+ },
463
+ });
464
+ },
465
+ initCandidateTable(){
466
+ let that = this;
467
+ let tableOption = {
468
+ vue: that,
469
+ tableRef: 'table-candidate',
470
+ tableName: 'wf_candidate-list',
471
+ path: this.current_prefix + '/wf/getAllNodes',
472
+ param: () => {
473
+ return {
474
+ stringOne: this.wfInfo.uuid
475
+ }
476
+ },
477
+ config: {
478
+ height: 350,
479
+ proxyConfig: {
480
+ props: {
481
+ result: "objx", // 配置响应结果列表字段
482
+ total: "objx.length", // 配置响应结果总页数字段
483
+ },
484
+ },
485
+ pagerConfig:{
486
+ autoHidden: true
487
+ }
488
+ },
489
+ columns: [
490
+ {type: 'checkbox', width: 50, resizable: false, fixed: 'left'},
491
+ {title: this.$t2('节点名称', 'components.wf.nodeName'), field: 'nodeName', width: 250, fixed: 'left'},
492
+ {
493
+ field: 'wfTaskCandidates',
494
+ title: this.$t2('候选人', 'components.wf.candidate'),
495
+ width: 450,
496
+ slots: {
497
+ default: ({row, rowIndex}) => {
498
+ return row.wfTaskCandidateDTOs ? row.wfTaskCandidateDTOs.map(item => item.name).join(",") : null;
499
+ },
500
+ },
501
+ },
502
+ {
503
+ width: 47,
504
+ fixed: 'right',
505
+ title: '',
506
+ sortable: false,
507
+ }
508
+ ]
509
+ };
510
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
511
+ that.candidateOption = opts;
512
+ });
513
+ },
514
+ initOperateType() {
515
+ if (this.operateType) {
516
+ let wfInfo = this.wfInfo;
517
+ if (wfInfo.toSubmit) {
518
+ this.openAgreeDialog('submit');
519
+ } else if (wfInfo.toReject) {
520
+ this.rejectWfTask('reject');
521
+ } else if (wfInfo.toAddIncreaseSign) {
522
+ this.openAddIncreaseSign('addIncreaseSign')
523
+ } else if (wfInfo.toRevoke) {
524
+ this.openRevokeDialog('revoke')
525
+ } else if (wfInfo.toLinkup) {
526
+ this.openTalkDialog(null, null, 'talk');
527
+ } else {
528
+ this.operateType = null;
529
+ }
530
+ }
531
+ },
532
+ initForAll() {
533
+ let that = getTarget(this);
534
+ this.initWf(() => {
535
+ if (this.wfInfo.procInstId) {
536
+ this.initCurrentTask(this.wfInfo.procInstId, () => {
537
+ this.initWftask(this.wfInfo.procInstId);
538
+ this.getAllWfTaskOpinions();
539
+ });
540
+ this.initWfUserParam();
541
+ this.initTabIndex();
542
+ this.initShowTaskInfo();
543
+ //初始化附言
544
+ this.getIsShowWfMemo();
545
+ // 是否显示"节点候选人"选项卡
546
+ this.initCandidate()
547
+
548
+ //初始化补充意见权限
549
+ this.initWfParam13();
550
+
551
+ //初始化修改当前候选人权限
552
+ this.initWfParam14();
553
+
554
+ }
555
+ });
556
+ },
557
+ initTabIndex() {
558
+ let that = getTarget(this);
559
+ that.$http({
560
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
561
+ method: `post`,
562
+ data: {attributeKey: "param7"},
563
+ isLoading: true,
564
+ success: (res) => {
565
+ let val = res !== null ? res.objx === true : false;
566
+ this.toTalk = val;
567
+ let flag = false;
568
+ if (val) {
569
+ let flag1 = that.$attrs._isNotifyMessage == true || that.$attrs._isNotifyMessage == "true";
570
+ if (flag1) {
571
+ this.tabIndex = "2";
572
+ }
573
+ if (settingConfig.autoOpenWfLinkup) {
574
+ flag = true;
575
+ let flag2 = that.$attrs._wfNotifyType == "wfLinkup";
576
+ let flag3 = flag1 && flag2;
577
+ if (flag3) {
578
+ this.$nextTick(() => {
579
+ let wfTabPane = this.$refs.wfTabPane;
580
+ if (!wfTabPane.showContent) {
581
+ wfTabPane.handleFold();
582
+ }
583
+ });
584
+ }
585
+ }
586
+ }
587
+ this.initLinkup(flag);
588
+ }
589
+ });
590
+
591
+ },
592
+ initWf(done) {
593
+ var data = this.wfInfo;
594
+ if (data && data.procInstId) {
595
+ /** 流程状态:0未启动,1审核中,2已完成,3驳回,4中断 */
596
+ var statuses = {
597
+ 1: '<span class="tag">' + this.$t2('审核中', 'components.wf.wfStatus1') + '</span>',
598
+ 3: '<span class="tag red">' + this.$t2('已驳回', 'components.wf.wfStatus2') + '</span>',
599
+ 2: '<span class="tag green">' + this.$t2('已完成', 'components.wf.wfStatus3') + '</span>',
600
+ };
601
+ var statusStr = "";
602
+ if (data.stat != null) {
603
+ statusStr = statuses[data.stat] || "";
604
+ }
605
+ data.statusStr = statusStr;
606
+ this.wfInfo = data;
607
+
608
+ this.wfStartBtn = false;
609
+ if (data.status != 2 && data.starterId) {
610
+ this.wfManualendBtn = true;
611
+ }
612
+ this.wfSubmitBtn = false;
613
+ this.wfRejectBtn = false;
614
+
615
+ var url =
616
+ this.current_prefix +
617
+ "/wf/flowImage?procInstId=" +
618
+ data.procInstId +
619
+ "&_r=" +
620
+ Math.random() +
621
+ "&access_token=" +
622
+ configUtil.getToken();
623
+ this.wfImage = configUtil.baseUrl + url;
624
+ done();
625
+ }
626
+ },
627
+ initCurrentTask(procInstId, done) {
628
+ if (this.wfInfo.taskId) {
629
+ this.wfSubmitBtn = true;
630
+ this.wfRejectBtn = true;
631
+ this.changeHandlerBtn = true;
632
+ }
633
+ done();
634
+ },
635
+ initWftask(procInstId) {
636
+ let that = getTarget(this);
637
+ that.$http({
638
+ url: this.current_prefix + "/wf/getWfTaskOpinionMerge",
639
+ data: {
640
+ stringOne: procInstId,
641
+ },
642
+ method: "post",
643
+ async: false,
644
+ isLoading: true,
645
+ modalStrictly: true,
646
+ success: (resultmsg) => {
647
+ var datas = resultmsg.objx || [];
648
+ this.wftaskData = datas;
649
+ },
650
+ });
651
+ },
652
+ getAllWfTaskOpinions() {
653
+ if (!this.showAllWfOpinon) {
654
+ return;
655
+ }
656
+ let that = getTarget(this);
657
+ let wfInfo = this.wfInfo;
658
+ that.$http({
659
+ url: this.current_prefix + "/wf/getAllWfTaskOpinions",
660
+ data: {
661
+ objId: wfInfo.objId,
662
+ objTypeCode: wfInfo.objTypeCode
663
+ },
664
+ method: "post",
665
+ async: false,
666
+ isLoading: true,
667
+ modalStrictly: true,
668
+ success: (resultmsg) => {
669
+ var datas = resultmsg.objx || [];
670
+ this.allWfTaskOpinions = datas;
671
+ },
672
+ });
673
+ },
674
+ openManualDialog(operateType) {
675
+ this.operateType = operateType;
676
+ this.showWfManualDialog = true;
677
+ },
678
+ manualEndWf() {
679
+ this.showWfManualDialog = false;
680
+ let that = getTarget(this);
681
+ var procInstId = this.wfInfo.procInstId;
682
+ var taskId = this.wfInfo.taskId ? this.wfInfo.taskId : "";
683
+ var data = JSON.stringify({
684
+ uuid: this.wfInfo.uuid,
685
+ });
686
+ that.$http({
687
+ url: this.current_prefix + "/wf/interrupt",
688
+ data: data,
689
+ method: "post",
690
+ headers: {
691
+ "Content-Type": "application/json;charset=utf-8",
692
+ },
693
+ isLoading: true,
694
+ success: (resultMsg) => {
695
+ that.$message({
696
+ message: resultMsg.content,
697
+ type: "success",
698
+ duration: 500,
699
+ onClose: (t) => {
700
+ this.reloadContent();
701
+ this.closeWinOnCheck(3);
702
+ },
703
+ });
704
+ },
705
+ });
706
+ },
707
+ async rejectWfTask(operateType) {
708
+ this.handleReminderContent("rejectReminder", async ()=>{
709
+ let that = getTarget(this);
710
+ var procInstId = this.wfInfo.procInstId;
711
+ var taskId = this.wfInfo.taskId;
712
+ var destinations = [];
713
+
714
+ await that.$http({
715
+ url: this.current_prefix + "/wf/getPreIncomeNodes",
716
+ data: {
717
+ stringOne: taskId,
718
+ },
719
+ method: "post",
720
+ //contentType: 'application/json;charset=utf-8',
721
+ async: false,
722
+ isLoading: true,
723
+ success: (resultMsg) => {
724
+ destinations = (resultMsg.objx || []).reverse();
725
+ },
726
+ });
727
+
728
+ if (destinations == null) {
729
+ return false;
730
+ }
731
+ if (destinations.length == 0) {
732
+ that.$message({
733
+ message: this.$t2('无法驳回,没有目标节点', 'components.wf.rejectWarnMsg1'),
734
+ type: "error",
735
+ duration: 2 * 1000,
736
+ });
737
+ return false;
738
+ }
739
+ this.operateType = operateType;
740
+ let rejectSubmitModel = null;
741
+ if (this.wfInfo.toNextNode === 1) {
742
+ rejectSubmitModel = this.wfInfo.toNextNode
743
+ } else {
744
+ rejectSubmitModel = this.wfInfo.toRejectNode == false ? 2 : null
745
+ }
746
+ this.rejectForm.rejectSubmitModel = rejectSubmitModel;
747
+ this.rejectForm.nodeId = destinations[0].nodeId;
748
+ this.rejectForm.opinion = "";
749
+ this.rejectNodes = destinations;
750
+ this.rejectDialogVisible = true;
751
+ })
752
+
753
+ },
754
+ subRejectForm() {
755
+ let that = getTarget(this);
756
+ var procInstId = this.wfInfo.procInstId;
757
+ var taskId = this.wfInfo.taskId;
758
+
759
+ if (!this.rejectForm.nodeId) {
760
+ that.$message({
761
+ message: this.$t2('请选择驳回节点', 'components.wf.rejectWarnMsg2'),
762
+ type: "error",
763
+ duration: 2 * 1000,
764
+ });
765
+ return false;
766
+ }
767
+
768
+ if (!this.rejectForm.opinion) {
769
+ that.$message({
770
+ message: this.$t2('请输入驳回意见', 'components.wf.rejectWarnMsg3'),
771
+ type: "error",
772
+ duration: 2 * 1000,
773
+ });
774
+ return false;
775
+ }
776
+
777
+ var data = JSON.stringify({
778
+ taskId: taskId,
779
+ uuid: this.wfInfo.uuid,
780
+ nodeId: this.rejectForm.nodeId,
781
+ suggestion: this.rejectForm.opinion,
782
+ rejectSubmitModel: this.rejectForm.rejectSubmitModel
783
+ });
784
+ this.rejectDialogVisible = false;
785
+ that.$http({
786
+ url: this.current_prefix + "/wf/reject",
787
+ data: data,
788
+ method: "post",
789
+ headers: {
790
+ "Content-Type": "application/json;charset=utf-8",
791
+ },
792
+ isLoading: true,
793
+ success: (resultMsg) => {
794
+ that.$message({
795
+ message: resultMsg.content,
796
+ type: "success",
797
+ duration: 500,
798
+ onClose: (t) => {
799
+ this.reloadContent();
800
+ this.closeWinOnCheck(2);
801
+ },
802
+ });
803
+ },
804
+ });
805
+ },
806
+ handleReminderContent(scriptType, callback){
807
+ let that = getTarget(this);
808
+ that.$http({
809
+ url: this.current_prefix + "/wf/getReminderContent",
810
+ data: {
811
+ scriptType,
812
+ taskId: this.wfInfo.taskId,
813
+ uuid: this.wfInfo.uuid,
814
+ },
815
+ method: "post",
816
+ isLoading: true,
817
+ errorMsg: false,
818
+ success: (res) => {
819
+ if(res.objx){
820
+ that.$baseConfirm(res.objx).then(() => {
821
+ callback && callback();
822
+ });
823
+ }else{
824
+ callback && callback();
825
+ }
826
+ },
827
+ error: (e) => {
828
+ if(e.response.status === 404){
829
+ callback && callback();
830
+ }else{
831
+ that.$errorMsg({
832
+ content: e.message,
833
+ type: 'error',
834
+ });
835
+ }
836
+ },
837
+ });
838
+ },
839
+ openAgreeDialog(operateType) {
840
+ const done = () => {
841
+ this.handleReminderContent("submitReminder", ()=>{
842
+ this.operateType = operateType;
843
+ let that = getTarget(this);
844
+ this.agreeForm = {
845
+ opinion: this.$t2('同意', 'components.wf.defaultAgreeOption'),
846
+ nodeId: null,
847
+ };
848
+ this.agreeNodes = [];
849
+ that.$http({
850
+ url: this.current_prefix + "/wf/getNextOutgoingNodes",
851
+ data: {
852
+ stringOne: this.wfInfo.taskId,
853
+ },
854
+ method: "post",
855
+ async: false,
856
+ isLoading: true,
857
+ success: (res) => {
858
+ let nodes = res.objx || [];
859
+ /*if (tq == true) {
860
+ nodes.reverse();
861
+ }*/
862
+ if (nodes.length) {
863
+ this.agreeForm.nodeId = nodes[0].nodeId;
864
+ }
865
+ this.agreeNodes = nodes;
866
+ this.agreeDialogVisible = true;
867
+ },
868
+ });
869
+ })
870
+ }
871
+ let wfConfig = this.wfConfig;
872
+ if (wfConfig.onClickAgree) {
873
+ wfConfig.onClickAgree(done)
874
+ } else {
875
+ done();
876
+ }
877
+ },
878
+ subAgreeForm() {
879
+ let wfConfig = this.wfConfig;
880
+ let done = () => {
881
+ this.subAgreeHandle();
882
+ }
883
+ if (wfConfig.onBeforeAgree) {
884
+ wfConfig.onBeforeAgree(done)
885
+ } else {
886
+ done();
887
+ }
888
+ },
889
+
890
+ subAgreeHandle() {
891
+ let that = getTarget(this);
892
+ let nodeId = null;
893
+ if (this.agreeNodes.length) {
894
+ if (!this.agreeForm.nodeId) {
895
+ that.$message({
896
+ message: this.$t2('请选择节点', 'components.wf.agreeWarnMsg1'),
897
+ type: "error",
898
+ duration: 2 * 1000,
899
+ });
900
+ return;
901
+ }
902
+ nodeId = this.agreeForm.nodeId;
903
+ }
904
+
905
+ var procInstId = this.wfInfo.procInstId;
906
+ var taskId = this.wfInfo.taskId;
907
+ var memo = this.agreeForm.opinion || this.$t2('同意', 'components.wf.defaultAgreeOption');
908
+ var data = JSON.stringify({
909
+ taskId: taskId,
910
+ uuid: this.wfInfo.uuid,
911
+ suggestion: memo,
912
+ nodeId: nodeId,
913
+ });
914
+ this.agreeDialogVisible = false;
915
+ that.$http({
916
+ url: this.current_prefix + "/wf/submit",
917
+ data: data,
918
+ method: "post",
919
+ headers: {
920
+ "Content-Type": "application/json;charset=utf-8",
921
+ },
922
+ isLoading: true,
923
+ success: (resultMsg) => {
924
+ if (resultMsg.objx && resultMsg.objx.code == "999999") {
925
+ this.errorSubmit({
926
+ taskId: taskId,
927
+ uuid: this.wfInfo.uuid,
928
+ suggestion: memo,
929
+ errorMsg: resultMsg.objx.errorMsg
930
+ });
931
+ } else {
932
+ that.$message({
933
+ message: resultMsg.content,
934
+ type: "success",
935
+ duration: 500,
936
+ onClose: (t) => {
937
+ this.reloadContent();
938
+ this.closeWinOnCheck(1);
939
+ },
940
+ });
941
+ }
942
+ },
943
+ });
944
+ },
945
+ errorSubmit(data) {
946
+ let that = getTarget(this);
947
+ that.$http({
948
+ url: this.current_prefix + "/wf/errorSubmit",
949
+ data: data,
950
+ method: "post",
951
+ isLoading: true,
952
+ success: (resultMsg) => {
953
+ that.$message({
954
+ message: resultMsg.content,
955
+ type: "success",
956
+ duration: 500,
957
+ onClose: (t) => {
958
+ this.reloadContent();
959
+ this.closeWinOnCheck(1);
960
+ },
961
+ });
962
+ },
963
+ });
964
+ },
965
+ openChangeWfForm(operateType) {
966
+ this.operateType = operateType;
967
+ this.changeWfDialogVisible = true;
968
+ this.changeUserRows = [];
969
+ this.changeWfForm = {
970
+ userIds: [],
971
+ userNickNames: null,
972
+ opinion: null,
973
+ };
974
+ },
975
+ subChangeWfForm() {
976
+ let that = getTarget(this);
977
+ var procInstId = this.wfInfo.procInstId;
978
+ var taskId = this.wfInfo.taskId;
979
+
980
+ var userIds = this.changeWfForm.userIds || [];
981
+ var opinion = this.changeWfForm.opinion || null;
982
+
983
+ if (!userIds.length) {
984
+ that.$message({
985
+ message: this.$t2('请选择转办人', 'components.wf.transferWarnMsg1'),
986
+ type: "error",
987
+ duration: 2000,
988
+ onClose: (t) => {
989
+ },
990
+ });
991
+ return false;
992
+ }
993
+
994
+ var data = JSON.stringify({
995
+ taskId: taskId,
996
+ uuid: this.wfInfo.uuid,
997
+ transferTo: userIds,
998
+ suggestion: opinion,
999
+ });
1000
+ this.changeWfDialogVisible = false;
1001
+ that.$http({
1002
+ url: this.current_prefix + "/wf/transfer",
1003
+ data: data,
1004
+ method: "post",
1005
+ headers: {
1006
+ "Content-Type": "application/json;charset=utf-8",
1007
+ },
1008
+ isLoading: true,
1009
+ success: (resultMsg) => {
1010
+ that.$message({
1011
+ message: resultMsg.content,
1012
+ type: "success",
1013
+ duration: 500,
1014
+ onClose: (t) => {
1015
+ this.reloadContent();
1016
+ this.closeWinOnCheck(4);
1017
+ },
1018
+ });
1019
+ },
1020
+ });
1021
+ },
1022
+ userConfirm(rows) {
1023
+ if (rows.length > 0) {
1024
+ let changeUserRows = this.changeUserRows;
1025
+ let ids = changeUserRows.map((changeUserRow) => changeUserRow.id);
1026
+ let addRows = rows.filter((row) => !ids.includes(row.id));
1027
+ changeUserRows.push(...addRows);
1028
+
1029
+ let row = rows[0];
1030
+ this.changeWfForm.userIds = changeUserRows.map(
1031
+ (changeUserRow) => changeUserRow.id
1032
+ );
1033
+ this.changeWfForm.userNickNames = changeUserRows
1034
+ .map((changeUserRow) => changeUserRow.nickName)
1035
+ .join(",");
1036
+ }
1037
+ },
1038
+ reloadContent() {
1039
+ let that = getTarget(this);
1040
+ oaPublishEvent(that);
1041
+ that.$baseReload();
1042
+ },
1043
+ closeWinOnCheck(flag) {
1044
+ //_closeWindowOnCheck=true, 1提交,2驳回,3中断,4转办时,5沟通 关闭窗口
1045
+ let that = getTarget(this);
1046
+ let _closeWindowOnCheck = that.$attrs._closeWindowOnCheck || that._closeWindowOnCheck;
1047
+ if (_closeWindowOnCheck === true || _closeWindowOnCheck === "true") {
1048
+ window.close && window.close();
1049
+ }
1050
+ let _handleCallback = that.$attrs._handleCallback || that._handleCallback;
1051
+ _handleCallback && _handleCallback(flag);
1052
+ },
1053
+ manualCallback() {
1054
+ this.$emit("manualCallback");
1055
+ },
1056
+ openUrgingDialog(operateType) {
1057
+ this.operateType = operateType;
1058
+ this.urgingDialogVisible = true;
1059
+ },
1060
+ openDeleteTaskUserDialog(operateType) {
1061
+ this.operateType = operateType;
1062
+ this.showDeleteTaskUserDialog = true;
1063
+ },
1064
+ openAddTaskUserDialog(operateType) {
1065
+ this.operateType = operateType;
1066
+ this.showAddTaskUserDialog = true;
1067
+ },
1068
+ openAddIncreaseSign(operateType) {
1069
+ this.operateType = operateType;
1070
+ this.addIncreaseSignUsers = [];
1071
+ this.addIncreaseSignForm = {userNickNames: null};
1072
+ this.showAddIncreaseSignDialog = true;
1073
+ },
1074
+ initWfUserParam(callback) {
1075
+ this.initTransferUserParam();//转办
1076
+ this.initAddSignUserParam();//加签
1077
+ this.initTalkUserParam();//沟通
1078
+ },
1079
+ //
1080
+ initTransferUserParam(callback) {
1081
+ //初始化转办用户参数
1082
+ let that = getTarget(this);
1083
+ return that.$http({
1084
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1085
+ method: `post`,
1086
+ data: {attributeKey: "param1"},
1087
+ isLoading: true,
1088
+ modalStrictly: true,
1089
+ success: (res) => {
1090
+ this.wfUserParamForTransfer = res.objx || {};
1091
+ callback && callback();
1092
+ },
1093
+ });
1094
+ },
1095
+ initAddSignUserParam(callback) {
1096
+ //初始化加签用户参数
1097
+ let that = getTarget(this);
1098
+ return that.$http({
1099
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1100
+ method: `post`,
1101
+ data: {attributeKey: "param2"},
1102
+ isLoading: true,
1103
+ modalStrictly: true,
1104
+ success: (res) => {
1105
+ this.wfUserParamForAddSign = res.objx || {};
1106
+ callback && callback();
1107
+ },
1108
+ });
1109
+ },
1110
+ initTalkUserParam(callback) {
1111
+ //初始化沟通用户参数
1112
+ let that = getTarget(this);
1113
+ return that.$http({
1114
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1115
+ method: `post`,
1116
+ data: {attributeKey: "param3"},
1117
+ isLoading: true,
1118
+ modalStrictly: true,
1119
+ success: (res) => {
1120
+ this.wfUserParamForTalk = res.objx || {};
1121
+ callback && callback();
1122
+ },
1123
+ });
1124
+ },
1125
+ //
1126
+ resetLinkup() {
1127
+ this.formData = {};
1128
+ this.$refs["table-linkup"].commitProxy("reload");
1129
+ },
1130
+ searchLinkup() {
1131
+ this.$refs["table-linkup"].commitProxy("reload");
1132
+ },
1133
+ initLinkup(flag) {
1134
+ let h = this.$createElement;
1135
+ let statusMap = {
1136
+ 0: this.$t2('未完成', 'components.wf.talkStatus0'),
1137
+ 1: this.$t2('已完成', 'components.wf.talkStatus1'),
1138
+ 2: this.$t2('已取消', 'components.wf.talkStatus2')
1139
+ };
1140
+ let tableOption = {
1141
+ vue: this,
1142
+ tableRef: "table-linkup",
1143
+ tableName: "wf_table-linkup",
1144
+ path: this.current_prefix + "/wf_linkup/listPage",
1145
+ param: () => {
1146
+ return {
1147
+ uuid: this.wfInfo.uuid,
1148
+ };
1149
+ },
1150
+ config: {
1151
+ height: 350
1152
+ },
1153
+ columns: [
1154
+ {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1155
+ {
1156
+ title: this.$t2('任务名称', 'components.wf.taskName'),
1157
+ field: "taskName",
1158
+ width: 150,
1159
+ fixed: "left",
1160
+ },
1161
+ {
1162
+ title: this.$t2('发送人', 'components.wf.senderName'),
1163
+ field: "senderName",
1164
+ width: 150,
1165
+ slots: {
1166
+ default: "sender",
1167
+ },
1168
+ },
1169
+ {
1170
+ title: this.$t2('接收人', 'components.wf.receiverName'),
1171
+ field: "receiverName",
1172
+ width: 150,
1173
+ slots: {
1174
+ default: "receiver",
1175
+ },
1176
+ },
1177
+ {
1178
+ title: this.$t2('沟通内容', 'components.wf.talkContent'),
1179
+ field: "content",
1180
+ width: 250,
1181
+ showOverflow: false,
1182
+ slots: {
1183
+ default: ({row, rowIndex}) => {
1184
+ return row.replyId ? ("[" + this.$t2('回复', 'components.wf.reply') + "]" + row.content) : row.content;
1185
+ },
1186
+ },
1187
+ },
1188
+ {
1189
+ width: 150,
1190
+ title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1191
+ field: "attachmentImage",
1192
+ sortable: false,
1193
+ slots: {
1194
+ default: ({row, rowIndex}) => {
1195
+ let option = {
1196
+ title: this.$t2('沟通资料', 'components.wf.talkAttachment'),
1197
+ edit: false,
1198
+ rows: (done) => {
1199
+ done(row.attachmentDTOs);
1200
+ },
1201
+ };
1202
+ return [
1203
+ h("base-attachment", {
1204
+ props: {
1205
+ option: option,
1206
+ imageLazy: false
1207
+ },
1208
+ }),
1209
+ ];
1210
+ },
1211
+ },
1212
+ },
1213
+
1214
+ {
1215
+ title: this.$t2('状态', 'components.wf.status'),
1216
+ field: "status",
1217
+ width: 150,
1218
+ slots: {
1219
+ default: ({row, rowIndex}) => {
1220
+ return statusMap[row.status] || "";
1221
+ },
1222
+ },
1223
+ },
1224
+ {
1225
+ title: this.$t2('创建时间', 'system.label.createDate'),
1226
+ field: "createDate",
1227
+ width: 150,
1228
+ },
1229
+ {
1230
+ width: 80,
1231
+ fixed: "right",
1232
+ title: "",
1233
+ sortable: false,
1234
+ slots: {
1235
+ default: "operate"
1236
+ }
1237
+ },
1238
+ ],
1239
+ callback: (rows) => {
1240
+ if (rows.length && flag) {
1241
+ let row = rows[0];
1242
+ if (row.replyToSender) {
1243
+ this.$nextTick(() => {
1244
+ this.tabIndex = "2";
1245
+ this.openTalkDialog(row.sender, row.senderName, 'talk', 1, row.id)
1246
+ });
1247
+ }
1248
+ }
1249
+ }
1250
+ };
1251
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1252
+ this.linkupOption = opts;
1253
+ });
1254
+ },
1255
+ cancelTalk(row) {
1256
+ let that = getTarget(this);
1257
+ that.$baseConfirm(this.$t2('您确定要取消沟通记录吗?', 'components.wf.cancelTalkTip')).then(() => {
1258
+ that.$http({
1259
+ url: this.current_prefix + "/wf_linkup/cancel",
1260
+ data: {id: row.id},
1261
+ method: "post",
1262
+ loadingTarget: document.body,
1263
+ isLoading: true,
1264
+ success: (resultMsg) => {
1265
+ that.$message({
1266
+ message: resultMsg.content,
1267
+ type: "success",
1268
+ duration: 500,
1269
+ onClose: (t) => {
1270
+ this.reloadContent();
1271
+ },
1272
+ });
1273
+ },
1274
+ });
1275
+ });
1276
+ },
1277
+ openTalkDialog(receiver, receiverName, operateType, flag, replyId) {
1278
+ this.operateType = operateType;
1279
+ /*this.talkForm.receiver = receiver || null;
1280
+ this.talkForm.receiverName = receiverName || null;
1281
+ this.talkForm.replyId = replyId || null;
1282
+ this.talkForm.content = null;
1283
+ this.talkForm.attachmentDTOs = [];*/
1284
+ this.initTalkForm(receiver, receiverName, replyId)
1285
+ this.showTalkDialog = true;
1286
+ if (flag == 1) {
1287
+ let opeaBtnDom = this.$refs.opeaBtn;
1288
+ opeaBtnDom && opeaBtnDom.scrollIntoView();
1289
+ }
1290
+ },
1291
+ initTalkForm(receiver, receiverName, replyId) {
1292
+ this.talkForm.receiver = receiver || null;
1293
+ this.talkForm.receiverName = receiverName || null;
1294
+ this.talkForm.replyId = replyId || null;
1295
+ this.talkForm.content = null;
1296
+ this.talkForm.attachmentDTOs = [];
1297
+ },
1298
+ submitTalkForm() {
1299
+ let that = getTarget(this);
1300
+ var procInstId = this.wfInfo.procInstId;
1301
+ var taskId = this.wfInfo.taskId;
1302
+
1303
+ if (!this.talkForm.receiver) {
1304
+ that.$message({
1305
+ message: this.$t2('请选择接收人', 'components.wf.talkWarnMsg1'),
1306
+ type: "error",
1307
+ duration: 2 * 1000,
1308
+ });
1309
+ return false;
1310
+ }
1311
+ if (!this.talkForm.content) {
1312
+ that.$message({
1313
+ message: this.$t2('请输入沟通内容', 'components.wf.talkWarnMsg2'),
1314
+ type: "error",
1315
+ duration: 2 * 1000,
1316
+ });
1317
+ return false;
1318
+ }
1319
+
1320
+ var data = {
1321
+ taskId: taskId,
1322
+ uuid: this.wfInfo.uuid,
1323
+ receiver: this.talkForm.receiver,
1324
+ receiverName: this.talkForm.receiverName,
1325
+ replyId: this.talkForm.replyId,
1326
+ content: this.talkForm.content,
1327
+ attachmentDTOs: this.talkForm.attachmentDTOs,
1328
+ notifyType: "wfLinkup",
1329
+ };
1330
+ this.showTalkDialog = false;
1331
+ that.$http({
1332
+ url: this.current_prefix + "/wf_linkup/save",
1333
+ data: data,
1334
+ method: "post",
1335
+ isLoading: true,
1336
+ success: (resultMsg) => {
1337
+ that.$message({
1338
+ message: resultMsg.content,
1339
+ type: "success",
1340
+ duration: 500,
1341
+ onClose: (t) => {
1342
+ this.reloadContent();
1343
+ this.closeWinOnCheck(5);
1344
+ },
1345
+ });
1346
+ },
1347
+ });
1348
+ },
1349
+ openTalkUserDialog() {
1350
+ this.showTalkUserDialog = true;
1351
+ },
1352
+ confirmTalkUserDialog(rows) {
1353
+ if (rows.length > 0) {
1354
+ let row = rows[0];
1355
+ if (this.talkForm.receiver != row.id) {
1356
+ this.talkForm.replyId = null;
1357
+ }
1358
+ this.talkForm.receiver = row.id;
1359
+ this.talkForm.receiverName = row.nickName;
1360
+ }
1361
+ },
1362
+ confirmUrging() {
1363
+ this.reloadContent();
1364
+ },
1365
+ confirmDeleteTaskUser() {
1366
+ this.reloadContent();
1367
+ },
1368
+ confirmAddTaskUser(rows) {
1369
+ this.addIncreaseSignUsers = rows;
1370
+ this.addIncreaseSignForm.userNickNames = rows.map(row => row.nickName).join(',');
1371
+ // this.reloadContent();
1372
+ },
1373
+ submitAddTaskUserForm(flag) {
1374
+ let that = getTarget(this);
1375
+ let userIds = this.addIncreaseSignUsers.map((checkRow) => checkRow.id);
1376
+ if (userIds.length == 0) {
1377
+ that.$message({
1378
+ message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
1379
+ type: "error",
1380
+ duration: 2000,
1381
+ onClose: (t) => {
1382
+ },
1383
+ });
1384
+ return false;
1385
+ }
1386
+ let toDo = () => {
1387
+ var data = JSON.stringify({
1388
+ uuid: this.wfInfo.uuid,
1389
+ taskId: this.wfInfo.taskId,
1390
+ userIds: userIds,
1391
+ suggestion: this.addIncreaseSignForm.opinion
1392
+
1393
+ });
1394
+ this.agreeDialogVisible = false;
1395
+ that.$http({
1396
+ url: this.current_prefix + "/wf/addIncreaseSign",
1397
+ data: data,
1398
+ method: "post",
1399
+ loadingTarget: document.body,
1400
+ headers: {
1401
+ "Content-Type": "application/json;charset=utf-8",
1402
+ },
1403
+ isLoading: true,
1404
+ success: (resultMsg) => {
1405
+ this.showAddIncreaseSignDialog = false
1406
+ that.$message({
1407
+ message: resultMsg.content,
1408
+ type: "success",
1409
+ duration: 500,
1410
+ onClose: (t) => {
1411
+ this.reloadContent();
1412
+ },
1413
+ });
1414
+ },
1415
+ });
1416
+ }
1417
+ if (flag === 0) {
1418
+ toDo();
1419
+ } else {
1420
+ that.$baseConfirm(this.$t2('您确定要加签吗?', 'components.wf.addIncreaseSignConfirmTip')).then(() => {
1421
+ toDo();
1422
+ });
1423
+ }
1424
+ },
1425
+ openSetCandidateDialog(operateType) {
1426
+ this.operateType = operateType;
1427
+ this.showSetCandidateDialog = true;
1428
+ },
1429
+ closeSetCandidateDialog() {
1430
+ this.showSetCandidateDialog = false;
1431
+ this.reloadContent();
1432
+ },
1433
+ openRevokeDialog(operateType) {
1434
+ this.operateType = operateType;
1435
+ this.revokeForm = {opinion: null}
1436
+ this.revokeDialogVisible = true;
1437
+ },
1438
+ subRevokeForm(flag) {
1439
+ //撤回
1440
+ let that = getTarget(this);
1441
+ let toDo = () => {
1442
+ var data = JSON.stringify({
1443
+ uuid: this.wfInfo.uuid,
1444
+ taskId: this.wfInfo.taskId,
1445
+ suggestion: this.revokeForm.opinion,
1446
+ });
1447
+ this.revokeDialogVisible = false;
1448
+ that.$http({
1449
+ url: this.current_prefix + "/wf/revoke",
1450
+ data: data,
1451
+ method: "post",
1452
+ loadingTarget: document.body,
1453
+ headers: {
1454
+ "Content-Type": "application/json;charset=utf-8",
1455
+ },
1456
+ isLoading: true,
1457
+ success: (resultMsg) => {
1458
+ that.$message({
1459
+ message: resultMsg.content,
1460
+ type: "success",
1461
+ duration: 500,
1462
+ onClose: (t) => {
1463
+ this.reloadContent();
1464
+ },
1465
+ });
1466
+ },
1467
+ });
1468
+ }
1469
+ if (flag === 0) {
1470
+ toDo();
1471
+ } else {
1472
+ that.$baseConfirm(this.$t2('您确定要撤回吗?', 'components.wf.revokeConfirmTip')).then(() => {
1473
+ toDo();
1474
+ });
1475
+ }
1476
+ },
1477
+ initShowTaskInfo(callback) {
1478
+ //初始化转办用户参数
1479
+ let that = getTarget(this);
1480
+ return that.$http({
1481
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1482
+ method: `post`,
1483
+ data: {attributeKey: "param9"},
1484
+ isLoading: true,
1485
+ modalStrictly: true,
1486
+ success: (res) => {
1487
+ this.showWfInfoTab = res.objx !== 1;
1488
+ callback && callback();
1489
+ },
1490
+ });
1491
+ },
1492
+ getIsShowWfMemo(){
1493
+ let that = getTarget(this);
1494
+ that.$http({
1495
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1496
+ method: `post`,
1497
+ data: {attributeKey: "param10"},
1498
+ isLoading: true,
1499
+ success: (res) => {
1500
+ this.showWfMemo = res?.objx === true;
1501
+ if(this.showWfMemo){
1502
+ this.$nextTick(()=>{
1503
+ this.initWfMemo();
1504
+ })
1505
+ }
1506
+ },
1507
+ });
1508
+ },
1509
+
1510
+ initWfMemo() {
1511
+ this.wfMemoSearchEvent();
1512
+ /* let h = this.$createElement;
1513
+ let tableOption = {
1514
+ vue: this,
1515
+ tableRef: "table-wfMemo",
1516
+ tableName: "wf_table-wfMemo",
1517
+ path: this.current_prefix + "/wf_memo/listPage",
1518
+ param: () => {
1519
+ return {
1520
+ uuid: this.wfInfo.uuid,
1521
+ };
1522
+ },
1523
+ config: {
1524
+ height: 350
1525
+ },
1526
+ columns: [
1527
+ {type: "checkbox", width: 48, resizable: false, fixed: "left"},
1528
+ {
1529
+ title: this.$t1('操作人'),
1530
+ field: "operatorName",
1531
+ width: 150,
1532
+ fixed: "left",
1533
+ },
1534
+ {
1535
+ title: this.$t1('内容'),
1536
+ field: "content",
1537
+ width: 250,
1538
+ showOverflow: false
1539
+ },
1540
+ {
1541
+ width: 150,
1542
+ title: this.$t1('附件'),
1543
+ field: "attachmentImage",
1544
+ sortable: false,
1545
+ slots: {
1546
+ default: ({row, rowIndex}) => {
1547
+ let option = {
1548
+ title: this.$t1('附件'),
1549
+ edit: false,
1550
+ rows: (done) => {
1551
+ done(row.attachmentDTOs);
1552
+ },
1553
+ };
1554
+ return [
1555
+ h("base-attachment", {
1556
+ props: {
1557
+ option: option,
1558
+ imageLazy: false
1559
+ },
1560
+ }),
1561
+ ];
1562
+ },
1563
+ },
1564
+ },
1565
+ {
1566
+ title: this.$t2('创建时间', 'system.label.createDate'),
1567
+ field: "createDate",
1568
+ width: 150,
1569
+ },
1570
+ {
1571
+ width: 80,
1572
+ fixed: "right",
1573
+ title: "",
1574
+ sortable: false
1575
+ },
1576
+ ]
1577
+ };
1578
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1579
+ this.wfMemoOption = opts;
1580
+ }); */
1581
+ },
1582
+ wfMemoSearchEvent(){
1583
+ // this.$refs['table-wfMemo'].commitProxy('reload');
1584
+ let that = getTarget(this);
1585
+ that.$http({
1586
+ url: this.current_prefix + "/wf_memo/listPage",
1587
+ method: `post`,
1588
+ data: {
1589
+ uuid: this.wfInfo.uuid,
1590
+ },
1591
+ isLoading: true,
1592
+ success: (res) => {
1593
+ let rows = res?.objx?.records || [];
1594
+ this.wfMemoData = rows;
1595
+ },
1596
+ });
1597
+ },
1598
+ openWfMemoDialog(row) {
1599
+ if(row){
1600
+ this.wfMemoForm = this.$baseLodash.cloneDeep(row);
1601
+ }else{
1602
+ this.wfMemoForm = {
1603
+ uuid: this.wfInfo.uuid,
1604
+ content:null,
1605
+ attachmentDTOs: []
1606
+ }
1607
+ }
1608
+ this.showWfMemoDialog = true;
1609
+ },
1610
+ submitWfMemoForm() {
1611
+ let that = getTarget(this);
1612
+
1613
+ if (!this.wfMemoForm.content) {
1614
+ that.$message({
1615
+ message: this.$t1('请输入内容'),
1616
+ type: "error",
1617
+ duration: 2 * 1000,
1618
+ });
1619
+ return false;
1620
+ }
1621
+
1622
+ this.showWfMemoDialog = false;
1623
+ that.$http({
1624
+ url: this.current_prefix + "/wf_memo/save",
1625
+ data: this.wfMemoForm,
1626
+ method: "post",
1627
+ isLoading: true,
1628
+ success: (resultMsg) => {
1629
+ that.$message({
1630
+ message: resultMsg.content,
1631
+ type: "success"
1632
+ });
1633
+ this.wfMemoSearchEvent();
1634
+ },
1635
+ });
1636
+ },
1637
+ }
1638
+ };
1639
+
1640
+ wfStartMixin = {
1641
+ name: "wfStartDialog",
1642
+ props: {
1643
+ dataId: [String, Number],
1644
+ code: [String, Number],
1645
+ serviceId: String,
1646
+ startParam: Object,
1647
+ visible: Boolean,
1648
+ parentVue: Object,
1649
+ wfName: String,
1650
+ formCode: String,
1651
+ option: Object
1652
+ },
1653
+ data() {
1654
+ return {
1655
+ showDialog: false,
1656
+ wfStartForm: {},
1657
+ wfDefItems: [],
1658
+
1659
+ startFormData:{},
1660
+ wfUserRangeEnabled: false,
1661
+ preStartResult:[],
1662
+ showSetCandidateDialog2:false,
1663
+ wfSubmitted: false
1664
+ };
1665
+ },
1666
+ computed: {
1667
+ current_prefix() {
1668
+ return this.serviceId ? "/" + this.serviceId : "";
1669
+ },
1670
+ },
1671
+ mounted() {
1672
+ this.initWfInfo(this.code);
1673
+ // this.showDialog = true;
1674
+ },
1675
+ methods: {
1676
+ preStart(){
1677
+ let that = getTarget(this);
1678
+ return new Promise(resolve=>{
1679
+ return that.$http({
1680
+ url: this.current_prefix + "/wf/preStart",
1681
+ method: `post`,
1682
+ data: this.startFormData,
1683
+ success: (res) => {
1684
+ resolve(res.objx);
1685
+ },
1686
+ });
1687
+ })
1688
+ },
1689
+ initWfUserRangeParam(){
1690
+ let that = getTarget(this);
1691
+ return that.$http({
1692
+ url: USER_PREFIX + "/wf_diy_attribute/getValue",
1693
+ method: `post`,
1694
+ data: {attributeKey: "param12"},
1695
+ success: (res) => {
1696
+ this.wfUserRangeEnabled = res?.objx === true;
1697
+ },
1698
+ });
1699
+ },
1700
+ openSetCandidateDialog(){
1701
+ this.showSetCandidateDialog2 = true;
1702
+ },
1703
+ confirmSetCandidateDialog(rows){
1704
+ let formData = {
1705
+ ...this.startFormData,
1706
+ wfNodeDTOs: rows
1707
+ }
1708
+ this.startSubmitHanlde(formData);
1709
+ },
1710
+ async initWfInfo(code) {
1711
+ let that = getTarget(this);
1712
+ var wfDefItems = null;
1713
+ var objId = this.dataId;
1714
+
1715
+ await this.initWfUserRangeParam();
1716
+ await that.$http({
1717
+ url: this.current_prefix + "/wf_obj_config_item/list",
1718
+ data: {
1719
+ objTypeCode: code,
1720
+ enabled: true,
1721
+ objId: objId
1722
+ },
1723
+ method: "post",
1724
+ //contentType: 'application/json;charset=utf-8',
1725
+ async: false,
1726
+ isLoading: true,
1727
+ error: (error) => {
1728
+ this.close();
1729
+ },
1730
+ success: (resultMsg) => {
1731
+ wfDefItems = resultMsg.objx || [];
1732
+ },
1733
+ });
1734
+
1735
+ if (!wfDefItems || wfDefItems.length == 0) {
1736
+ that.$baseAlert(this.$t2('无法启动,没有流程单据', 'components.wf.startWarnMsg1'));
1737
+ this.close();
1738
+ return false;
1739
+ }
1740
+
1741
+ (this.wfStartForm = {
1742
+ wfCode: code,
1743
+ }),
1744
+ (this.wfDefItems = wfDefItems);
1745
+ this.$set(this.wfStartForm, "modelId", wfDefItems[0].modelId);
1746
+ if (wfDefItems.length == 1) {
1747
+ if (
1748
+ settingConfig.withoutConfrimByOneWf === true ||
1749
+ (this.option && this.option.skipStartConfirm)
1750
+ ) {
1751
+ this.startSubmit();
1752
+ } else {
1753
+ let customStartTip = this.option && this.option.startConfirmText;
1754
+ if (typeof customStartTip === "function") {
1755
+ customStartTip = await customStartTip.call(
1756
+ this.parentVue || this,
1757
+ {
1758
+ objId: this.dataId,
1759
+ wfCode: this.code,
1760
+ formCode: this.formCode,
1761
+ startParam: this.startParam,
1762
+ }
1763
+ );
1764
+ }
1765
+ let wfStartOperateName =
1766
+ settingConfig.wfStartOperateName ||
1767
+ settingConfig.wfStartButtonName ||
1768
+ "启动流程";
1769
+ let defaultStartTip = "您确定要" + wfStartOperateName + "吗?";
1770
+ let startTip;
1771
+ if (typeof customStartTip === "string" && customStartTip.trim()) {
1772
+ startTip = customStartTip;
1773
+ } else {
1774
+ startTip = this.$t2(defaultStartTip, 'components.wf.startTip');
1775
+ }
1776
+ that
1777
+ .$baseConfirm(startTip)
1778
+ .then(() => {
1779
+ this.startSubmit();
1780
+ });
1781
+ }
1782
+ } else {
1783
+ this.showDialog = true;
1784
+ }
1785
+ },
1786
+ startSubmit() {
1787
+ var modelId = this.wfStartForm.modelId;
1788
+ if (!modelId) {
1789
+ that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1790
+ return false;
1791
+ }
1792
+ let option = this.option;
1793
+ if (option.onBeforeStartSubmit) {
1794
+ option.onBeforeStartSubmit(() => {
1795
+ this.subWfStartForm();
1796
+ })
1797
+ } else {
1798
+ this.subWfStartForm();
1799
+ }
1800
+ },
1801
+ async subWfStartForm() {
1802
+ let that = getTarget(this);
1803
+ var modelId = this.wfStartForm.modelId;
1804
+ if (!modelId) {
1805
+ that.$baseAlert(this.$t2('请选择流程模版', 'components.wf.startWarnMsg2'));
1806
+ return false;
1807
+ }
1808
+
1809
+ let option = this.option;
1810
+
1811
+ var objId = this.dataId;
1812
+
1813
+ let startParam = this.startParam || {};
1814
+ let formCode = this.formCode || null;
1815
+
1816
+ var data = {
1817
+ modelId: modelId,
1818
+ objTypeCode: this.code,
1819
+ objId: objId,
1820
+ formData: startParam,
1821
+ formCode: formCode
1822
+ // name:this.wfName
1823
+ };
1824
+ this.startFormData = data;
1825
+
1826
+ if(this.wfUserRangeEnabled){
1827
+ this.preStartResult = await this.preStart() || []
1828
+ if(this.preStartResult.length){
1829
+ this.openSetCandidateDialog()
1830
+ return
1831
+ }
1832
+ }
1833
+ this.startSubmitHanlde(this.startFormData);
1834
+
1835
+ },
1836
+ startSubmitHanlde(formData){
1837
+ this.wfSubmitted = true; // 标记已进入提交,避免随后关闭弹框误判为「取消」
1838
+ this.showDialog = false;
1839
+ let that = getTarget(this);
1840
+ let option = this.option;
1841
+ that.$http({
1842
+ url: this.current_prefix + "/wf/start",
1843
+ data: formData,
1844
+ method: "post",
1845
+ /* headers: {
1846
+ "Content-Type": "application/json;charset=utf-8",
1847
+ }, */
1848
+ isLoading: true,
1849
+ callback: (resultMsg) => {
1850
+ if (resultMsg.type == "success") {
1851
+ that.$message({
1852
+ message: resultMsg.content,
1853
+ type: "success",
1854
+ duration: 500,
1855
+ onClose: (t) => {
1856
+ if (!option.onStartSuccess) {
1857
+ that.$baseReload();
1858
+ } else {
1859
+ option.onStartSuccess();
1860
+ }
1861
+ if (resultMsg.objx) {
1862
+ that.$baseAlert(resultMsg.objx)
1863
+ }
1864
+ },
1865
+ });
1866
+ } else {
1867
+ option.onStartFail && option.onStartFail()
1868
+ }
1869
+
1870
+ }
1871
+ });
1872
+ },
1873
+ handleWfCancel() {
1874
+ // 未进入提交就关闭 = 取消启动,回调通用 onCancel(一次性,避免多个弹框关闭重复触发)
1875
+ if (this.wfSubmitted) return;
1876
+ this.wfSubmitted = true;
1877
+ this.option && this.option.onCancel && this.option.onCancel();
1878
+ },
1879
+ close() {
1880
+ this.handleWfCancel();
1881
+ this.$emit("update:visible", false);
1882
+ },
1883
+ },
1884
+ watch: {
1885
+ showSetCandidateDialog2(val, oldVal) {
1886
+ // 候选人弹框未提交就关闭 = 取消启动
1887
+ if (oldVal && !val) this.handleWfCancel();
1888
+ },
1889
+ },
1890
+ };
1891
+
1892
+ wfModifyMixin = {
1893
+ name: "wfModifyMixin",
1894
+ props: {
1895
+ dataId: [String, Number],
1896
+ code: [String, Number],
1897
+ visible: Boolean,
1898
+ paramData: Object,
1899
+ parentVue: Object,
1900
+ wfInfo: Object,
1901
+ title: String
1902
+ },
1903
+ data() {
1904
+ return {
1905
+ showModifyDialog: false,
1906
+ showBillEdit: false,
1907
+ content: "",
1908
+ };
1909
+ },
1910
+ async mounted() {
1911
+ this.openWfModifyDialog(this.code);
1912
+ },
1913
+ methods: {
1914
+ openWfModifyDialog() {
1915
+ let row = this.paramData;
1916
+ let url = row.url + ".vue";
1917
+ this.showModifyDialog = true;
1918
+ this.content = configUtil.requireView(url);
1919
+ this.$openEditView("showBillEdit");
1920
+ },
1921
+ modfyDialogClose() {
1922
+ this.showBillEdit = false;
1923
+ this.content = null;
1924
+ },
1925
+ refreshEdit() {
1926
+ this.showModifyDialog = false;
1927
+ this.parentVue.$baseReload()
1928
+ }
1929
+ },
1930
+ };
1931
+
1932
+ wfUrgingMixin = {
1933
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
1934
+ mixins: [selectDialogMixins],
1935
+ created() {
1936
+ this.initSetting();
1937
+ },
1938
+ mounted() {
1939
+ this.initTableM1();
1940
+ },
1941
+ data() {
1942
+ return {
1943
+ showDialog: true,
1944
+ selectMulti: true,
1945
+ vxeOption: {},
1946
+ };
1947
+ },
1948
+ methods: {
1949
+ initTableM1() {
1950
+ var that = this;
1951
+ let tableOption = {
1952
+ vue: that,
1953
+ tableRef: "table-m1",
1954
+ tableName: "wf_urgingDialog-m1",
1955
+ path: this.current_prefix + "/wf/getTaskCandidates",
1956
+ param: () => {
1957
+ return {stringOne: this.wfInfo.uuid};
1958
+ },
1959
+ config: {
1960
+ checkboxConfig: {
1961
+ checkStrictly: true,
1962
+ showHeader: this.selectMulti,
1963
+ trigger: "row",
1964
+ },
1965
+ proxyConfig: {
1966
+ props: {
1967
+ result: "objx", // 配置响应结果列表字段
1968
+ total: "objx.length", // 配置响应结果总页数字段
1969
+ },
1970
+ },
1971
+ },
1972
+ columns: [
1973
+ {type: "checkbox", width: 50, resizable: false, fixed: "left"},
1974
+ {title: this.$t2('催办人', 'components.wf.urgingUser'), field: "name", width: 250, fixed: "left"},
1975
+ {title: this.$t2('催办人ID', 'components.wf.urgingUserId'), field: "id", width: 150},
1976
+ {
1977
+ width: 47,
1978
+ fixed: "right",
1979
+ title: "",
1980
+ sortable: false,
1981
+ },
1982
+ ],
1983
+ };
1984
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
1985
+ that.vxeOption = opts;
1986
+ });
1987
+ },
1988
+ dialogConfirm() {
1989
+ this.dialogPrimary();
1990
+ this.$emit("confirm");
1991
+ },
1992
+ subUrgingForm() {
1993
+ let that = this;
1994
+ let urgingUserIds = this.checkRows.map((checkRow) => checkRow.id);
1995
+ if (urgingUserIds.length == 0) {
1996
+ that.$message({
1997
+ message: this.$t2('请选择催办人', 'components.wf.urgingWarnMsg1'),
1998
+ type: "error",
1999
+ duration: 2000,
2000
+ onClose: (t) => {
2001
+ },
2002
+ });
2003
+ return false;
2004
+ }
2005
+ that.$baseConfirm(this.$t2('您确定要催办吗?', 'components.wf.urgingConfirmTip')).then(() => {
2006
+ var data = JSON.stringify({
2007
+ uuid: this.wfInfo.uuid,
2008
+ taskId: this.wfInfo.taskId,
2009
+ notifyType: "wfUrging",
2010
+ userIds: urgingUserIds,
2011
+ });
2012
+ this.agreeDialogVisible = false;
2013
+ that.$http({
2014
+ url: this.current_prefix + "/wf/urging",
2015
+ data: data,
2016
+ method: "post",
2017
+ loadingTarget: document.body,
2018
+ headers: {
2019
+ "Content-Type": "application/json;charset=utf-8",
2020
+ },
2021
+ isLoading: true,
2022
+ success: (resultMsg) => {
2023
+ that.$message({
2024
+ message: resultMsg.content,
2025
+ type: "success",
2026
+ duration: 500,
2027
+ onClose: (t) => {
2028
+ // this.reloadContent();
2029
+ this.dialogConfirm();
2030
+ },
2031
+ });
2032
+ },
2033
+ });
2034
+ });
2035
+ },
2036
+ },
2037
+ };
2038
+
2039
+ deleteTaskUserMixin = {
2040
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2041
+ mixins: [selectDialogMixins],
2042
+ created() {
2043
+ this.initSetting();
2044
+ },
2045
+ mounted() {
2046
+ this.initTableM1();
2047
+ },
2048
+ data() {
2049
+ return {
2050
+ showDialog: true,
2051
+ selectMulti: true,
2052
+ vxeOption: {},
2053
+ };
2054
+ },
2055
+ methods: {
2056
+ initTableM1() {
2057
+ var that = this;
2058
+ let tableOption = {
2059
+ vue: that,
2060
+ tableRef: "table-m1",
2061
+ tableName: "wf_deleteTaskUserDialog-m1",
2062
+ path: this.current_prefix + "/wf/getIncreaseSign",
2063
+ param: () => {
2064
+ return {
2065
+ uuid: this.wfInfo.uuid,
2066
+ taskId: this.wfInfo.taskId,
2067
+ };
2068
+ },
2069
+ config: {
2070
+ checkboxConfig: {
2071
+ checkStrictly: true,
2072
+ showHeader: this.selectMulti,
2073
+ trigger: "row",
2074
+ },
2075
+ proxyConfig: {
2076
+ props: {
2077
+ result: "objx", // 配置响应结果列表字段
2078
+ total: "objx.length", // 配置响应结果总页数字段
2079
+ },
2080
+ },
2081
+ },
2082
+ columns: [
2083
+ {type: "checkbox", width: 50, resizable: false, fixed: "left"},
2084
+ {title: this.$t2('候选人', 'components.wf.candidate'), field: "name", width: 250, fixed: "left"},
2085
+ {title: this.$t2('候选人ID', 'components.wf.candidateId'), field: "id", width: 150},
2086
+ {
2087
+ width: 47,
2088
+ fixed: "right",
2089
+ title: "",
2090
+ sortable: false,
2091
+ },
2092
+ ],
2093
+ };
2094
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
2095
+ that.vxeOption = opts;
2096
+ });
2097
+ },
2098
+ dialogConfirm() {
2099
+ this.dialogPrimary();
2100
+ // this.$emit("confirm");
2101
+ },
2102
+ subForm() {
2103
+ let that = this;
2104
+ let userIds = this.checkRows.map((checkRow) => checkRow.id);
2105
+ if (userIds.length == 0) {
2106
+ that.$message({
2107
+ message: this.$t2('请选择候选人', 'components.wf.deleteIncreaseSignWarnMsg1'),
2108
+ type: "error",
2109
+ duration: 2000,
2110
+ onClose: (t) => {
2111
+ },
2112
+ });
2113
+ return false;
2114
+ }
2115
+ that.$baseConfirm(this.$t2('您确定要减签选中的候选人吗?', 'components.wf.deleteIncreaseSignTip')).then(() => {
2116
+ var data = JSON.stringify({
2117
+ uuid: this.wfInfo.uuid,
2118
+ taskId: this.wfInfo.taskId,
2119
+ userIds: userIds,
2120
+ });
2121
+ this.agreeDialogVisible = false;
2122
+ that.$http({
2123
+ url: this.current_prefix + "/wf/deleteIncreaseSign",
2124
+ data: data,
2125
+ method: "post",
2126
+ loadingTarget: document.body,
2127
+ headers: {
2128
+ "Content-Type": "application/json;charset=utf-8",
2129
+ },
2130
+ isLoading: true,
2131
+ success: (resultMsg) => {
2132
+ that.$message({
2133
+ message: resultMsg.content,
2134
+ type: "success",
2135
+ duration: 500,
2136
+ onClose: (t) => {
2137
+ this.dialogConfirm();
2138
+ },
2139
+ });
2140
+ },
2141
+ });
2142
+ });
2143
+ },
2144
+ },
2145
+ };
2146
+
2147
+ addTaskUserMixin = {
2148
+ props: ["visiable", "multi", "rows", "param", "current_prefix", "wfInfo"],
2149
+ mixins: [selectDialogMixins],
2150
+ data() {
2151
+ return {
2152
+ showDialog: true,
2153
+ selectMulti: true,
2154
+ vxeOption: {},
2155
+ };
2156
+ },
2157
+ created() {
2158
+ this.initSetting();
2159
+ },
2160
+ mounted() {
2161
+ this.initTableM1();
2162
+ },
2163
+ methods: {
2164
+ dialogConfirm() {
2165
+ this.dialogPrimary();
2166
+ // this.$emit('confirm');
2167
+ },
2168
+ subForm() {
2169
+ let that = this;
2170
+ let userIds = this.checkRows.map((checkRow) => checkRow.id);
2171
+ if (userIds.length == 0) {
2172
+ that.$message({
2173
+ message: this.$t2('请选择候选人', 'components.wf.addIncreaseSignWarnMsg1'),
2174
+ type: "error",
2175
+ duration: 2000,
2176
+ onClose: (t) => {
2177
+ },
2178
+ });
2179
+ return false;
2180
+ }
2181
+ that.$baseConfirm(this.$t2('您确定要加签选中的候选人吗?', 'components.wf.addIncreaseSignConfirmTip2')).then(() => {
2182
+ var data = JSON.stringify({
2183
+ uuid: this.wfInfo.uuid,
2184
+ taskId: this.wfInfo.taskId,
2185
+ userIds: userIds,
2186
+ });
2187
+ this.agreeDialogVisible = false;
2188
+ that.$http({
2189
+ url: this.current_prefix + "/wf/addIncreaseSign",
2190
+ data: data,
2191
+ method: "post",
2192
+ loadingTarget: document.body,
2193
+ headers: {
2194
+ "Content-Type": "application/json;charset=utf-8",
2195
+ },
2196
+ isLoading: true,
2197
+ success: (resultMsg) => {
2198
+ that.$message({
2199
+ message: resultMsg.content,
2200
+ type: "success",
2201
+ duration: 500,
2202
+ onClose: (t) => {
2203
+ this.dialogConfirm();
2204
+ },
2205
+ });
2206
+ },
2207
+ });
2208
+ });
2209
+ },
2210
+ },
2211
+ };
2212
+
2213
+ export {
2214
+ wfIndexMixin,
2215
+ wfStartMixin,
2216
+ wfContentMixin,
2217
+ wfModifyMixin,
2218
+ wfUrgingMixin,
2219
+ deleteTaskUserMixin,
2220
+ addTaskUserMixin,
2221
+ };