eoss-ui 0.8.35 → 0.8.37

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,1976 +1,2019 @@
1
- <template>
2
- <div
3
- v-loading="loading"
4
- class="es-flow-form"
5
- element-loading-text="加载中..."
6
- element-loading-spinner="el-icon-loading"
7
- element-loading-background="rgba(255, 255,255, 0.8)"
8
- >
9
- <el-form
10
- ref="nextNode"
11
- :model="nextNode"
12
- class="demo-dynamic"
13
- label-width="100px"
14
- :rules="rules"
15
- :label-position="labelPosition"
16
- >
17
- <div
18
- :style="`height:${showBtn ? '430px' : 'auto'}; overflow-y:${
19
- showBtn ? 'auto' : 'hidden'
20
- } ; margin-bottom: 10px;overflow-x: hidden;`"
21
- >
22
- <el-form-item
23
- v-show="showBtn"
24
- prop="nodeName"
25
- label="当前节点"
26
- :rules="[
27
- { required: true, message: `请选择下步节点`, trigger: 'blur' }
28
- ]"
29
- >
30
- <el-input v-model="nextNode.nodeName" disabled />
31
- </el-form-item>
32
- <el-form-item
33
- v-if="isSinglePage || copyHistory || formType == 'readTransfer'"
34
- prop="newOpinion"
35
- :label="
36
- copyHistory || formType == 'readTransfer' ? '填写意见' : '意见'
37
- "
38
- >
39
- <CommonOpinions
40
- class="opinions"
41
- :opinion="nextNode.newOpinion"
42
- :rows="copyHistory || formType == 'readTransfer' ? 2 : 5"
43
- v-if="showOpinion"
44
- :required="isOpinionRequired == 1"
45
- @change="(val) => (nextNode.newOpinion = val)"
46
- />
47
- </el-form-item>
48
- <!-- 阅转办时新增选择流程功能 -->
49
- <el-form-item
50
- v-if="isCanReadTransferHandle && readTransferHandleFlowTypeCode"
51
- prop="nextNode"
52
- label="选择流程"
53
- :rules="[
54
- // { required: true, message: `请选择流程`, trigger: 'blur' }
55
- ]"
56
- >
57
- <el-input
58
- placeholder="请输入内容"
59
- class="input-with-select select-process"
60
- :class="{ 'hide-flow-char': isStartFlowChartView != 'true' }"
61
- >
62
- <el-select
63
- slot="prepend"
64
- v-model="currentNodeInfo.nextNode"
65
- style="width: calc(100% + 40px)"
66
- :placeholder="`请选择流程`"
67
- :key="optionsKey"
68
- @change="handleFlowChange"
69
- >
70
- <el-option
71
- v-for="items in currentNodeInfo.option"
72
- :key="items.id"
73
- :label="items.name"
74
- :disabled="items.disabled"
75
- :value="items.processDefId"
76
- ></el-option>
77
- </el-select>
78
- <div slot="append" v-show="isStartFlowChartView == 'true'">
79
- <el-button
80
- icon="es-icon-shu-jituan"
81
- type="primary"
82
- @click="
83
- () => {
84
- showFlowChart = true;
85
- }
86
- "
87
- ></el-button>
88
- <el-button
89
- v-show="activitiDefinitionSort"
90
- icon="es-icon-paixu"
91
- type="primary"
92
- @click="
93
- () => {
94
- showSort = true;
95
- }
96
- "
97
- ></el-button>
98
- </div>
99
- </el-input>
100
- </el-form-item>
101
- <el-form-item
102
- prop="nextOperate"
103
- label="下步操作"
104
- v-if="isChooseNextNode == 1"
105
- :rules="[
106
- { required: true, message: `请选择下步操作`, trigger: 'blur' }
107
- ]"
108
- >
109
- <el-select
110
- v-if="nextOperateCheckType == 'select'"
111
- v-model="nextNode.nextOperate"
112
- :placeholder="`请选择下步操作`"
113
- @change="selecNext"
114
- >
115
- <el-option
116
- v-for="items in operationList"
117
- :key="items.key"
118
- :label="items.value"
119
- :value="items.key"
120
- ></el-option>
121
- </el-select>
122
- <es-radio-group
123
- v-else-if="nextOperateCheckType == 'radio'"
124
- v-model="nextNode.nextOperate"
125
- :data="operationList"
126
- @change="selecNext($event, true)"
127
- value-key="key"
128
- label-key="value"
129
- ></es-radio-group>
130
- </el-form-item>
131
- <el-form-item
132
- prop="nextNode"
133
- label="下步节点"
134
- :rules="[
135
- { required: false, message: `请选择下步节点`, trigger: 'blur' }
136
- ]"
137
- >
138
- <el-select
139
- v-if="nextNodeCheckType == 'select'"
140
- v-model="nextNode.nextNode"
141
- :placeholder="`请选择下步节点`"
142
- @change="changeSel"
143
- >
144
- <el-option
145
- v-for="items in nextNode.nodeInfo"
146
- :key="items.id"
147
- :label="items.nodeName"
148
- :value="items.nodeId"
149
- ></el-option>
150
- </el-select>
151
- <es-radio-group
152
- v-else-if="nextNodeCheckType == 'radio'"
153
- v-model="nextNode.nextNode"
154
- :data="nextNode.nodeInfo"
155
- @change="changeSel"
156
- value-key="nodeId"
157
- label-key="nodeName"
158
- ></es-radio-group>
159
- </el-form-item>
160
- <el-form-item
161
- v-if="countersignaturetypeCode != 0"
162
- prop="countersignaturetypeText"
163
- label="处理方式"
164
- >
165
- <el-input
166
- v-model="nextNode.countersignaturetypeText"
167
- placeholder="请输入内容"
168
- disabled
169
- />
170
- </el-form-item>
171
- <!-- <el-form-item
172
- prop="nextNode"
173
- label="下步办理人"
174
- v-if="isShowNextUser"
175
- :rules="[
176
- { required: true, message: `请选择下步办理人`, trigger: 'blur' }
177
- ]"
178
- >
179
- <SelectUser
180
- :nextUser="nextNode.nextUser"
181
- :radioList="radioList"
182
- :multiple="multiple"
183
- :showTooltip="showTooltip"
184
- :isCustomUser="isCustomUser"
185
- :options="options"
186
- :presetEdit="presetEdit"
187
- :isDefSelectedObj="isDefSelectedObj"
188
- :selectUserList="selectUserList"
189
- @change="changeSelectUser"
190
- :types="nextUserTypes"
191
- :params="params"
192
- />
193
- </el-form-item> -->
194
- <el-form-item
195
- v-if="isHideCurrentOrg"
196
- prop="nextCurrentOrgObj"
197
- label="本单位"
198
- >
199
- <SelectUser
200
- :nextUser="nextCurrentOrgObjSelect"
201
- multiple
202
- mix
203
- @change="disposeAppUnit($event, 'nextCurrentOrgObjSelect')"
204
- :showTooltip="showTooltip"
205
- :selectUserList="nextCurrentOrgselectUserList"
206
- :types="currentOrgSelectorTabs"
207
- :params="currentOrgSelectorParams"
208
- />
209
- </el-form-item>
210
- <el-form-item v-if="isHideOtherOrg" label="外单位">
211
- <SelectUser
212
- :nextUser="nextOtherOrgObjSelect"
213
- multiple
214
- :showTooltip="showTooltip"
215
- mix
216
- :where="{ filid: 'other' }"
217
- @change="disposeAppUnit($event, 'nextOtherOrgObjSelect')"
218
- :types="['enterprise', 'filgroup']"
219
- :params="foreignOrgSelectorParams"
220
- />
221
- </el-form-item>
222
- <el-form-item
223
- v-if="!isHideOtherOrg && !isHideCurrentOrg"
224
- :prop="isShowNextUser ? 'nextUser' : 'nextOrgId'"
225
- :label="
226
- isShowNextUser
227
- ? `${flowLabelConfig.nextUser || '下步办理人'}`
228
- : '办理对象'
229
- "
230
- >
231
- <SelectUser
232
- :nextUser="isShowNextUser ? nextNode.nextUser : nextNode.nextOrgId"
233
- :radioList="radioList"
234
- :multiple="multiple"
235
- :isCustomUser="!isShowNextUser ? 1 : isCustomUser"
236
- :showTooltip="showTooltip"
237
- :isCurrentNodeForbiddenChangeCandidate="
238
- isCurrentNodeForbiddenChangeCandidate
239
- "
240
- :options="options"
241
- :presetEdit="presetEdit"
242
- :mix="multiple"
243
- :isDefSelectedObj="isDefSelectedObj"
244
- :selectUserList="selectUserList"
245
- @change="
246
- changeSelectUser(
247
- $event,
248
- isShowNextUser ? 'nextUser' : 'nextOrgId'
249
- )
250
- "
251
- :types="
252
- !isShowNextUser
253
- ? nextUserTypes
254
- : isCdjxjTaskHandle != 'true'
255
- ? ['employee', 'persongroup']
256
- : ['employee']
257
- "
258
- :params="isShowNextUser ? params : {}"
259
- :tabs="nextUserTabs"
260
- />
261
- </el-form-item>
262
- <el-form-item
263
- prop="nextReadUserId"
264
- v-if="isTaskread == 1"
265
- label="
266
- 分阅用户
267
- "
268
- >
269
- <SelectUser
270
- :nextUser="nextNode.nextReadUserId"
271
- :multiple="true"
272
- :selectUserList="selectReadUserList"
273
- :showTooltip="showTooltip"
274
- :options="userOptions"
275
- title="分阅用户"
276
- :mix="true"
277
- :types="types"
278
- @change="changeSelectReadUser($event, 'nextReadUserId')"
279
- :tabs="tabs"
280
- />
281
- </el-form-item>
282
- <el-form-item
283
- prop="presetReadUserId"
284
- v-if="canPresetRead"
285
- label="
286
- 自动分阅
287
- "
288
- >
289
- <SelectUser
290
- :nextUser="nextNode.presetReadUserId"
291
- :multiple="true"
292
- :selectUserList="selectPresetUserList"
293
- :showTooltip="showTooltip"
294
- :options="presetOptions"
295
- title="分阅用户"
296
- :radioList="presetReadUserId"
297
- :presetEdit="1"
298
- :mix="true"
299
- :types="types"
300
- @change="changeSelectReadUser($event, 'presetReadUserId')"
301
- :tabs="tabs"
302
- />
303
- </el-form-item>
304
- <el-form-item
305
- v-if="enableCustomLimitTimeSetting"
306
- prop="customLimitTime"
307
- label="限时办理"
308
- :rules="[
309
- {
310
- required: enableCustomLimitTimeSetting,
311
- message: showCustomLimitTimeText
312
- ? '请输入限时办理天数'
313
- : '请选择限时办理天数',
314
- trigger: 'blur'
315
- },
316
- {
317
- required: enableCustomLimitTimeSetting,
318
- validator: checkCustomLimitTime,
319
- trigger: 'blur'
320
- }
321
- ]"
322
- >
323
- <div style="display: flex">
324
- <es-select
325
- v-model="nextNode.customLimitTimeText"
326
- placeholder="请选择"
327
- @change="handleChangeTime"
328
- :style="`flex:${showBtn ? 'unset' : '1'};width: ${
329
- showBtn ? '20%' : 'unset'
330
- } !important; display: inline-block;`"
331
- sysCode="bpm_custom_limit_time"
332
- ></es-select>
333
- <el-input
334
- v-model="nextNode.customLimitTime"
335
- :style="`flex:${showBtn ? 'unset' : '1'};width: ${
336
- showBtn ? '20%' : 'unset'
337
- } !important; display: inline-block;`"
338
- placeholder="请输入限时办理的天数"
339
- class="input-with-select custom-limit-time"
340
- @change="changeCustomLimitTime"
341
- >
342
- </el-input>
343
- <span style="margin-left: 5px">天</span>
344
- </div>
345
- </el-form-item>
346
- <el-form-item
347
- v-if="isHandleExplain == 1"
348
- prop="handleExplain"
349
- label="办理说明"
350
- >
351
- <el-input
352
- placeholder="请输入办理说明"
353
- v-model="nextNode.handleExplain"
354
- />
355
- </el-form-item>
356
- <el-form-item
357
- prop="noticeType"
358
- label="通知方式"
359
- v-show="showBtn && nextNode.noticeList.length > 0 && !hideMessage"
360
- >
361
- <el-checkbox-group v-model="nextNode.noticeType">
362
- <el-checkbox
363
- v-for="item of nextNode.noticeList"
364
- :key="item.cciValue"
365
- :label="item.cciValue"
366
- :disabled="
367
- readOnlyNotificationType
368
- ? readOnlyNotificationType.indexOf(item.cciValue) != -1
369
- : false
370
- "
371
- >
372
- {{ item.shortName }}
373
- </el-checkbox>
374
- </el-checkbox-group>
375
- </el-form-item>
376
- <el-form-item
377
- v-show="nextNode.noticeType.length != 0 && showBtn"
378
- prop="nextNode"
379
- label="通知消息"
380
- >
381
- <es-input
382
- style="
383
- border-color: #ccc;
384
- padding: 5px;
385
- border-radius: 5px;
386
- font-size: 13px;
387
- "
388
- type="textarea"
389
- v-model="nextNode.noticeInfo"
390
- :readonly="notificationMessageReadOnly"
391
- />
392
- </el-form-item>
393
- <CustomPreset
394
- v-show="isCustomPreset"
395
- ref="customPreset"
396
- @changeCustom="
397
- (data) => {
398
- presetList = data;
399
- }
400
- "
401
- :customPresetHintMessage="customPresetHintMessage"
402
- @changeActiveNames="(val) => (activeNames = val)"
403
- @loadingEnd="loading = false"
404
- @loadingStart="loading = true"
405
- :nextNode="nextNode.nextNode"
406
- :id="id"
407
- :processDefinitionId="processDefinitionId"
408
- />
409
- <Preset
410
- v-show="isPreset"
411
- @changePreset="
412
- (data) => {
413
- presetUserJson = data;
414
- }
415
- "
416
- @loadingEnd="loading = false"
417
- @loadingStart="loading = true"
418
- :customPresetHintMessage="customPresetHintMessage"
419
- :nodeId="nextNode.nextNode"
420
- :businessId="id"
421
- :processDefinitionId="processDefinitionId"
422
- :presetTaskNodeMap="presetTaskNodeMap"
423
- :presetTaskNodeKeyStr="presetTaskNodeKeyStr"
424
- />
425
- </div>
426
- <el-form-item style="margin-bottom: 0px" v-show="showBtn">
427
- <div style="text-align: right">
428
- <el-button type="primary" @click="subProcess('nextNode')">
429
- 确认
430
- </el-button>
431
- <el-button @click="quit"> 取消 </el-button>
432
- </div>
433
- </el-form-item>
434
- </el-form>
435
- <div
436
- v-if="!showBtn && nextNode.noticeList.length > 0 && !hideMessage"
437
- style="padding: 5px; background: #fff"
438
- >
439
- <div class="news" @click="showNews = !showNews">
440
- <span class="news-item">消息通知</span>
441
- <span :class="showNews ? 'show' : 'sj'"></span>
442
- </div>
443
- <div v-if="showNews" ref="messagebox" style="transition: 1s">
444
- <el-checkbox-group v-model="nextNode.noticeType">
445
- <el-checkbox
446
- v-for="item of nextNode.noticeList"
447
- :key="item.cciValue"
448
- :label="item.cciValue"
449
- :disabled="
450
- readOnlyNotificationType
451
- ? readOnlyNotificationType.indexOf(item.cciValue) != -1
452
- : false
453
- "
454
- >
455
- {{ item.shortName }}
456
- </el-checkbox>
457
- </el-checkbox-group>
458
- <es-input
459
- style="
460
- border-color: #ccc;
461
- padding: 5px;
462
- border-radius: 5px;
463
- font-size: 13px;
464
- "
465
- autosize
466
- v-show="showNews"
467
- type="textarea"
468
- v-model="nextNode.noticeInfo"
469
- @change="handleChange"
470
- :readonly="notificationMessageReadOnly"
471
- />
472
- </div>
473
- </div>
474
- </div>
475
- </template>
476
-
477
- <script>
478
- import {
479
- toStartFlow,
480
- getNodeInfo,
481
- findSysCodes,
482
- getNotificationMsg,
483
- findCodeValues,
484
- loginUserInfo,
485
- register,
486
- freeStartFlow,
487
- getProcessDefList,
488
- getNodeInfoForStart,
489
- freeStartFlowWithSubmitTask,
490
- startReadTransferHandleFlowWithTaskReadEnd
491
- } from 'eoss-ui/src/config/api';
492
- import util from 'eoss-ui/src/utils/util';
493
- import SelectUser from './selectUser.vue';
494
- import CommonOpinions from './component/CommonOpinions.vue';
495
- import CustomPreset from './component/CustomPreset.vue';
496
- import Preset from './component/Preset.vue';
497
- export default {
498
- name: 'ProcessForm',
499
-
500
- components: {
501
- [Option.name]: Option,
502
- [SelectUser.name]: SelectUser,
503
- [CustomPreset.name]: CustomPreset,
504
- [CommonOpinions.name]: CommonOpinions,
505
- Preset
506
- },
507
- props: {
508
- isCanReadTransferHandle: {
509
- type: Boolean,
510
- default: false
511
- },
512
- readTransferHandleFlowTypeCode: {
513
- type: String,
514
- default: ''
515
- },
516
- processDefinitionId: {
517
- type: String,
518
- default: ''
519
- },
520
- showTooltip: { type: Boolean, default: true },
521
- copyHistory: {
522
- type: String,
523
- default: ''
524
- },
525
- simpleTips: {
526
- type: Boolean,
527
- default: true
528
- },
529
- formType: {
530
- type: String,
531
- default: 'freeStart'
532
- },
533
- id: {
534
- type: String,
535
- default: ''
536
- },
537
- pendingId: {
538
- type: String,
539
- default: ''
540
- },
541
- opinion: {
542
- type: String,
543
- default: ''
544
- },
545
- isCancelSecondConfirmationType: {
546
- type: Boolean,
547
- default: false
548
- },
549
- isFreeStartFlow: {
550
- type: Boolean,
551
- default: false
552
- },
553
- taskParams: {
554
- type: Object,
555
- default: () => {}
556
- },
557
- taskExamineParam: {
558
- type: String,
559
- default: ''
560
- },
561
- labelPosition: {
562
- type: String,
563
- default: 'right'
564
- },
565
- formTitle: {
566
- type: String,
567
- default: ''
568
- },
569
- showBtn: { type: Boolean, default: true },
570
- messageType: {
571
- type: Array,
572
- default: () => []
573
- },
574
- urgencyLevel: {
575
- type: [Number, String],
576
- default: ''
577
- },
578
- keyCount: {
579
- type: [Number, String],
580
- default: 0
581
- },
582
- selectorParams: { type: Object, default: () => {} },
583
- flowLabelConfig: {
584
- type: Object,
585
- default: () => {
586
- return {};
587
- }
588
- },
589
- hideMessage: { type: Boolean, default: false }
590
- },
591
- data() {
592
- return {
593
- loading: false,
594
- isCustomUser: 0,
595
- currentNodeInfo: { nextNode: '', nextUser: '', option: [] },
596
- isStartFlowChartView: false,
597
- isCurrentNodeForbiddenChangeCandidate: 0,
598
- allLoading: null,
599
- selectUser: false,
600
- multiple: false,
601
- readMultiple: true,
602
- showOpinion: true,
603
- isOpinionRequired: 0,
604
- currentOrgSelectorTabs: ['employee', 'persongroup'],
605
- customPresetHintMessage: '', //流程预设标题
606
- nextNodeCheckType: 'select',
607
- nextOperateCheckType: 'select',
608
- showNews: false, // 是否展示通知信息
609
- notificationMessageReadOnly: false,
610
- isChangeMessage: false,
611
- readOnlyNotificationType: '',
612
- show: true,
613
- enableCustomLimitTimeSetting: false,
614
- radioList: [],
615
- nextCurrentOrgselectUserList: [],
616
- showCustomLimitTimeText: false,
617
- activeNames: '1',
618
- selectUserList: [],
619
- defaultNextNode: '',
620
- presetUserJson: [],
621
- businessId: '',
622
- optionsKey: 0,
623
- isTaskread: 0, //是否显示分阅用户
624
- isHandleExplain: 0, //是否展示办理说明
625
- options: [],
626
- presetList: [],
627
- presetReadUserId: [], //自动分阅
628
- canPresetRead: false, //是否展示自动分阅
629
- nextUserTypes: ['employee', 'persongroup'],
630
- isCustomPreset: false, //是否展示预设节点
631
- isPreset: false, //是否展示预设办理人
632
- isSinglePage: false,
633
- presetEdit: 0,
634
- isDefSelectedObj: 0,
635
- isChooseNextNode: 0,
636
- isHideDefaultOperation: 0,
637
- countersignaturetypeCode: 0,
638
- presetTaskNodeKeyStr: '', //预设办理人顺序
639
- presetTaskNodeMap: {}, //预设办理人
640
- params: {
641
- filid: 'all', //选择范围(my:本单位/ "" or all:全部)
642
- selectmix: 'true1',
643
- deptid: '' //指定部门(my:本部门)
644
- },
645
- newOpinion: '',
646
- operationList: [],
647
- tabs: {
648
- employee: {
649
- param: {
650
- filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId,
651
- name: '本单位用户'
652
- }
653
- },
654
- department: {
655
- param: {
656
- filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
657
- }
658
- }
659
- },
660
- activitiDefinitionSort: false,
661
- userModel: {},
662
- nextUserTabs: {},
663
- selectPresetUserList: [],
664
- presetOptions: [],
665
- selectReadUserList: [],
666
- userOptions: [],
667
- mixReadList: [],
668
- mixPresetList: [],
669
- isCdjxjTaskHandle: '',
670
- isShowNextUser: true,
671
- oldMessage: '',
672
- mixOrgIdList: [], //办理对象混选
673
- subProcessColumns: [],
674
- nextOtherOrgObjSelect: [],
675
- nextCurrentOrgObjSelect: [],
676
- isHideCurrentOrg: false,
677
- isHideOtherOrg: false,
678
- currentOrgSelectorParams: {
679
- filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId,
680
- only_filid: true
681
- },
682
- foreignOrgSelectorParams: { filid: 'all', nofilid: 1 },
683
- nextNode: {
684
- nodeName: '',
685
- customLimitTime: '',
686
- customLimitTimeText: '',
687
- newOpinion: '',
688
- countersignaturetypeText: '',
689
- nextNode: '',
690
- nextReadUserId: [],
691
- nextOrgId: [],
692
- noticeType: [],
693
- nextOperate: '',
694
- nextUser: [],
695
- presetReadUserId: [], //自动分阅
696
- noticeInfo: '',
697
- nodeInfo: [],
698
- userInfo: [],
699
- handleExplain: '',
700
- noticeList: [],
701
- msgTypeCount: 0
702
- }
703
- };
704
- },
705
- watch: {
706
- messageType: {
707
- handler(val) {
708
- if (this.urgencyLevel) {
709
- this.nextNode.noticeList = val;
710
- let arr = [];
711
- this.nextNode.noticeList.map((item) => {
712
- this.nextNode.noticeType.map((x) => {
713
- if (x == item.cciValue) {
714
- arr.push(x);
715
- }
716
- });
717
- });
718
- this.nextNode.noticeType = arr;
719
- } else {
720
- this.msgTypeCount++;
721
- }
722
- }
723
- },
724
- processDefinitionId(val) {
725
- const savedNodeInfo = { ...this.currentNodeInfo };
726
- Object.assign(this.$data, this.$options.data());
727
- this.currentNodeInfo = savedNodeInfo;
728
- this.getUserInfo();
729
- this.getNodeType();
730
- this.getStartFlow(val);
731
- if (this.copyHistory) {
732
- this.nextNode.newOpinion = this.opinion;
733
- } else if (this.formType != 'readTransfer') {
734
- this.newOpinion = this.opinion;
735
- }
736
- // this.getStartFlow(val);
737
- },
738
- opinion(val) {
739
- this.newOpinion = this.opinion;
740
- },
741
- formTitle: {
742
- handler(val) {
743
- if (!this.showBtn && !this.isChangeMessage) {
744
- this.nextNode.noticeInfo = this.oldMessage.replace('{title}', val);
745
- }
746
- },
747
- deep: true,
748
- immediate: true
749
- }
750
- },
751
- computed: {
752
- rules() {
753
- return {
754
- customLimitTime: [
755
- {
756
- required: this.enableCustomLimitTimeSetting,
757
- message: this.showCustomLimitTimeText
758
- ? '请输入限时办理天数'
759
- : '请选择限时办理天数',
760
- trigger: 'blur'
761
- },
762
- {
763
- required: this.enableCustomLimitTimeSetting,
764
- validator: this.checkCustomLimitTime,
765
- trigger: 'blur'
766
- }
767
- ]
768
- };
769
- },
770
- types() {
771
- if (this.isCdjxjTaskHandle == 'true') {
772
- return ['employee', 'enterprise', 'department'];
773
- } else {
774
- return ['employee', 'enterprise', 'department', 'persongroup'];
775
- }
776
- }
777
- },
778
- created() {
779
- this.getUserInfo();
780
- },
781
- mounted() {
782
- if (!this.urgencyLevel) {
783
- this.getNodeType();
784
- }
785
- this.getStartFlow(this.processDefinitionId);
786
- if (this.copyHistory) {
787
- this.nextNode.newOpinion = this.opinion;
788
- } else if (this.formType != 'readTransfer') {
789
- this.newOpinion = this.opinion;
790
- }
791
- if (this.isCanReadTransferHandle && this.readTransferHandleFlowTypeCode) {
792
- this.getProcess(this.readTransferHandleFlowTypeCode);
793
- }
794
- },
795
- methods: {
796
- /**
797
- * getProcess
798
- * @desc:获取选择流程
799
- * @author liufan
800
- * @date 2022年5月25日
801
- **/
802
- getProcess(val) {
803
- let params = {
804
- businessId: this.businessId,
805
- flowTypeCode: val || this.flowTypeCode,
806
- // defaultProcessKey: this.defaultProcessKey,
807
- isOnly: true,
808
- hideTempSave: true
809
- };
810
- const loading = util.loading(this.$loading, '加载中...');
811
- util
812
- .ajax({ url: getProcessDefList, params })
813
- .then((res) => {
814
- const { status, message, data } = res;
815
- loading.close();
816
- if (status === 'success') {
817
- this.isStartFlowChartView = data.isStartFlowChartView;
818
- if (
819
- !Object.keys(data).length ||
820
- (data.definitionList && !data.definitionList.length)
821
- ) {
822
- this.$message.error('流程不存在或未关联对应流程!');
823
- } else {
824
- this.activitiDefinitionSort = data.activitiDefinitionSort;
825
- this.currentNodeInfo.option = data.definitionList;
826
- this.currentNodeInfo.nextNode = data.definitionList.filter(
827
- (item) => item.processDefKey == this.defaultProcessKey
828
- );
829
- if (this.currentNodeInfo.nextNode.length) {
830
- this.currentNodeInfo.nextNode =
831
- this.currentNodeInfo.nextNode[0].processDefId;
832
- } else {
833
- if (data.definitionList.length != 0) {
834
- this.currentNodeInfo.nextNode =
835
- data.definitionList[0].processDefId;
836
- } else {
837
- this.currentNodeInfo.nextNode = '';
838
- }
839
- }
840
- if (this.currentNodeInfo.nextNode) {
841
- this.handleFlowChange(this.currentNodeInfo.nextNode, true);
842
- }
843
- }
844
- } else {
845
- this.$message.error(message || '系统错误,请联系管理员!');
846
- }
847
- })
848
- .catch((err) => {
849
- loading.close();
850
- if (err.message && err.message !== 'canceled') {
851
- this.$message.error(err.message);
852
- }
853
- });
854
- },
855
- handleChangeTime(val) {
856
- this.nextNode.customLimitTime = val;
857
- },
858
- limitTimevalidate() {
859
- let validSate = true;
860
- this.$refs.nextNode.validate((valid) => {
861
- if (valid) {
862
- validSate = true;
863
- } else {
864
- validSate = false;
865
- }
866
- });
867
- return validSate;
868
- },
869
- checkCustomLimitTime(rule, value, callback) {
870
- if (!Number(value) || value.indexOf('.') != -1 || Number(value) < 0) {
871
- callback(new Error('请输入正确的天数'));
872
- this.nextNode.customLimitTime = '';
873
- } else {
874
- callback();
875
- }
876
- },
877
- handleFlowChange(val) {
878
- this.getNodeInfoForStartFlow(val);
879
- this.$parent.$emit('flowChange', val);
880
- },
881
- getNodeInfoForStartFlow(processDefinitionId) {
882
- let params = {
883
- url: getNodeInfoForStart,
884
- params: { processDefinitionId }
885
- };
886
- util.ajax(params).then((res) => {
887
- if (res.status == 'success') {
888
- this.isOpinionRequired = res.data.nodeExtAttr.isOpinionRequired;
889
- this.showOpinion = false;
890
- setTimeout(() => {
891
- this.showOpinion = true;
892
- }, 0);
893
- this.processDefinitionId = processDefinitionId;
894
- // this.getStartFlow(processDefinitionId);
895
- // this.getNodeInfos(undefined, undefined, processDefinitionId);
896
- }
897
- });
898
- },
899
- handleChange() {
900
- this.isChangeMessage = true;
901
- },
902
- changeCustomLimitTime(val) {
903
- if (!Number(val) || val.indexOf('.') != -1 || Number(val) < 0) {
904
- this.$message.warning('请输入正确的天数');
905
- this.nextNode.customLimitTime = '';
906
- }
907
- },
908
- getUserInfo() {
909
- let mainConfig = util.getStorage('mainConfig');
910
- if (mainConfig) {
911
- this.userModel = JSON.parse(mainConfig).userModel;
912
- this.foreignOrgSelectorParams.nofilid = this.userModel.orgId;
913
- this.foreignOrgSelectorParams.roleid =
914
- this.currentOrgSelectorParams.roleid = this.selectorParams.roleid;
915
- } else {
916
- util
917
- .ajax({ url: loginUserInfo })
918
- .then((res) => {
919
- const { status, data } = res;
920
- if (status == 'success') {
921
- this.userModel = data;
922
- this.foreignOrgSelectorParams.nofilid = this.userModel.orgId;
923
- this.foreignOrgSelectorParams.roleid =
924
- tthis.currentOrgSelectorParams.roleid =
925
- this.selectorParams.roleid;
926
- } else {
927
- let msg = res.msg || '系统错误,请联系管理员!';
928
- this.$message.error(msg);
929
- }
930
- })
931
- .catch((err) => {
932
- if (err.message && err.message !== 'canceled') {
933
- this.$message.error(err.message);
934
- }
935
- });
936
- }
937
- },
938
- getIsShowNextUser(val) {
939
- if (
940
- val == 7 ||
941
- val == 8 ||
942
- val == 9 ||
943
- val == 10 ||
944
- val == 11 ||
945
- val == 12
946
- ) {
947
- this.isShowNextUser = false;
948
- //设置办理角色
949
- // $("#orgRoleCode").val(handleRoleId);
950
- if (val == 7 || val == 8) {
951
- this.nextUserTypes = ['department'];
952
- this.nextUserTabs = {
953
- department: {
954
- param: {
955
- filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
956
- }
957
- }
958
- };
959
- this.multiple = true;
960
- } else if (val == 9 || val == 10) {
961
- this.nextUserTypes = ['enterprise'];
962
- this.nextUserTabs = { enterprise: { param: { filid: 'other' } } };
963
- this.multiple = true;
964
- } else if (val == 11 || val == 12) {
965
- this.nextUserTypes = ['department', 'enterprise'];
966
- this.nextUserTabs = {
967
- enterprise: { param: { filid: 'other' } },
968
- department: {
969
- param: {
970
- filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
971
- }
972
- }
973
- };
974
- this.multiple = true;
975
- }
976
- }
977
- if (val == 7 || val == 9 || val == 11) {
978
- this.multiple = false;
979
- }
980
- },
981
- // 分阅是否多选
982
- isReadMultiple(nextReadUserSelectType) {
983
- if (nextReadUserSelectType == 1) {
984
- this.readMultiple = false;
985
- } else if (nextReadUserSelectType == 2) {
986
- this.readMultiple = true;
987
- } else if (nextReadUserSelectType == 3) {
988
- this.readMultiple = false;
989
- } else if (nextReadUserSelectType == 4) {
990
- this.readMultiple = true;
991
- } else if (nextReadUserSelectType == 5) {
992
- this.readMultiple = false;
993
- } else if (nextReadUserSelectType == 6) {
994
- this.readMultiple = true;
995
- }
996
- },
997
- changeSelectReadUser(val, type) {
998
- const { nextUser, mixList } = val;
999
- this.nextNode[type] = nextUser;
1000
- if (type === 'presetReadUserId') {
1001
- this.mixPresetList = mixList;
1002
- } else {
1003
- this.mixReadList = mixList;
1004
- }
1005
- },
1006
- selecNext(val) {
1007
- this.nextNode.nextUser = [];
1008
- this.options = [];
1009
- this.selectUserList = [];
1010
- this.radioList = [];
1011
- if (this.showBtn) {
1012
- this.loading = true;
1013
- } else {
1014
- this.allLoading = util.loading(this.$loading, '加载中...');
1015
- }
1016
- this.nextNode.nodeInfo = this.operationList[val].list;
1017
- if (this.nextNode.nodeInfo.length > 0) {
1018
- let defaultNodeData = this.nextNode.nodeInfo.filter(
1019
- (x) => x.nodeId == this.defaultNextNode
1020
- );
1021
- length;
1022
- this.nextNode.nextNode =
1023
- defaultNodeData.length > 0
1024
- ? this.defaultNextNode
1025
- : this.nextNode.nodeInfo[0].nodeId;
1026
- }
1027
- this.getNodeInfos();
1028
- },
1029
- changeSelectUser(val, type) {
1030
- const { nextUser, options, mixList } = val;
1031
- this.nextNode[type] = nextUser;
1032
- this.mixOrgIdList = mixList;
1033
- },
1034
- getsubProcessColumns() {
1035
- let data = [];
1036
- let obj = { name: '[部门员工]-' };
1037
- if (this.nextCurrentOrgObjSelect.length > 0) {
1038
- this.nextCurrentOrgObjSelect.map((x) => {
1039
- if (x.stype == 'employee') {
1040
- obj.name = !obj.value
1041
- ? obj.name + x.showname
1042
- : obj.name + ',' + x.showname;
1043
- obj.value = obj.value
1044
- ? obj.value + ',' + x.showid
1045
- : 'employee-' + x.showid;
1046
- } else {
1047
- data.push({
1048
- name: '[部门]' + x.showname,
1049
- value: 'department-' + x.showid
1050
- });
1051
- }
1052
- });
1053
- }
1054
- obj.value && data.push(obj);
1055
- if (this.nextOtherOrgObjSelect.length > 0) {
1056
- this.nextOtherOrgObjSelect.map((x) => {
1057
- data.push({
1058
- name: '[企业]' + x.showname,
1059
- value: 'enterprise-' + x.showid
1060
- });
1061
- });
1062
- }
1063
- this.subProcessColumns = data;
1064
- // return data;
1065
- },
1066
- // 单位选择完回调
1067
- disposeAppUnit(res, type) {
1068
- let label = type.substring(0, type.lastIndexOf('Select'));
1069
- this.nextNode[label + 'Name'] = '';
1070
- res.options && (this[type] = res.options);
1071
- let obj = {};
1072
- // if (typeof res.mixList == 'array')
1073
- res.mixList && (this.nextNode[label] = res.mixList.join('|'));
1074
- res.options.map((item) => {
1075
- if (obj[item.stype]) {
1076
- obj[item.stype].push(item.showname);
1077
- } else {
1078
- obj[item.stype] = [item.showname];
1079
- }
1080
- });
1081
- for (let key in obj) {
1082
- if (
1083
- key === 'enterprise' &&
1084
- this.nextNode[label + 'Name'].indexOf('[企业]') == -1
1085
- ) {
1086
- this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1087
- ? this.nextNode[label + 'Name'] +
1088
- '|' +
1089
- '[企业]-' +
1090
- obj[key].join(',')
1091
- : '' + '[企业]-' + obj[key].join(',');
1092
- }
1093
- if (
1094
- key === 'department' &&
1095
- this.nextNode[label + 'Name'].indexOf('[部门]') == -1
1096
- ) {
1097
- this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1098
- ? this.nextNode[label + 'Name'] +
1099
- '|' +
1100
- '[部门]-' +
1101
- obj[key].join(',')
1102
- : '' + '[部门]-' + obj[key].join(',');
1103
- }
1104
- if (
1105
- key === 'employee' &&
1106
- this.nextNode[label + 'Name'].indexOf('[部门员工]') == -1
1107
- ) {
1108
- this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1109
- ? this.nextNode[label + 'Name'] +
1110
- '|' +
1111
- '[部门员工]-' +
1112
- obj[key].join(',')
1113
- : '' + '[部门员工]-' + obj[key].join(',');
1114
- }
1115
- }
1116
- // this.nextNode[label + 'Name'] = obj.enterprise?;
1117
- if (!this.currentNodeIsCircularReadNode) {
1118
- this.nextNode[label + 'SerialId'] = res.nextUser.join(',');
1119
- this.nextNode[label + 'Json'] = JSON.stringify(res.options);
1120
- }
1121
- this.getsubProcessColumns();
1122
- },
1123
- getNodeType() {
1124
- util
1125
- .ajax({
1126
- url: findCodeValues,
1127
- params: {
1128
- ccCode: 'notification_type',
1129
- userId: util.getStorage('userId')
1130
- }
1131
- })
1132
- .then((res) => {
1133
- const { status, data } = res;
1134
- if (status === 'success') {
1135
- this.nextNode.noticeList = data;
1136
- }
1137
- })
1138
- .catch((err) => {
1139
- if (this.showBtn) {
1140
- this.loading = false;
1141
- } else {
1142
- this.allLoading.close();
1143
- }
1144
- if (err.message && err.message !== 'canceled') {
1145
- this.$message.error(err.message);
1146
- }
1147
- });
1148
- },
1149
- //获取通知信息
1150
- getMessage() {
1151
- let params = {
1152
- processDefinitionId: this.processDefinitionId,
1153
- nodeId: this.nextNode.nextNode,
1154
- businessId: this.id
1155
- };
1156
- if (!this.showBtn) {
1157
- params.openMode = 'samepage';
1158
- }
1159
- util
1160
- .ajax({ url: getNotificationMsg, params, methods: 'post' })
1161
- .then((res) => {
1162
- if (res.status === 'success') {
1163
- if (!this.showBtn) {
1164
- this.oldMessage = res.message;
1165
- this.nextNode.noticeInfo = res.message.replace(
1166
- '{title}',
1167
- this.formTitle
1168
- );
1169
- } else {
1170
- this.nextNode.noticeInfo = res.message;
1171
- }
1172
- }
1173
- })
1174
- .catch((err) => {
1175
- if (this.showBtn) {
1176
- this.loading = false;
1177
- } else {
1178
- this.allLoading.close();
1179
- }
1180
- if (err.message && err.message !== 'canceled') {
1181
- this.$message.error(err.message);
1182
- }
1183
- });
1184
- },
1185
- // 提交表单
1186
- subProcess(formName) {
1187
- this.saveProcess(formName);
1188
- },
1189
- saveProcess(formName) {
1190
- this.$refs[formName].validate((valid) => {
1191
- if (valid) {
1192
- const {
1193
- nextNode,
1194
- nextUser,
1195
- noticeInfo,
1196
- noticeType,
1197
- handleExplain,
1198
- presetReadUserId,
1199
- nextReadUserId,
1200
- nextOrgId,
1201
- newOpinion,
1202
- customLimitTime,
1203
- nextOtherOrgObj,
1204
- nextCurrentOrgObj
1205
- } = this.nextNode;
1206
- // if (noticeType.length === 0) {
1207
- // return this.$message.warning('请选择通知方式');
1208
- // }
1209
- if (this.isShowNextUser) {
1210
- if (
1211
- (nextUser == '' || (this.multiple && nextUser.length == 0)) &&
1212
- !this.isHideCurrentOrg &&
1213
- !this.isHideOtherOrg
1214
- ) {
1215
- return this.$message.warning(
1216
- `请选择${this.flowLabelConfig.nextUser || '下步办理人'}`
1217
- );
1218
- }
1219
- } else {
1220
- if (nextOrgId == '' || (this.multiple && nextOrgId.length == 0)) {
1221
- return this.$message.warning('请选择办理对象');
1222
- }
1223
- }
1224
- if (
1225
- (this.isHideOtherOrg || this.isHideCurrentOrg) &&
1226
- !nextCurrentOrgObj &&
1227
- !nextOtherOrgObj
1228
- ) {
1229
- return this.$message.warning('请选择办理对象');
1230
- }
1231
- if (this.isCancelSecondConfirmationType) {
1232
- this.$confirm('确认提交吗?', '提示', {
1233
- confirmButtonText: '确定',
1234
- cancelButtonText: '取消',
1235
- type: 'warning'
1236
- }).then(() => {
1237
- if (this.showBtn) {
1238
- this.loading = true;
1239
- } else {
1240
- this.allLoading = util.loading(this.$loading, '加载中...');
1241
- }
1242
- let newNextUser = [];
1243
- if (this.multiple) {
1244
- nextUser && nextUser.map((item) => newNextUser.push(item));
1245
- }
1246
- let newNoticeType = '';
1247
- if (noticeType) {
1248
- newNoticeType = noticeType.join(',');
1249
- }
1250
- let params = {
1251
- processDefinitionId: this.processDefinitionId,
1252
- nextUserId: this.multiple ? newNextUser.join(',') : nextUser,
1253
- nextNodeId: nextNode,
1254
- businessId: this.businessId,
1255
- notificationType: newNoticeType,
1256
- userId: util.getStorage('userId'),
1257
- notificationMsg: noticeInfo,
1258
- customPresetUserJson: JSON.stringify(this.presetList),
1259
- presetUserJson: JSON.stringify(this.presetUserJson),
1260
- nextReadUserId: this.readMultiple
1261
- ? this.mixReadList && this.mixReadList.join('|')
1262
- : nextReadUserId,
1263
- nextOrgId: !this.isShowNextUser
1264
- ? this.multiple
1265
- ? this.mixOrgIdList && this.mixOrgIdList.join('|')
1266
- : nextOrgId
1267
- : '',
1268
- handleExplain: handleExplain,
1269
- presetReadUserId:
1270
- this.mixPresetList && this.mixPresetList.length > 0
1271
- ? this.mixPresetList.join('|')
1272
- : presetReadUserId.join(','),
1273
- opinion: this.newOpinion || newOpinion
1274
- };
1275
- if (this.enableCustomLimitTimeSetting) {
1276
- params.customLimitTime = customLimitTime;
1277
- if (!customLimitTime) {
1278
- this.$message.warning('请选择或输入限时办理的天数');
1279
- this.nextNode.customLimitTime = '';
1280
- return;
1281
- } else if (
1282
- !Number(customLimitTime) ||
1283
- customLimitTime.indexOf('.') != -1 ||
1284
- Number(customLimitTime) < 0
1285
- ) {
1286
- this.$message.warning('请输入正确的天数');
1287
- this.nextNode.customLimitTime = '';
1288
- return;
1289
- }
1290
- }
1291
- if (this.isHideCurrentOrg) {
1292
- params.nextCurrentOrgObj = nextCurrentOrgObj;
1293
- }
1294
- if (this.isHideOtherOrg) {
1295
- params.nextOtherOrgObj = nextOtherOrgObj;
1296
- }
1297
- if (this.activeNames != '1' || !this.isCustomPreset)
1298
- delete params.customPresetUserJson;
1299
- if (this.isFreeStartFlow || this.formType === 'readTransfer') {
1300
- let newParm = {};
1301
- newParm.copyHistory =
1302
- this.copyHistory === 'needCopyPendedHistory';
1303
- newParm.startFlowParamJson = params;
1304
- // newParm.startFlowParamJson.businessId = this.id; //this.id
1305
- newParm.startFlowParamJson.taskExamineParam = {
1306
- startFlowFirstNodeName: this.taskExamineParam
1307
- };
1308
- newParm.startFlowParamJson = JSON.stringify(
1309
- newParm.startFlowParamJson
1310
- );
1311
- for (let key in this.taskParams) {
1312
- if (Array.isArray(this.taskParams[key])) {
1313
- this.taskParams[key] =
1314
- this.taskParams[key].length > 0
1315
- ? this.taskParams[key].join(',')
1316
- : '';
1317
- }
1318
- }
1319
-
1320
- newParm.submitTaskParamJson = JSON.stringify(this.taskParams);
1321
- if (this.formType == 'readTransfer') {
1322
- newParm.readTransferHandleStartFlowParamJson =
1323
- JSON.stringify(params);
1324
- newParm.taskReadEndParamJson = JSON.stringify(
1325
- this.taskParams
1326
- );
1327
- delete newParm.copyHistory;
1328
- delete newParm.startFlowParamJson;
1329
- delete newParm.submitTaskParamJson;
1330
- }
1331
- params = newParm;
1332
- }
1333
- if (this.copyHistory && !this.isFreeStartFlow) {
1334
- params.pendingId = this.pendingId;
1335
- delete params.businessId;
1336
- }
1337
- util
1338
- .ajax({
1339
- url: this.isFreeStartFlow
1340
- ? freeStartFlowWithSubmitTask
1341
- : this.formType == 'readTransfer'
1342
- ? startReadTransferHandleFlowWithTaskReadEnd
1343
- : this.copyHistory
1344
- ? freeStartFlow
1345
- : register,
1346
- method: 'post',
1347
- data: params
1348
- })
1349
- .then((res) => {
1350
- const { status, message } = res;
1351
- if (this.showBtn) {
1352
- this.loading = false;
1353
- } else {
1354
- this.allLoading.close();
1355
- }
1356
- if (status === 'success' || res.rCode == 0) {
1357
- this.quit(true);
1358
- this.simpleTips && this.$message.success('操作成功');
1359
- } else {
1360
- this.$message.error(message || '系统错误,请联系管理员!');
1361
- }
1362
- })
1363
- .catch((err) => {
1364
- if (this.showBtn) {
1365
- this.loading = false;
1366
- } else {
1367
- this.allLoading.close();
1368
- }
1369
- if (err.message && err.message !== 'canceled') {
1370
- this.$message.error(err.message);
1371
- }
1372
- });
1373
- });
1374
- return;
1375
- }
1376
- if (this.showBtn) {
1377
- this.loading = true;
1378
- } else {
1379
- this.allLoading = util.loading(this.$loading, '加载中...');
1380
- }
1381
- let newNextUser = [];
1382
- if (this.multiple) {
1383
- nextUser && nextUser.map((item) => newNextUser.push(item));
1384
- }
1385
- let newNoticeType = '';
1386
- if (noticeType) {
1387
- newNoticeType = noticeType.join(',');
1388
- }
1389
- let params = {
1390
- processDefinitionId: this.processDefinitionId,
1391
- nextUserId: this.multiple ? newNextUser.join(',') : nextUser,
1392
- nextNodeId: nextNode,
1393
- businessId: this.businessId,
1394
- notificationType: newNoticeType,
1395
- userId: util.getStorage('userId'),
1396
- notificationMsg: noticeInfo,
1397
- customPresetUserJson: JSON.stringify(this.presetList),
1398
- presetUserJson: JSON.stringify(this.presetUserJson),
1399
- nextReadUserId: this.readMultiple
1400
- ? this.mixReadList && this.mixReadList.join('|')
1401
- : nextReadUserId,
1402
- nextOrgId: !this.isShowNextUser
1403
- ? this.multiple
1404
- ? this.mixOrgIdList && this.mixOrgIdList.join('|')
1405
- : nextOrgId
1406
- : '',
1407
- handleExplain: handleExplain,
1408
- presetReadUserId:
1409
- this.mixPresetList && this.mixPresetList.length > 0
1410
- ? this.mixPresetList.join('|')
1411
- : presetReadUserId.join(','),
1412
- opinion: this.newOpinion || newOpinion
1413
- };
1414
- if (this.enableCustomLimitTimeSetting) {
1415
- params.customLimitTime = customLimitTime;
1416
- if (!customLimitTime) {
1417
- this.$message.warning('请选择或输入限时办理的天数');
1418
- this.nextNode.customLimitTime = '';
1419
- return;
1420
- } else if (
1421
- !Number(customLimitTime) ||
1422
- customLimitTime.indexOf('.') != -1 ||
1423
- Number(customLimitTime) < 0
1424
- ) {
1425
- this.$message.warning('请输入正确的天数');
1426
- this.nextNode.customLimitTime = '';
1427
- return;
1428
- }
1429
- }
1430
- if (this.isHideCurrentOrg) {
1431
- params.nextCurrentOrgObj = nextCurrentOrgObj;
1432
- }
1433
- if (this.isHideOtherOrg) {
1434
- params.nextOtherOrgObj = nextOtherOrgObj;
1435
- }
1436
- if (this.activeNames != '1' || !this.isCustomPreset)
1437
- delete params.customPresetUserJson;
1438
- if (this.isFreeStartFlow || this.formType === 'readTransfer') {
1439
- let newParm = {};
1440
- newParm.copyHistory = this.copyHistory === 'needCopyPendedHistory';
1441
- newParm.startFlowParamJson = params;
1442
- // newParm.startFlowParamJson.businessId = this.id; //this.id
1443
- newParm.startFlowParamJson.taskExamineParam = {
1444
- startFlowFirstNodeName: this.taskExamineParam
1445
- };
1446
- newParm.startFlowParamJson = JSON.stringify(
1447
- newParm.startFlowParamJson
1448
- );
1449
- for (let key in this.taskParams) {
1450
- if (Array.isArray(this.taskParams[key])) {
1451
- this.taskParams[key] =
1452
- this.taskParams[key].length > 0
1453
- ? this.taskParams[key].join(',')
1454
- : '';
1455
- }
1456
- }
1457
-
1458
- newParm.submitTaskParamJson = JSON.stringify(this.taskParams);
1459
- if (this.formType == 'readTransfer') {
1460
- newParm.readTransferHandleStartFlowParamJson =
1461
- JSON.stringify(params);
1462
- newParm.taskReadEndParamJson = JSON.stringify(this.taskParams);
1463
- delete newParm.copyHistory;
1464
- delete newParm.startFlowParamJson;
1465
- delete newParm.submitTaskParamJson;
1466
- }
1467
- params = newParm;
1468
- }
1469
- if (this.copyHistory && !this.isFreeStartFlow) {
1470
- params.pendingId = this.pendingId;
1471
- delete params.businessId;
1472
- }
1473
- util
1474
- .ajax({
1475
- url: this.isFreeStartFlow
1476
- ? freeStartFlowWithSubmitTask
1477
- : this.formType == 'readTransfer'
1478
- ? startReadTransferHandleFlowWithTaskReadEnd
1479
- : this.copyHistory
1480
- ? freeStartFlow
1481
- : register,
1482
- method: 'post',
1483
- data: params
1484
- })
1485
- .then((res) => {
1486
- const { status, message } = res;
1487
- if (this.showBtn) {
1488
- this.loading = false;
1489
- } else {
1490
- this.allLoading.close();
1491
- }
1492
- if (status === 'success' || res.rCode == 0) {
1493
- this.quit(true);
1494
- this.simpleTips && this.$message.success('操作成功');
1495
- } else {
1496
- this.$message.error(message || '系统错误,请联系管理员!');
1497
- }
1498
- })
1499
- .catch((err) => {
1500
- if (this.showBtn) {
1501
- this.loading = false;
1502
- } else {
1503
- this.allLoading.close();
1504
- }
1505
- if (err.message && err.message !== 'canceled') {
1506
- this.$message.error(err.message);
1507
- }
1508
- });
1509
- } else {
1510
- return false;
1511
- }
1512
- });
1513
- },
1514
- getNodeInfos(nodeId, index, processDefinitionId) {
1515
- let params = {
1516
- processDefinitionId: processDefinitionId || this.processDefinitionId,
1517
- nextNodeId: nodeId ? nodeId : this.nextNode.nextNode,
1518
- businessId: this.id,
1519
- userId: util.getStorage('userId')
1520
- };
1521
- util
1522
- .ajax({ url: getNodeInfo, params })
1523
- .then((res) => {
1524
- const {
1525
- status,
1526
- message,
1527
- data: {
1528
- nextUserList,
1529
- nodeExtAttr,
1530
- nodeMoreInfo,
1531
- countersignaturetypeText,
1532
- countersignaturetypeCode
1533
- }
1534
- } = res;
1535
- if (this.showBtn) {
1536
- this.loading = false;
1537
- } else {
1538
- this.allLoading.close();
1539
- }
1540
- if (status === 'success') {
1541
- if (
1542
- this.currentOrgSelectorParams.department &&
1543
- !this.currentOrgSelectorParams.department.roleid &&
1544
- this.selectorParams.roleid &&
1545
- nodeExtAttr.deptRoleCode
1546
- ) {
1547
- this.currentOrgSelectorParams.department.roleid =
1548
- nodeExtAttr.deptRoleCode;
1549
- }
1550
- this.isCurrentNodeForbiddenChangeCandidate =
1551
- nodeExtAttr.isCurrentNodeForbiddenChangeCandidate;
1552
- this.nextNode.userInfo = nextUserList;
1553
- this.countersignaturetypeCode = countersignaturetypeCode;
1554
- this.nextNode.countersignaturetypeText = countersignaturetypeText;
1555
- this.enableCustomLimitTimeSetting =
1556
- nodeExtAttr.enableCustomLimitTimeSetting == 1;
1557
- if (nodeMoreInfo.currentOrgDefaultSelectObjectItems) {
1558
- this.nextCurrentOrgselectUserList = [];
1559
- if (
1560
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.deptIds.length >
1561
- 0
1562
- ) {
1563
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.deptIds.map(
1564
- (x, i) => {
1565
- this.nextCurrentOrgselectUserList.push({
1566
- showname:
1567
- nodeMoreInfo.currentOrgDefaultSelectObjectItems
1568
- .deptNames[i],
1569
- showid: x,
1570
- stype: 'department'
1571
- });
1572
- }
1573
- );
1574
- }
1575
- if (
1576
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.userIds.length >
1577
- 0
1578
- ) {
1579
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.userIds.map(
1580
- (x, i) => {
1581
- this.nextCurrentOrgselectUserList.push({
1582
- showname:
1583
- nodeMoreInfo.currentOrgDefaultSelectObjectItems
1584
- .userNames[i],
1585
- showid: x,
1586
- stype: 'employee'
1587
- });
1588
- }
1589
- );
1590
- }
1591
- if (
1592
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.orgIds.length >
1593
- 0
1594
- ) {
1595
- nodeMoreInfo.currentOrgDefaultSelectObjectItems.orgIds.map(
1596
- (x, i) => {
1597
- this.nextCurrentOrgselectUserList.push({
1598
- showname:
1599
- nodeMoreInfo.currentOrgDefaultSelectObjectItems
1600
- .orgNames[i],
1601
- showid: x,
1602
- stype: 'enterprise'
1603
- });
1604
- }
1605
- );
1606
- }
1607
- this.nextNode.nextCurrentOrgObj =
1608
- nodeMoreInfo.currentOrgDefaultSelectObjects;
1609
- }
1610
- if (
1611
- this.enableCustomLimitTimeSetting &&
1612
- nodeMoreInfo.defaultCustomLimitDays
1613
- ) {
1614
- this.nextNode.customLimitTime =
1615
- this.nextNode.customLimitTimeText =
1616
- nodeMoreInfo.defaultCustomLimitDays + '';
1617
- }
1618
- this.isTaskread = nodeExtAttr.isTaskread;
1619
- this.isHandleExplain = nodeExtAttr.isHandleExplain;
1620
- this.isCustomUser = nodeExtAttr.isCustomUser; //是否展示选人组件按钮
1621
- this.presetEdit = nodeExtAttr.presetEdit; //是否展示备选人
1622
- this.isDefSelectedObj = nodeExtAttr.isDefSelectedObj; //是否默认选中
1623
- if (
1624
- nodeExtAttr.userSelectionType == 7 ||
1625
- nodeExtAttr.userSelectionType == 8 ||
1626
- nodeExtAttr.userSelectionType == 9 ||
1627
- nodeExtAttr.userSelectionType == 10 ||
1628
- nodeExtAttr.userSelectionType == 11 ||
1629
- nodeExtAttr.userSelectionType == 12
1630
- ) {
1631
- this.getIsShowNextUser(
1632
- nodeExtAttr && nodeExtAttr.userSelectionType
1633
- );
1634
- } else {
1635
- const { multiple, params } = this.isMultiple(
1636
- nodeExtAttr.userSelectionType
1637
- );
1638
- this.multiple = multiple;
1639
- this.params = params;
1640
- }
1641
- // this.isReadMultiple(nodeExtAttr.userSelectionType);
1642
- if (nodeExtAttr.nodeType === 1 || nodeExtAttr.nodeType === 2) {
1643
- this.isHideCurrentOrg =
1644
- nodeExtAttr.isHideCurrentOrg == 1 ? false : true; //判断是否隐藏本单位
1645
- this.isHideOtherOrg =
1646
- nodeExtAttr.isHideOtherOrg == 1 ? false : true; //判断是否隐藏外单位
1647
- } else {
1648
- this.isHideCurrentOrg = false;
1649
- this.isHideOtherOrg = false;
1650
- }
1651
- nextUserList.map((item) => {
1652
- if (
1653
- this.multiple &&
1654
- nodeExtAttr.isDefSelectedObj == 1 &&
1655
- nextUserList !== undefined
1656
- ) {
1657
- this.nextNode.nextUser.push(item.userId);
1658
- this.selectUserList.push({
1659
- showname: item.username,
1660
- showid: item.userId
1661
- });
1662
- }
1663
-
1664
- this.options.push({
1665
- showname: item.username,
1666
- showid: item.userId
1667
- });
1668
- });
1669
- if (this.multiple) {
1670
- this.nextNode.nextReadUserId = [];
1671
- } else {
1672
- this.nextNode.nextReadUserId = '';
1673
- }
1674
- if (
1675
- nextUserList.length > 0 &&
1676
- nodeExtAttr.isDefSelectedObj == 1 &&
1677
- !this.multiple
1678
- ) {
1679
- this.nextNode.nextUser = nextUserList[0].userId;
1680
- this.selectUserList.push({
1681
- showname: nextUserList[0].username,
1682
- showid: nextUserList[0].userId
1683
- });
1684
- }
1685
- this.radioList = this.options;
1686
- } else {
1687
- this.$message.error(message || '系统错误,请联系管理员!');
1688
- }
1689
- nodeId && this.$refs.selectUser[index].changeInfo();
1690
- })
1691
- .catch((err) => {
1692
- if (this.showBtn) {
1693
- this.loading = false;
1694
- } else {
1695
- this.allLoading.close();
1696
- }
1697
- if (err.message && err.message !== 'canceled') {
1698
- this.$message.error(err.message);
1699
- }
1700
- });
1701
- },
1702
- changeSel(val) {
1703
- this.nextNode.nextUser = [];
1704
- this.options = [];
1705
- this.selectUserList = [];
1706
- this.radioList = [];
1707
- if (this.showBtn) {
1708
- this.loading = true;
1709
- } else {
1710
- this.allLoading = util.loading(this.$loading, '加载中...');
1711
- }
1712
- this.getNodeInfos();
1713
- },
1714
- // 取消
1715
- quit(val) {
1716
- if (val === true) return this.$emit('cancel', val);
1717
- this.$emit('cancel', false);
1718
- },
1719
- getFind() {
1720
- util
1721
- .ajax({
1722
- url: findSysCodes
1723
- })
1724
- .then((res) => {
1725
- const { status, message } = res;
1726
- if (status === 'success') {
1727
- if (this.hideMessage) return;
1728
- this.nextNode.noticeType = message.split(',');
1729
- let arr = [];
1730
- this.nextNode.noticeList.map((item) => {
1731
- this.nextNode.noticeType.map((x) => {
1732
- if (x == item.cciValue) {
1733
- arr.push(x);
1734
- }
1735
- });
1736
- });
1737
- this.nextNode.noticeType = arr;
1738
- } else {
1739
- this.$message.error(message || '系统错误,请联系管理员!');
1740
- }
1741
- })
1742
- .catch((err) => {
1743
- if (this.showBtn) {
1744
- this.loading = false;
1745
- } else {
1746
- this.allLoading.close();
1747
- }
1748
- if (err.message && err.message !== 'canceled') {
1749
- this.$message.error(err.message);
1750
- }
1751
- });
1752
- },
1753
- /**
1754
- * isMultiple
1755
- * @desc:是否多选
1756
- * @author liufan
1757
- * @date 2022年9月13日
1758
- **/
1759
- isMultiple(val, choiceOrgId, choiceDeptId, pOrgId) {
1760
- let multiple = false;
1761
- let params = {};
1762
- if (val == 2 || val == 4 || val == 6 || val == 16 || val == 12) {
1763
- multiple = true;
1764
- }
1765
- if (val == 1 || val == 2 || val == 5) {
1766
- params.filid = this.userModel.orgId;
1767
- params.only_filid = true;
1768
- if (choiceOrgId) {
1769
- params.filid = choiceOrgId;
1770
- }
1771
- }
1772
- if (val == 5 || val == 6) {
1773
- params.filid = this.userModel.orgId;
1774
- params.mydeptid = this.userModel.depId;
1775
- if (choiceDeptId) {
1776
- params.mydeptid = choiceDeptId;
1777
- }
1778
- if (choiceOrgId) {
1779
- params.filid = choiceOrgId;
1780
- }
1781
- }
1782
- if (val == 15 || val == 16) {
1783
- params.filid = this.userModel.orgId;
1784
- if (pOrgId) {
1785
- params.filid = pOrgId;
1786
- }
1787
- }
1788
- return { multiple, params };
1789
- },
1790
- getStartFlow(processId) {
1791
- if (!processId) {
1792
- return false;
1793
- }
1794
- if (this.showBtn) {
1795
- this.loading = true;
1796
- } else {
1797
- this.allLoading = util.loading(this.$loading, '加载中...');
1798
- }
1799
- this.businessId = this.id;
1800
- let params = {
1801
- processDefinitionId: processId, // processId || this.processDefinitionId,
1802
- userId: util.getStorage('userId'),
1803
- businessId: this.businessId
1804
- };
1805
- if (!this.shwowBtn) {
1806
- params.taskAction = 'toStartFlowWithoutTempSave';
1807
- }
1808
- // 获取节点
1809
- util
1810
- .ajax({ url: toStartFlow, params })
1811
- .then((res) => {
1812
- //pc接口返回数据处理
1813
- const { status, message, data } = res;
1814
- if (status == 'success') {
1815
- data.nodeInfoMap.nodeExtAttr.submitTipsMsg &&
1816
- this.$confirm(
1817
- data.nodeInfoMap.nodeExtAttr.submitTipsMsg,
1818
- '提示',
1819
- {
1820
- confirmButtonText: '确定',
1821
- cancelButtonText: '取消',
1822
- type: 'warning'
1823
- }
1824
- )
1825
- .then(() => {})
1826
- .catch(() => {
1827
- this.quit();
1828
- });
1829
- data.nextNodeCheckType &&
1830
- (this.nextNodeCheckType = data.nextNodeCheckType);
1831
- data.nextOperateCheckType &&
1832
- (this.nextOperateCheckType = data.nextOperateCheckType);
1833
- if (data.currentOrgSelectorParams) {
1834
- if (
1835
- data.currentOrgSelectorParams.enableCurrentOrgConfig == 'true'
1836
- ) {
1837
- this.currentOrgSelectorTabs =
1838
- data.currentOrgSelectorParams.currentOrgType.split(',');
1839
- let currentOrgparams =
1840
- data.currentOrgSelectorParams.currentOrgRange.split(',');
1841
- this.currentOrgSelectorTabs.map((x, i) => {
1842
- this.currentOrgSelectorParams[x] = {
1843
- filid:
1844
- currentOrgparams[i] == 'my'
1845
- ? JSON.parse(util.getStorage('mainConfig')).userModel
1846
- .orgId
1847
- : currentOrgparams[i],
1848
- only_filid: true
1849
- };
1850
- });
1851
- }
1852
- }
1853
- this.customPresetHintMessage = data.customPresetHintMessage;
1854
- this.readOnlyNotificationType = data.readOnlyNotificationType;
1855
- this.notificationMessageReadOnly =
1856
- data.notificationMessageReadOnly == 'true';
1857
- this.nextNode.nodeInfo = data.nextNodeList;
1858
- this.nextNode.nextNode = data.nextNodeList[0].nodeId;
1859
- this.isPreset = data.isPreset;
1860
- this.isHideDefaultOperation =
1861
- data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation;
1862
- this.defaultNextNode = data.nodeInfoMap.nodeExtAttr.defaultNextNode;
1863
- this.isChooseNextNode =
1864
- data.nodeInfoMap.nodeExtAttr.isChooseNextNode;
1865
- this.isCdjxjTaskHandle = data.isCdjxjTaskHandle;
1866
- if (this.isChooseNextNode == 1) {
1867
- this.operationList = [
1868
- // { key: 0, value: '默认', list: [] },
1869
- { key: 1, value: '自定义', list: [] }
1870
- ];
1871
- if (data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation != 1) {
1872
- this.operationList.unshift({
1873
- key: 0,
1874
- value: '默认',
1875
- list: data.nextNodeList
1876
- });
1877
- }
1878
- let arr = [];
1879
- for (let key in data.taskNodeMap) {
1880
- arr.push({ nodeName: data.taskNodeMap[key], nodeId: key });
1881
- }
1882
- // this.operationList[0].list = data.nextNodeList;
1883
- this.operationList[
1884
- data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation != 1 ? 1 : 0
1885
- ].list = arr;
1886
- if (this.isHideDefaultOperation != 1) {
1887
- this.nextNode.nextOperate = 0;
1888
- this.nextNode.nodeInfo = this.operationList[0].list;
1889
- if (this.nextNode.nodeInfo.length > 0) {
1890
- let defaultNodeData = data.nextNodeList.filter(
1891
- (x) => x.nodeId == this.defaultNextNode
1892
- );
1893
- this.nextNode.nextNode =
1894
- defaultNodeData.length > 0
1895
- ? this.defaultNextNode
1896
- : data.nextNodeList[0].nodeId;
1897
- }
1898
- }
1899
- if (
1900
- data.nodeInfoMap.nodeExtAttr.defaultNextOperate == 1 ||
1901
- data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation == 1
1902
- ) {
1903
- // this.nextNode.nodeInfo = data.nextNodeList
1904
- this.nextNode.nextOperate = 1;
1905
- this.nextNode.nodeInfo =
1906
- this.operationList[
1907
- this.isHideDefaultOperation != 1 ? 1 : 0
1908
- ].list;
1909
-
1910
- if (this.nextNode.nodeInfo.length > 0) {
1911
- let defaultNodeData = this.nextNode.nodeInfo.filter(
1912
- (x) => x.nodeId == this.defaultNextNode
1913
- );
1914
- this.nextNode.nextNode =
1915
- defaultNodeData.length > 0
1916
- ? this.defaultNextNode
1917
- : this.nextNode.nodeInfo[0].nodeId;
1918
- }
1919
- }
1920
- }
1921
- this.isCustomPreset = data.isCustomPreset;
1922
- this.presetTaskNodeKeyStr = data.presetTaskNodeKeyStr;
1923
- this.presetTaskNodeMap = data.presetTaskNodeMap;
1924
- this.isSinglePage = data.taskExamine.isSinglePage;
1925
- this.isSinglePage &&
1926
- (this.nextNode.opinion = data.taskExamine.opinion);
1927
- // this.nextNode.noticeInfo = data.taskExamine.notificationMsg;
1928
- this.nextNode.nodeName = data.taskExamine.nodeName;
1929
- this.canPresetRead = data.canPresetRead;
1930
- if (data.canPresetRead) {
1931
- let ids =
1932
- data.nodeInfoMap.nodeExtAttr.presetReadCandinateIds.split(',');
1933
- let names =
1934
- data.nodeInfoMap.nodeExtAttr.presetReadCandinateNames.split(
1935
- ','
1936
- );
1937
- ids.map((item, index) => {
1938
- this.presetReadUserId.push({
1939
- showid: item,
1940
- showname: names[index]
1941
- });
1942
- this.selectPresetUserList.push({
1943
- showid: item,
1944
- showname: names[index]
1945
- });
1946
- this.nextNode.presetReadUserId.push(item);
1947
- });
1948
- }
1949
- this.getNodeInfos(undefined, undefined, processId);
1950
- // this.getPresetFlowInfo();
1951
- this.isCustomPreset &&
1952
- this.$refs.customPreset.getPresetFlowInfo(
1953
- this.nextNode.nextNode,
1954
- undefined,
1955
- true
1956
- );
1957
- this.getFind();
1958
- this.getMessage();
1959
- } else {
1960
- this.$message.error(message || '系统错误,请联系管理员!');
1961
- }
1962
- })
1963
- .catch((err) => {
1964
- if (this.showBtn) {
1965
- this.loading = false;
1966
- } else {
1967
- this.allLoading.close();
1968
- }
1969
- if (err.message && err.message !== 'canceled') {
1970
- this.$message.error(err.message);
1971
- }
1972
- });
1973
- }
1974
- }
1975
- };
1976
- </script>
1
+ <template>
2
+ <div
3
+ v-loading="loading"
4
+ class="es-flow-form"
5
+ element-loading-text="加载中..."
6
+ element-loading-spinner="el-icon-loading"
7
+ element-loading-background="rgba(255, 255,255, 0.8)"
8
+ >
9
+ <el-form
10
+ ref="nextNode"
11
+ :model="nextNode"
12
+ class="demo-dynamic"
13
+ label-width="100px"
14
+ :rules="rules"
15
+ :label-position="labelPosition"
16
+ >
17
+ <div
18
+ :style="`height:${showBtn ? '430px' : 'auto'}; overflow-y:${
19
+ showBtn ? 'auto' : 'hidden'
20
+ } ; margin-bottom: 10px;overflow-x: hidden;`"
21
+ >
22
+ <el-form-item
23
+ v-show="showBtn"
24
+ prop="nodeName"
25
+ label="当前节点"
26
+ :rules="[
27
+ { required: true, message: `请选择下步节点`, trigger: 'blur' }
28
+ ]"
29
+ >
30
+ <el-input v-model="nextNode.nodeName" disabled />
31
+ </el-form-item>
32
+ <el-form-item
33
+ v-if="isSinglePage || copyHistory || formType == 'readTransfer'"
34
+ prop="newOpinion"
35
+ :label="
36
+ copyHistory || formType == 'readTransfer' ? '填写意见' : '意见'
37
+ "
38
+ >
39
+ <CommonOpinions
40
+ class="opinions"
41
+ :opinion="nextNode.newOpinion"
42
+ :rows="copyHistory || formType == 'readTransfer' ? 2 : 5"
43
+ v-if="showOpinion"
44
+ :required="isOpinionRequired == 1"
45
+ @change="(val) => (nextNode.newOpinion = val)"
46
+ />
47
+ </el-form-item>
48
+ <!-- 阅转办时新增选择流程功能 -->
49
+ <el-form-item
50
+ v-if="isCanReadTransferHandle && readTransferHandleFlowTypeCode"
51
+ prop="nextNode"
52
+ label="选择流程"
53
+ :rules="[
54
+ // { required: true, message: `请选择流程`, trigger: 'blur' }
55
+ ]"
56
+ >
57
+ <el-input
58
+ placeholder="请输入内容"
59
+ class="input-with-select select-process"
60
+ :class="{ 'hide-flow-char': isStartFlowChartView != 'true' }"
61
+ >
62
+ <el-select
63
+ slot="prepend"
64
+ v-model="currentNodeInfo.nextNode"
65
+ style="width: calc(100% + 40px)"
66
+ :placeholder="`请选择流程`"
67
+ :key="optionsKey"
68
+ @change="handleFlowChange"
69
+ >
70
+ <el-option
71
+ v-for="items in currentNodeInfo.option"
72
+ :key="items.id"
73
+ :label="items.name"
74
+ :disabled="items.disabled"
75
+ :value="items.processDefId"
76
+ ></el-option>
77
+ </el-select>
78
+ <div slot="append" v-show="isStartFlowChartView == 'true'">
79
+ <el-button
80
+ icon="es-icon-shu-jituan"
81
+ type="primary"
82
+ @click="
83
+ () => {
84
+ showFlowChart = true;
85
+ }
86
+ "
87
+ ></el-button>
88
+ <el-button
89
+ v-show="activitiDefinitionSort"
90
+ icon="es-icon-paixu"
91
+ type="primary"
92
+ @click="
93
+ () => {
94
+ showSort = true;
95
+ }
96
+ "
97
+ ></el-button>
98
+ </div>
99
+ </el-input>
100
+ </el-form-item>
101
+ <el-form-item
102
+ prop="nextOperate"
103
+ label="下步操作"
104
+ v-if="isChooseNextNode == 1"
105
+ :rules="[
106
+ { required: true, message: `请选择下步操作`, trigger: 'blur' }
107
+ ]"
108
+ >
109
+ <el-select
110
+ v-if="nextOperateCheckType == 'select'"
111
+ v-model="nextNode.nextOperate"
112
+ :placeholder="`请选择下步操作`"
113
+ @change="selecNext"
114
+ >
115
+ <el-option
116
+ v-for="items in operationList"
117
+ :key="items.key"
118
+ :label="items.value"
119
+ :value="items.key"
120
+ ></el-option>
121
+ </el-select>
122
+ <es-radio-group
123
+ v-else-if="nextOperateCheckType == 'radio'"
124
+ v-model="nextNode.nextOperate"
125
+ :data="operationList"
126
+ @change="selecNext($event, true)"
127
+ value-key="key"
128
+ label-key="value"
129
+ ></es-radio-group>
130
+ </el-form-item>
131
+ <el-form-item
132
+ prop="nextNode"
133
+ label="下步节点"
134
+ :rules="[
135
+ { required: false, message: `请选择下步节点`, trigger: 'blur' }
136
+ ]"
137
+ >
138
+ <el-select
139
+ v-if="nextNodeCheckType == 'select'"
140
+ v-model="nextNode.nextNode"
141
+ :placeholder="`请选择下步节点`"
142
+ @change="changeSel"
143
+ >
144
+ <el-option
145
+ v-for="items in nextNode.nodeInfo"
146
+ :key="items.id"
147
+ :label="items.nodeName"
148
+ :value="items.nodeId"
149
+ ></el-option>
150
+ </el-select>
151
+ <es-radio-group
152
+ v-else-if="nextNodeCheckType == 'radio'"
153
+ v-model="nextNode.nextNode"
154
+ :data="nextNode.nodeInfo"
155
+ @change="changeSel"
156
+ value-key="nodeId"
157
+ label-key="nodeName"
158
+ ></es-radio-group>
159
+ </el-form-item>
160
+ <el-form-item
161
+ v-if="countersignaturetypeCode != 0"
162
+ prop="countersignaturetypeText"
163
+ label="处理方式"
164
+ >
165
+ <el-input
166
+ v-model="nextNode.countersignaturetypeText"
167
+ placeholder="请输入内容"
168
+ disabled
169
+ />
170
+ </el-form-item>
171
+ <!-- <el-form-item
172
+ prop="nextNode"
173
+ label="下步办理人"
174
+ v-if="isShowNextUser"
175
+ :rules="[
176
+ { required: true, message: `请选择下步办理人`, trigger: 'blur' }
177
+ ]"
178
+ >
179
+ <SelectUser
180
+ :nextUser="nextNode.nextUser"
181
+ :radioList="radioList"
182
+ :multiple="multiple"
183
+ :showTooltip="showTooltip"
184
+ :isCustomUser="isCustomUser"
185
+ :options="options"
186
+ :presetEdit="presetEdit"
187
+ :isDefSelectedObj="isDefSelectedObj"
188
+ :selectUserList="selectUserList"
189
+ @change="changeSelectUser"
190
+ :types="nextUserTypes"
191
+ :params="params"
192
+ />
193
+ </el-form-item> -->
194
+ <el-form-item
195
+ v-if="isHideCurrentOrg"
196
+ prop="nextCurrentOrgObj"
197
+ label="本单位"
198
+ >
199
+ <SelectUser
200
+ :nextUser="nextCurrentOrgObjSelect"
201
+ multiple
202
+ mix
203
+ @change="disposeAppUnit($event, 'nextCurrentOrgObjSelect')"
204
+ :showTooltip="showTooltip"
205
+ :selectUserList="nextCurrentOrgselectUserList"
206
+ :types="currentOrgSelectorTabs"
207
+ :params="currentOrgSelectorParams"
208
+ />
209
+ </el-form-item>
210
+ <el-form-item v-if="isHideOtherOrg" label="外单位">
211
+ <SelectUser
212
+ :nextUser="nextOtherOrgObjSelect"
213
+ multiple
214
+ :showTooltip="showTooltip"
215
+ mix
216
+ :where="{ filid: 'other' }"
217
+ @change="disposeAppUnit($event, 'nextOtherOrgObjSelect')"
218
+ :types="['enterprise', 'filgroup']"
219
+ :params="foreignOrgSelectorParams"
220
+ />
221
+ </el-form-item>
222
+ <el-form-item
223
+ v-if="!isHideOtherOrg && !isHideCurrentOrg"
224
+ :prop="isShowNextUser ? 'nextUser' : 'nextOrgId'"
225
+ :label="
226
+ isShowNextUser
227
+ ? `${flowLabelConfig.nextUser || '下步办理人'}`
228
+ : '办理对象'
229
+ "
230
+ >
231
+ <SelectUser
232
+ :nextUser="isShowNextUser ? nextNode.nextUser : nextNode.nextOrgId"
233
+ :radioList="radioList"
234
+ :multiple="multiple"
235
+ :isCustomUser="!isShowNextUser ? 1 : isCustomUser"
236
+ :showTooltip="showTooltip"
237
+ :isCurrentNodeForbiddenChangeCandidate="
238
+ isCurrentNodeForbiddenChangeCandidate
239
+ "
240
+ :options="options"
241
+ :presetEdit="presetEdit"
242
+ :mix="multiple"
243
+ :isDefSelectedObj="isDefSelectedObj"
244
+ :selectUserList="selectUserList"
245
+ @change="
246
+ changeSelectUser(
247
+ $event,
248
+ isShowNextUser ? 'nextUser' : 'nextOrgId'
249
+ )
250
+ "
251
+ :types="
252
+ !isShowNextUser
253
+ ? nextUserTypes
254
+ : isCdjxjTaskHandle != 'true'
255
+ ? ['employee', 'persongroup']
256
+ : ['employee']
257
+ "
258
+ :params="isShowNextUser ? params : {}"
259
+ :tabs="nextUserTabs"
260
+ />
261
+ </el-form-item>
262
+ <el-form-item
263
+ prop="nextReadUserId"
264
+ v-if="isTaskread == 1"
265
+ label="
266
+ 分阅用户
267
+ "
268
+ >
269
+ <SelectUser
270
+ :nextUser="nextNode.nextReadUserId"
271
+ :multiple="true"
272
+ :selectUserList="selectReadUserList"
273
+ :showTooltip="showTooltip"
274
+ :options="userOptions"
275
+ title="分阅用户"
276
+ :mix="true"
277
+ :types="types"
278
+ @change="changeSelectReadUser($event, 'nextReadUserId')"
279
+ :params="fyParams"
280
+ :tabs="tabs"
281
+ />
282
+ </el-form-item>
283
+ <el-form-item
284
+ prop="presetReadUserId"
285
+ v-if="canPresetRead"
286
+ label="
287
+ 自动分阅
288
+ "
289
+ >
290
+ <SelectUser
291
+ :nextUser="nextNode.presetReadUserId"
292
+ :multiple="true"
293
+ :selectUserList="selectPresetUserList"
294
+ :showTooltip="showTooltip"
295
+ :options="presetOptions"
296
+ title="分阅用户"
297
+ :params="fyParams"
298
+ :radioList="presetReadUserId"
299
+ :presetEdit="1"
300
+ :mix="true"
301
+ :types="types"
302
+ @change="changeSelectReadUser($event, 'presetReadUserId')"
303
+ :tabs="tabs"
304
+ />
305
+ </el-form-item>
306
+ <el-form-item
307
+ v-if="enableCustomLimitTimeSetting"
308
+ prop="customLimitTime"
309
+ label="限时办理"
310
+ :rules="[
311
+ {
312
+ required: enableCustomLimitTimeSetting,
313
+ message: showCustomLimitTimeText
314
+ ? '请输入限时办理天数'
315
+ : '请选择限时办理天数',
316
+ trigger: 'blur'
317
+ },
318
+ {
319
+ required: enableCustomLimitTimeSetting,
320
+ validator: checkCustomLimitTime,
321
+ trigger: 'blur'
322
+ }
323
+ ]"
324
+ >
325
+ <div style="display: flex">
326
+ <es-select
327
+ v-model="nextNode.customLimitTimeText"
328
+ placeholder="请选择"
329
+ @change="handleChangeTime"
330
+ :style="`flex:${showBtn ? 'unset' : '1'};width: ${
331
+ showBtn ? '20%' : 'unset'
332
+ } !important; display: inline-block;`"
333
+ sysCode="bpm_custom_limit_time"
334
+ ></es-select>
335
+ <el-input
336
+ v-model="nextNode.customLimitTime"
337
+ :style="`flex:${showBtn ? 'unset' : '1'};width: ${
338
+ showBtn ? '20%' : 'unset'
339
+ } !important; display: inline-block;`"
340
+ placeholder="请输入限时办理的天数"
341
+ class="input-with-select custom-limit-time"
342
+ @change="changeCustomLimitTime"
343
+ >
344
+ </el-input>
345
+ <span style="margin-left: 5px">天</span>
346
+ </div>
347
+ </el-form-item>
348
+ <el-form-item
349
+ v-if="isHandleExplain == 1"
350
+ prop="handleExplain"
351
+ label="办理说明"
352
+ >
353
+ <el-input
354
+ placeholder="请输入办理说明"
355
+ v-model="nextNode.handleExplain"
356
+ />
357
+ </el-form-item>
358
+ <el-form-item
359
+ prop="noticeType"
360
+ label="通知方式"
361
+ v-show="showBtn && nextNode.noticeList.length > 0 && !hideMessage"
362
+ >
363
+ <el-checkbox-group v-model="nextNode.noticeType">
364
+ <el-checkbox
365
+ v-for="item of nextNode.noticeList"
366
+ :key="item.cciValue"
367
+ :label="item.cciValue"
368
+ :disabled="
369
+ readOnlyNotificationType
370
+ ? readOnlyNotificationType.indexOf(item.cciValue) != -1
371
+ : false
372
+ "
373
+ >
374
+ {{ item.shortName }}
375
+ </el-checkbox>
376
+ </el-checkbox-group>
377
+ </el-form-item>
378
+ <el-form-item
379
+ v-show="nextNode.noticeType.length != 0 && showBtn"
380
+ prop="nextNode"
381
+ label="通知消息"
382
+ >
383
+ <es-input
384
+ style="
385
+ border-color: #ccc;
386
+ padding: 5px;
387
+ border-radius: 5px;
388
+ font-size: 13px;
389
+ "
390
+ type="textarea"
391
+ v-model="nextNode.noticeInfo"
392
+ :readonly="notificationMessageReadOnly"
393
+ />
394
+ </el-form-item>
395
+ <CustomPreset
396
+ v-show="isCustomPreset"
397
+ ref="customPreset"
398
+ @changeCustom="
399
+ (data) => {
400
+ presetList = data;
401
+ }
402
+ "
403
+ :customPresetHintMessage="customPresetHintMessage"
404
+ @changeActiveNames="(val) => (activeNames = val)"
405
+ @loadingEnd="loading = false"
406
+ @loadingStart="loading = true"
407
+ :nextNode="nextNode.nextNode"
408
+ :id="id"
409
+ :processDefinitionId="processDefinitionId"
410
+ />
411
+ <Preset
412
+ v-show="isPreset"
413
+ @changePreset="
414
+ (data) => {
415
+ presetUserJson = data;
416
+ }
417
+ "
418
+ @loadingEnd="loading = false"
419
+ @loadingStart="loading = true"
420
+ :customPresetHintMessage="customPresetHintMessage"
421
+ :nodeId="nextNode.nextNode"
422
+ :businessId="id"
423
+ :processDefinitionId="processDefinitionId"
424
+ :presetTaskNodeMap="presetTaskNodeMap"
425
+ :presetTaskNodeKeyStr="presetTaskNodeKeyStr"
426
+ />
427
+ </div>
428
+ <el-form-item style="margin-bottom: 0px" v-show="showBtn">
429
+ <div style="text-align: right">
430
+ <el-button type="primary" @click="subProcess('nextNode')">
431
+ 确认
432
+ </el-button>
433
+ <el-button @click="quit"> 取消 </el-button>
434
+ </div>
435
+ </el-form-item>
436
+ </el-form>
437
+ <div
438
+ v-if="!showBtn && nextNode.noticeList.length > 0 && !hideMessage"
439
+ style="padding: 5px; background: #fff"
440
+ >
441
+ <div class="news" @click="showNews = !showNews">
442
+ <span class="news-item">消息通知</span>
443
+ <span :class="showNews ? 'show' : 'sj'"></span>
444
+ </div>
445
+ <div v-if="showNews" ref="messagebox" style="transition: 1s">
446
+ <el-checkbox-group v-model="nextNode.noticeType">
447
+ <el-checkbox
448
+ v-for="item of nextNode.noticeList"
449
+ :key="item.cciValue"
450
+ :label="item.cciValue"
451
+ :disabled="
452
+ readOnlyNotificationType
453
+ ? readOnlyNotificationType.indexOf(item.cciValue) != -1
454
+ : false
455
+ "
456
+ >
457
+ {{ item.shortName }}
458
+ </el-checkbox>
459
+ </el-checkbox-group>
460
+ <es-input
461
+ style="
462
+ border-color: #ccc;
463
+ padding: 5px;
464
+ border-radius: 5px;
465
+ font-size: 13px;
466
+ "
467
+ autosize
468
+ v-show="showNews"
469
+ type="textarea"
470
+ v-model="nextNode.noticeInfo"
471
+ @change="handleChange"
472
+ :readonly="notificationMessageReadOnly"
473
+ />
474
+ </div>
475
+ </div>
476
+ </div>
477
+ </template>
478
+
479
+ <script>
480
+ import {
481
+ toStartFlow,
482
+ getNodeInfo,
483
+ findSysCodes,
484
+ getNotificationMsg,
485
+ findCodeValues,
486
+ loginUserInfo,
487
+ register,
488
+ freeStartFlow,
489
+ getProcessDefList,
490
+ getNodeInfoForStart,
491
+ freeStartFlowWithSubmitTask,
492
+ startReadTransferHandleFlowWithTaskReadEnd
493
+ } from 'eoss-ui/src/config/api';
494
+ import util from 'eoss-ui/src/utils/util';
495
+ import SelectUser from './selectUser.vue';
496
+ import CommonOpinions from './component/CommonOpinions.vue';
497
+ import CustomPreset from './component/CustomPreset.vue';
498
+ import Preset from './component/Preset.vue';
499
+ export default {
500
+ name: 'ProcessForm',
501
+
502
+ components: {
503
+ [Option.name]: Option,
504
+ [SelectUser.name]: SelectUser,
505
+ [CustomPreset.name]: CustomPreset,
506
+ [CommonOpinions.name]: CommonOpinions,
507
+ Preset
508
+ },
509
+ props: {
510
+ isCanReadTransferHandle: {
511
+ type: Boolean,
512
+ default: false
513
+ },
514
+ readTransferHandleFlowTypeCode: {
515
+ type: String,
516
+ default: ''
517
+ },
518
+ processDefinitionId: {
519
+ type: String,
520
+ default: ''
521
+ },
522
+ showTooltip: { type: Boolean, default: true },
523
+ copyHistory: {
524
+ type: String,
525
+ default: ''
526
+ },
527
+ simpleTips: {
528
+ type: Boolean,
529
+ default: true
530
+ },
531
+ formType: {
532
+ type: String,
533
+ default: 'freeStart'
534
+ },
535
+ id: {
536
+ type: String,
537
+ default: ''
538
+ },
539
+ pendingId: {
540
+ type: String,
541
+ default: ''
542
+ },
543
+ opinion: {
544
+ type: String,
545
+ default: ''
546
+ },
547
+ isCancelSecondConfirmationType: {
548
+ type: Boolean,
549
+ default: false
550
+ },
551
+ isFreeStartFlow: {
552
+ type: Boolean,
553
+ default: false
554
+ },
555
+ taskParams: {
556
+ type: Object,
557
+ default: () => {}
558
+ },
559
+ taskExamineParam: {
560
+ type: String,
561
+ default: ''
562
+ },
563
+ labelPosition: {
564
+ type: String,
565
+ default: 'right'
566
+ },
567
+ formTitle: {
568
+ type: String,
569
+ default: ''
570
+ },
571
+ showBtn: { type: Boolean, default: true },
572
+ messageType: {
573
+ type: Array,
574
+ default: () => []
575
+ },
576
+ urgencyLevel: {
577
+ type: [Number, String],
578
+ default: ''
579
+ },
580
+ keyCount: {
581
+ type: [Number, String],
582
+ default: 0
583
+ },
584
+ selectorParams: { type: Object, default: () => {} },
585
+ flowLabelConfig: {
586
+ type: Object,
587
+ default: () => {
588
+ return {};
589
+ }
590
+ },
591
+ hideMessage: { type: Boolean, default: false }
592
+ },
593
+ data() {
594
+ return {
595
+ loading: false,
596
+ isCustomUser: 0,
597
+ currentNodeInfo: { nextNode: '', nextUser: '', option: [] },
598
+ isStartFlowChartView: false,
599
+ isCurrentNodeForbiddenChangeCandidate: 0,
600
+ allLoading: null,
601
+ selectUser: false,
602
+ pOrgId: '',
603
+ multiple: false,
604
+ readMultiple: true,
605
+ showOpinion: true,
606
+ isOpinionRequired: 0,
607
+ currentOrgSelectorTabs: ['employee', 'persongroup'],
608
+ customPresetHintMessage: '', //流程预设标题
609
+ nextNodeCheckType: 'select',
610
+ nextOperateCheckType: 'select',
611
+ showNews: false, // 是否展示通知信息
612
+ notificationMessageReadOnly: false,
613
+ isChangeMessage: false,
614
+ readOnlyNotificationType: '',
615
+ show: true,
616
+ enableCustomLimitTimeSetting: false,
617
+ radioList: [],
618
+ nextCurrentOrgselectUserList: [],
619
+ showCustomLimitTimeText: false,
620
+ activeNames: '1',
621
+ selectUserList: [],
622
+ defaultNextNode: '',
623
+ presetUserJson: [],
624
+ businessId: '',
625
+ optionsKey: 0,
626
+ isTaskread: 0, //是否显示分阅用户
627
+ isHandleExplain: 0, //是否展示办理说明
628
+ options: [],
629
+ presetList: [],
630
+ presetReadUserId: [], //自动分阅
631
+ canPresetRead: false, //是否展示自动分阅
632
+ nextUserTypes: ['employee', 'persongroup'],
633
+ isCustomPreset: false, //是否展示预设节点
634
+ isPreset: false, //是否展示预设办理人
635
+ isSinglePage: false,
636
+ presetEdit: 0,
637
+ isDefSelectedObj: 0,
638
+ isChooseNextNode: 0,
639
+ isHideDefaultOperation: 0,
640
+ countersignaturetypeCode: 0,
641
+ presetTaskNodeKeyStr: '', //预设办理人顺序
642
+ presetTaskNodeMap: {}, //预设办理人
643
+ params: {
644
+ filid: 'all', //选择范围(my:本单位/ "" or all:全部)
645
+ selectmix: 'true1',
646
+ deptid: '' //指定部门(my:本部门)
647
+ },
648
+ newOpinion: '',
649
+ operationList: [],
650
+ tabs: {
651
+ employee: {
652
+ param: {
653
+ filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId,
654
+ name: '本单位用户'
655
+ }
656
+ },
657
+ department: {
658
+ param: {
659
+ filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
660
+ }
661
+ }
662
+ },
663
+ activitiDefinitionSort: false,
664
+ userModel: {},
665
+ nextUserTabs: {},
666
+ selectPresetUserList: [],
667
+ presetOptions: [],
668
+ selectReadUserList: [],
669
+ userOptions: [],
670
+ mixReadList: [],
671
+ mixPresetList: [],
672
+ isCdjxjTaskHandle: '',
673
+ isShowNextUser: true,
674
+ oldMessage: '',
675
+ mixOrgIdList: [], //办理对象混选
676
+ subProcessColumns: [],
677
+ nextOtherOrgObjSelect: [],
678
+ nextCurrentOrgObjSelect: [],
679
+ isHideCurrentOrg: false,
680
+ isHideOtherOrg: false,
681
+ currentOrgSelectorParams: {
682
+ filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId,
683
+ only_filid: true
684
+ },
685
+ foreignOrgSelectorParams: { filid: 'all', nofilid: 1 },
686
+ nextNode: {
687
+ nodeName: '',
688
+ customLimitTime: '',
689
+ customLimitTimeText: '',
690
+ newOpinion: '',
691
+ countersignaturetypeText: '',
692
+ nextNode: '',
693
+ nextReadUserId: [],
694
+ nextOrgId: [],
695
+ noticeType: [],
696
+ nextOperate: '',
697
+ nextUser: [],
698
+ presetReadUserId: [], //自动分阅
699
+ noticeInfo: '',
700
+ nodeInfo: [],
701
+ userInfo: [],
702
+ handleExplain: '',
703
+ noticeList: [],
704
+ msgTypeCount: 0
705
+ }
706
+ };
707
+ },
708
+ watch: {
709
+ messageType: {
710
+ handler(val) {
711
+ if (this.urgencyLevel) {
712
+ this.nextNode.noticeList = val;
713
+ let arr = [];
714
+ this.nextNode.noticeList.map((item) => {
715
+ this.nextNode.noticeType.map((x) => {
716
+ if (x == item.cciValue) {
717
+ arr.push(x);
718
+ }
719
+ });
720
+ });
721
+ this.nextNode.noticeType = arr;
722
+ } else {
723
+ this.msgTypeCount++;
724
+ }
725
+ }
726
+ },
727
+ processDefinitionId(val) {
728
+ const savedNodeInfo = { ...this.currentNodeInfo };
729
+ Object.assign(this.$data, this.$options.data());
730
+ this.currentNodeInfo = savedNodeInfo;
731
+ this.getUserInfo();
732
+ this.getNodeType();
733
+ this.getStartFlow(val);
734
+ if (this.copyHistory) {
735
+ this.nextNode.newOpinion = this.opinion;
736
+ } else if (this.formType != 'readTransfer') {
737
+ this.newOpinion = this.opinion;
738
+ }
739
+ // this.getStartFlow(val);
740
+ },
741
+ opinion(val) {
742
+ this.newOpinion = this.opinion;
743
+ },
744
+ formTitle: {
745
+ handler(val) {
746
+ if (!this.showBtn && !this.isChangeMessage) {
747
+ this.nextNode.noticeInfo = this.oldMessage.replace('{title}', val);
748
+ }
749
+ },
750
+ deep: true,
751
+ immediate: true
752
+ }
753
+ },
754
+ computed: {
755
+ rules() {
756
+ return {
757
+ customLimitTime: [
758
+ {
759
+ required: this.enableCustomLimitTimeSetting,
760
+ message: this.showCustomLimitTimeText
761
+ ? '请输入限时办理天数'
762
+ : '请选择限时办理天数',
763
+ trigger: 'blur'
764
+ },
765
+ {
766
+ required: this.enableCustomLimitTimeSetting,
767
+ validator: this.checkCustomLimitTime,
768
+ trigger: 'blur'
769
+ }
770
+ ]
771
+ };
772
+ },
773
+ types() {
774
+ if (this.isCdjxjTaskHandle == 'true') {
775
+ return ['employee', 'enterprise', 'department'];
776
+ } else {
777
+ return ['employee', 'enterprise', 'department', 'persongroup'];
778
+ }
779
+ },
780
+ fyParams() {
781
+ let orgId = JSON.parse(util.getStorage('mainConfig')).userModel.orgId;
782
+ let params = {};
783
+ if (this.configInfo.selectPersonValue == 1) {
784
+ params.filid = orgId;
785
+ } else if (this.configInfo.selectPersonValue == 2) {
786
+ params.filid = orgId;
787
+ } else if (this.configInfo.selectPersonValue == 3) {
788
+ params.filid = 'all';
789
+ } else if (this.configInfo.selectPersonValue == 4) {
790
+ params.filid = 'all';
791
+ } else if (this.configInfo.selectPersonValue == 5) {
792
+ params.filid = '';
793
+ } else if (this.configInfo.selectPersonValue == 6) {
794
+ params.filid = '';
795
+ } else if (this.configInfo.selectPersonValue == 7) {
796
+ params.filid = orgId;
797
+ } else if (this.configInfo.selectPersonValue == 8) {
798
+ params.filid = orgId;
799
+ }
800
+ return params;
801
+ }
802
+ },
803
+ created() {
804
+ this.getUserInfo();
805
+ },
806
+ mounted() {
807
+ if (!this.urgencyLevel) {
808
+ this.getNodeType();
809
+ }
810
+ this.getStartFlow(this.processDefinitionId);
811
+ if (this.copyHistory) {
812
+ this.nextNode.newOpinion = this.opinion;
813
+ } else if (this.formType != 'readTransfer') {
814
+ this.newOpinion = this.opinion;
815
+ }
816
+ if (this.isCanReadTransferHandle && this.readTransferHandleFlowTypeCode) {
817
+ this.getProcess(this.readTransferHandleFlowTypeCode);
818
+ }
819
+ },
820
+ methods: {
821
+ /**
822
+ * getProcess
823
+ * @desc:获取选择流程
824
+ * @author liufan
825
+ * @date 2022年5月25日
826
+ **/
827
+ getProcess(val) {
828
+ let params = {
829
+ businessId: this.businessId,
830
+ flowTypeCode: val || this.flowTypeCode,
831
+ // defaultProcessKey: this.defaultProcessKey,
832
+ isOnly: true,
833
+ hideTempSave: true
834
+ };
835
+ const loading = util.loading(this.$loading, '加载中...');
836
+ util
837
+ .ajax({ url: getProcessDefList, params })
838
+ .then((res) => {
839
+ const { status, message, data } = res;
840
+ loading.close();
841
+ if (status === 'success') {
842
+ this.isStartFlowChartView = data.isStartFlowChartView;
843
+ if (
844
+ !Object.keys(data).length ||
845
+ (data.definitionList && !data.definitionList.length)
846
+ ) {
847
+ this.$message.error('流程不存在或未关联对应流程!');
848
+ } else {
849
+ this.activitiDefinitionSort = data.activitiDefinitionSort;
850
+ this.currentNodeInfo.option = data.definitionList;
851
+ this.currentNodeInfo.nextNode = data.definitionList.filter(
852
+ (item) => item.processDefKey == this.defaultProcessKey
853
+ );
854
+ if (this.currentNodeInfo.nextNode.length) {
855
+ this.currentNodeInfo.nextNode =
856
+ this.currentNodeInfo.nextNode[0].processDefId;
857
+ } else {
858
+ if (data.definitionList.length != 0) {
859
+ this.currentNodeInfo.nextNode =
860
+ data.definitionList[0].processDefId;
861
+ } else {
862
+ this.currentNodeInfo.nextNode = '';
863
+ }
864
+ }
865
+ if (this.currentNodeInfo.nextNode) {
866
+ this.handleFlowChange(this.currentNodeInfo.nextNode, true);
867
+ }
868
+ }
869
+ } else {
870
+ this.$message.error(message || '系统错误,请联系管理员!');
871
+ }
872
+ })
873
+ .catch((err) => {
874
+ loading.close();
875
+ if (err.message && err.message !== 'canceled') {
876
+ this.$message.error(err.message);
877
+ }
878
+ });
879
+ },
880
+ handleChangeTime(val) {
881
+ this.nextNode.customLimitTime = val;
882
+ },
883
+ limitTimevalidate() {
884
+ let validSate = true;
885
+ this.$refs.nextNode.validate((valid) => {
886
+ if (valid) {
887
+ validSate = true;
888
+ } else {
889
+ validSate = false;
890
+ }
891
+ });
892
+ return validSate;
893
+ },
894
+ checkCustomLimitTime(rule, value, callback) {
895
+ if (!Number(value) || value.indexOf('.') != -1 || Number(value) < 0) {
896
+ callback(new Error('请输入正确的天数'));
897
+ this.nextNode.customLimitTime = '';
898
+ } else {
899
+ callback();
900
+ }
901
+ },
902
+ handleFlowChange(val) {
903
+ this.getNodeInfoForStartFlow(val);
904
+ this.$parent.$emit('flowChange', val);
905
+ },
906
+ getNodeInfoForStartFlow(processDefinitionId) {
907
+ let params = {
908
+ url: getNodeInfoForStart,
909
+ params: { processDefinitionId }
910
+ };
911
+ util.ajax(params).then((res) => {
912
+ if (res.status == 'success') {
913
+ this.isOpinionRequired = res.data.nodeExtAttr.isOpinionRequired;
914
+ this.showOpinion = false;
915
+ setTimeout(() => {
916
+ this.showOpinion = true;
917
+ }, 0);
918
+ this.processDefinitionId = processDefinitionId;
919
+ // this.getStartFlow(processDefinitionId);
920
+ // this.getNodeInfos(undefined, undefined, processDefinitionId);
921
+ }
922
+ });
923
+ },
924
+ handleChange() {
925
+ this.isChangeMessage = true;
926
+ },
927
+ changeCustomLimitTime(val) {
928
+ if (!Number(val) || val.indexOf('.') != -1 || Number(val) < 0) {
929
+ this.$message.warning('请输入正确的天数');
930
+ this.nextNode.customLimitTime = '';
931
+ }
932
+ },
933
+ getUserInfo() {
934
+ let mainConfig = util.getStorage('mainConfig');
935
+ if (mainConfig) {
936
+ this.userModel = JSON.parse(mainConfig).userModel;
937
+ this.foreignOrgSelectorParams.nofilid = this.userModel.orgId;
938
+ this.foreignOrgSelectorParams.roleid =
939
+ this.currentOrgSelectorParams.roleid = this.selectorParams.roleid;
940
+ } else {
941
+ util
942
+ .ajax({ url: loginUserInfo })
943
+ .then((res) => {
944
+ const { status, data } = res;
945
+ if (status == 'success') {
946
+ this.userModel = data;
947
+ this.foreignOrgSelectorParams.nofilid = this.userModel.orgId;
948
+ this.foreignOrgSelectorParams.roleid =
949
+ tthis.currentOrgSelectorParams.roleid =
950
+ this.selectorParams.roleid;
951
+ } else {
952
+ let msg = res.msg || '系统错误,请联系管理员!';
953
+ this.$message.error(msg);
954
+ }
955
+ })
956
+ .catch((err) => {
957
+ if (err.message && err.message !== 'canceled') {
958
+ this.$message.error(err.message);
959
+ }
960
+ });
961
+ }
962
+ },
963
+ getIsShowNextUser(val) {
964
+ if (
965
+ val == 7 ||
966
+ val == 8 ||
967
+ val == 9 ||
968
+ val == 10 ||
969
+ val == 11 ||
970
+ val == 12
971
+ ) {
972
+ this.isShowNextUser = false;
973
+ //设置办理角色
974
+ // $("#orgRoleCode").val(handleRoleId);
975
+ if (val == 7 || val == 8) {
976
+ this.nextUserTypes = ['department'];
977
+ this.nextUserTabs = {
978
+ department: {
979
+ param: {
980
+ filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
981
+ }
982
+ }
983
+ };
984
+ this.multiple = true;
985
+ } else if (val == 9 || val == 10) {
986
+ this.nextUserTypes = ['enterprise'];
987
+ this.nextUserTabs = { enterprise: { param: { filid: 'other' } } };
988
+ this.multiple = true;
989
+ } else if (val == 11 || val == 12) {
990
+ this.nextUserTypes = ['department', 'enterprise'];
991
+ this.nextUserTabs = {
992
+ enterprise: { param: { filid: 'other' } },
993
+ department: {
994
+ param: {
995
+ filid: JSON.parse(util.getStorage('mainConfig')).userModel.orgId
996
+ }
997
+ }
998
+ };
999
+ this.multiple = true;
1000
+ }
1001
+ }
1002
+ if (val == 7 || val == 9 || val == 11) {
1003
+ this.multiple = false;
1004
+ }
1005
+ },
1006
+ // 分阅是否多选
1007
+ isReadMultiple(nextReadUserSelectType) {
1008
+ if (nextReadUserSelectType == 1) {
1009
+ this.readMultiple = false;
1010
+ } else if (nextReadUserSelectType == 2) {
1011
+ this.readMultiple = true;
1012
+ } else if (nextReadUserSelectType == 3) {
1013
+ this.readMultiple = false;
1014
+ } else if (nextReadUserSelectType == 4) {
1015
+ this.readMultiple = true;
1016
+ } else if (nextReadUserSelectType == 5) {
1017
+ this.readMultiple = false;
1018
+ } else if (nextReadUserSelectType == 6) {
1019
+ this.readMultiple = true;
1020
+ }
1021
+ },
1022
+ changeSelectReadUser(val, type) {
1023
+ const { nextUser, mixList } = val;
1024
+ this.nextNode[type] = nextUser;
1025
+ if (type === 'presetReadUserId') {
1026
+ this.mixPresetList = mixList;
1027
+ } else {
1028
+ this.mixReadList = mixList;
1029
+ }
1030
+ },
1031
+ selecNext(val) {
1032
+ this.nextNode.nextUser = [];
1033
+ this.options = [];
1034
+ this.selectUserList = [];
1035
+ this.radioList = [];
1036
+ if (this.showBtn) {
1037
+ this.loading = true;
1038
+ } else {
1039
+ this.allLoading = util.loading(this.$loading, '加载中...');
1040
+ }
1041
+ this.nextNode.nodeInfo = this.operationList[val].list;
1042
+ if (this.nextNode.nodeInfo.length > 0) {
1043
+ let defaultNodeData = this.nextNode.nodeInfo.filter(
1044
+ (x) => x.nodeId == this.defaultNextNode
1045
+ );
1046
+ length;
1047
+ this.nextNode.nextNode =
1048
+ defaultNodeData.length > 0
1049
+ ? this.defaultNextNode
1050
+ : this.nextNode.nodeInfo[0].nodeId;
1051
+ }
1052
+ this.getNodeInfos();
1053
+ },
1054
+ changeSelectUser(val, type) {
1055
+ const { nextUser, options, mixList } = val;
1056
+ this.nextNode[type] = nextUser;
1057
+ this.mixOrgIdList = mixList;
1058
+ },
1059
+ getsubProcessColumns() {
1060
+ let data = [];
1061
+ let obj = { name: '[部门员工]-' };
1062
+ if (this.nextCurrentOrgObjSelect.length > 0) {
1063
+ this.nextCurrentOrgObjSelect.map((x) => {
1064
+ if (x.stype == 'employee') {
1065
+ obj.name = !obj.value
1066
+ ? obj.name + x.showname
1067
+ : obj.name + ',' + x.showname;
1068
+ obj.value = obj.value
1069
+ ? obj.value + ',' + x.showid
1070
+ : 'employee-' + x.showid;
1071
+ } else {
1072
+ data.push({
1073
+ name: '[部门]' + x.showname,
1074
+ value: 'department-' + x.showid
1075
+ });
1076
+ }
1077
+ });
1078
+ }
1079
+ obj.value && data.push(obj);
1080
+ if (this.nextOtherOrgObjSelect.length > 0) {
1081
+ this.nextOtherOrgObjSelect.map((x) => {
1082
+ data.push({
1083
+ name: '[企业]' + x.showname,
1084
+ value: 'enterprise-' + x.showid
1085
+ });
1086
+ });
1087
+ }
1088
+ this.subProcessColumns = data;
1089
+ // return data;
1090
+ },
1091
+ // 单位选择完回调
1092
+ disposeAppUnit(res, type) {
1093
+ let label = type.substring(0, type.lastIndexOf('Select'));
1094
+ this.nextNode[label + 'Name'] = '';
1095
+ res.options && (this[type] = res.options);
1096
+ let obj = {};
1097
+ // if (typeof res.mixList == 'array')
1098
+ res.mixList && (this.nextNode[label] = res.mixList.join('|'));
1099
+ res.options.map((item) => {
1100
+ if (obj[item.stype]) {
1101
+ obj[item.stype].push(item.showname);
1102
+ } else {
1103
+ obj[item.stype] = [item.showname];
1104
+ }
1105
+ });
1106
+ for (let key in obj) {
1107
+ if (
1108
+ key === 'enterprise' &&
1109
+ this.nextNode[label + 'Name'].indexOf('[企业]') == -1
1110
+ ) {
1111
+ this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1112
+ ? this.nextNode[label + 'Name'] +
1113
+ '|' +
1114
+ '[企业]-' +
1115
+ obj[key].join(',')
1116
+ : '' + '[企业]-' + obj[key].join(',');
1117
+ }
1118
+ if (
1119
+ key === 'department' &&
1120
+ this.nextNode[label + 'Name'].indexOf('[部门]') == -1
1121
+ ) {
1122
+ this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1123
+ ? this.nextNode[label + 'Name'] +
1124
+ '|' +
1125
+ '[部门]-' +
1126
+ obj[key].join(',')
1127
+ : '' + '[部门]-' + obj[key].join(',');
1128
+ }
1129
+ if (
1130
+ key === 'employee' &&
1131
+ this.nextNode[label + 'Name'].indexOf('[部门员工]') == -1
1132
+ ) {
1133
+ this.nextNode[label + 'Name'] = this.nextNode[label + 'Name']
1134
+ ? this.nextNode[label + 'Name'] +
1135
+ '|' +
1136
+ '[部门员工]-' +
1137
+ obj[key].join(',')
1138
+ : '' + '[部门员工]-' + obj[key].join(',');
1139
+ }
1140
+ }
1141
+ // this.nextNode[label + 'Name'] = obj.enterprise?;
1142
+ if (!this.currentNodeIsCircularReadNode) {
1143
+ this.nextNode[label + 'SerialId'] = res.nextUser.join(',');
1144
+ this.nextNode[label + 'Json'] = JSON.stringify(res.options);
1145
+ }
1146
+ this.getsubProcessColumns();
1147
+ },
1148
+ getNodeType() {
1149
+ util
1150
+ .ajax({
1151
+ url: findCodeValues,
1152
+ params: {
1153
+ ccCode: 'notification_type',
1154
+ userId: util.getStorage('userId')
1155
+ }
1156
+ })
1157
+ .then((res) => {
1158
+ const { status, data } = res;
1159
+ if (status === 'success') {
1160
+ this.nextNode.noticeList = data;
1161
+ }
1162
+ })
1163
+ .catch((err) => {
1164
+ if (this.showBtn) {
1165
+ this.loading = false;
1166
+ } else {
1167
+ this.allLoading.close();
1168
+ }
1169
+ if (err.message && err.message !== 'canceled') {
1170
+ this.$message.error(err.message);
1171
+ }
1172
+ });
1173
+ },
1174
+ //获取通知信息
1175
+ getMessage() {
1176
+ let params = {
1177
+ processDefinitionId: this.processDefinitionId,
1178
+ nodeId: this.nextNode.nextNode,
1179
+ businessId: this.id
1180
+ };
1181
+ if (!this.showBtn) {
1182
+ params.openMode = 'samepage';
1183
+ }
1184
+ util
1185
+ .ajax({ url: getNotificationMsg, params, methods: 'post' })
1186
+ .then((res) => {
1187
+ if (res.status === 'success') {
1188
+ if (!this.showBtn) {
1189
+ this.oldMessage = res.message;
1190
+ this.nextNode.noticeInfo = res.message.replace(
1191
+ '{title}',
1192
+ this.formTitle
1193
+ );
1194
+ } else {
1195
+ this.nextNode.noticeInfo = res.message;
1196
+ }
1197
+ }
1198
+ })
1199
+ .catch((err) => {
1200
+ if (this.showBtn) {
1201
+ this.loading = false;
1202
+ } else {
1203
+ this.allLoading.close();
1204
+ }
1205
+ if (err.message && err.message !== 'canceled') {
1206
+ this.$message.error(err.message);
1207
+ }
1208
+ });
1209
+ },
1210
+ // 提交表单
1211
+ subProcess(formName) {
1212
+ this.saveProcess(formName);
1213
+ },
1214
+ saveProcess(formName) {
1215
+ this.$refs[formName].validate((valid) => {
1216
+ if (valid) {
1217
+ const {
1218
+ nextNode,
1219
+ nextUser,
1220
+ noticeInfo,
1221
+ noticeType,
1222
+ handleExplain,
1223
+ presetReadUserId,
1224
+ nextReadUserId,
1225
+ nextOrgId,
1226
+ newOpinion,
1227
+ customLimitTime,
1228
+ nextOtherOrgObj,
1229
+ nextCurrentOrgObj
1230
+ } = this.nextNode;
1231
+ // if (noticeType.length === 0) {
1232
+ // return this.$message.warning('请选择通知方式');
1233
+ // }
1234
+ if (this.isShowNextUser) {
1235
+ if (
1236
+ (nextUser == '' || (this.multiple && nextUser.length == 0)) &&
1237
+ !this.isHideCurrentOrg &&
1238
+ !this.isHideOtherOrg
1239
+ ) {
1240
+ return this.$message.warning(
1241
+ `请选择${this.flowLabelConfig.nextUser || '下步办理人'}`
1242
+ );
1243
+ }
1244
+ } else {
1245
+ if (nextOrgId == '' || (this.multiple && nextOrgId.length == 0)) {
1246
+ return this.$message.warning('请选择办理对象');
1247
+ }
1248
+ }
1249
+ if (
1250
+ (this.isHideOtherOrg || this.isHideCurrentOrg) &&
1251
+ !nextCurrentOrgObj &&
1252
+ !nextOtherOrgObj
1253
+ ) {
1254
+ return this.$message.warning('请选择办理对象');
1255
+ }
1256
+ if (this.isCustomPreset && this.activeNames == '1'){
1257
+ for (let i = 0; i < this.presetList.length; i++) {
1258
+ if(this.presetList[i].name && this.presetList[i].name != '1' && this.presetList[i].name != 'endEvent' &&( !this.presetList[i].value || this.presetList[i].value.length == 0)){
1259
+
1260
+ return this.$message.warning(`预设节点<节点${this.presetList[i].sequence}-${this.presetList[i].label}>必须选择办理人!`);
1261
+ }else{
1262
+ delete this.presetList[i].label;
1263
+ }
1264
+ }
1265
+ }
1266
+
1267
+ if (this.isCancelSecondConfirmationType) {
1268
+ this.$confirm('确认提交吗?', '提示', {
1269
+ confirmButtonText: '确定',
1270
+ cancelButtonText: '取消',
1271
+ type: 'warning'
1272
+ }).then(() => {
1273
+ if (this.showBtn) {
1274
+ this.loading = true;
1275
+ } else {
1276
+ this.allLoading = util.loading(this.$loading, '加载中...');
1277
+ }
1278
+ let newNextUser = [];
1279
+ if (this.multiple) {
1280
+ nextUser && nextUser.map((item) => newNextUser.push(item));
1281
+ }
1282
+ let newNoticeType = '';
1283
+ if (noticeType) {
1284
+ newNoticeType = noticeType.join(',');
1285
+ }
1286
+ let params = {
1287
+ processDefinitionId: this.processDefinitionId,
1288
+ nextUserId: this.multiple ? newNextUser.join(',') : nextUser,
1289
+ nextNodeId: nextNode,
1290
+ businessId: this.businessId,
1291
+ notificationType: newNoticeType,
1292
+ userId: util.getStorage('userId'),
1293
+ notificationMsg: noticeInfo,
1294
+ customPresetUserJson: JSON.stringify(this.presetList),
1295
+ presetUserJson: JSON.stringify(this.presetUserJson),
1296
+ nextReadUserId: this.readMultiple
1297
+ ? this.mixReadList && this.mixReadList.join('|')
1298
+ : nextReadUserId,
1299
+ nextOrgId: !this.isShowNextUser
1300
+ ? this.multiple
1301
+ ? this.mixOrgIdList && this.mixOrgIdList.join('|')
1302
+ : nextOrgId
1303
+ : '',
1304
+ handleExplain: handleExplain,
1305
+ presetReadUserId:
1306
+ this.mixPresetList && this.mixPresetList.length > 0
1307
+ ? this.mixPresetList.join('|')
1308
+ : presetReadUserId.join(','),
1309
+ opinion: this.newOpinion || newOpinion
1310
+ };
1311
+ if (this.enableCustomLimitTimeSetting) {
1312
+ params.customLimitTime = customLimitTime;
1313
+ if (!customLimitTime) {
1314
+ this.$message.warning('请选择或输入限时办理的天数');
1315
+ this.nextNode.customLimitTime = '';
1316
+ return;
1317
+ } else if (
1318
+ !Number(customLimitTime) ||
1319
+ customLimitTime.indexOf('.') != -1 ||
1320
+ Number(customLimitTime) < 0
1321
+ ) {
1322
+ this.$message.warning('请输入正确的天数');
1323
+ this.nextNode.customLimitTime = '';
1324
+ return;
1325
+ }
1326
+ }
1327
+ if (this.isHideCurrentOrg) {
1328
+ params.nextCurrentOrgObj = nextCurrentOrgObj;
1329
+ }
1330
+ if (this.isHideOtherOrg) {
1331
+ params.nextOtherOrgObj = nextOtherOrgObj;
1332
+ }
1333
+ if (this.activeNames != '1' || !this.isCustomPreset)
1334
+ delete params.customPresetUserJson;
1335
+ if (this.isFreeStartFlow || this.formType === 'readTransfer') {
1336
+ let newParm = {};
1337
+ newParm.copyHistory =
1338
+ this.copyHistory === 'needCopyPendedHistory';
1339
+ newParm.startFlowParamJson = params;
1340
+ // newParm.startFlowParamJson.businessId = this.id; //this.id
1341
+ newParm.startFlowParamJson.taskExamineParam = {
1342
+ startFlowFirstNodeName: this.taskExamineParam
1343
+ };
1344
+ newParm.startFlowParamJson = JSON.stringify(
1345
+ newParm.startFlowParamJson
1346
+ );
1347
+ for (let key in this.taskParams) {
1348
+ if (Array.isArray(this.taskParams[key])) {
1349
+ this.taskParams[key] =
1350
+ this.taskParams[key].length > 0
1351
+ ? this.taskParams[key].join(',')
1352
+ : '';
1353
+ }
1354
+ }
1355
+
1356
+ newParm.submitTaskParamJson = JSON.stringify(this.taskParams);
1357
+ if (this.formType == 'readTransfer') {
1358
+ newParm.readTransferHandleStartFlowParamJson =
1359
+ JSON.stringify(params);
1360
+ newParm.taskReadEndParamJson = JSON.stringify(
1361
+ this.taskParams
1362
+ );
1363
+ delete newParm.copyHistory;
1364
+ delete newParm.startFlowParamJson;
1365
+ delete newParm.submitTaskParamJson;
1366
+ }
1367
+ params = newParm;
1368
+ }
1369
+ if (this.copyHistory && !this.isFreeStartFlow) {
1370
+ params.pendingId = this.pendingId;
1371
+ delete params.businessId;
1372
+ }
1373
+ util
1374
+ .ajax({
1375
+ url: this.isFreeStartFlow
1376
+ ? freeStartFlowWithSubmitTask
1377
+ : this.formType == 'readTransfer'
1378
+ ? startReadTransferHandleFlowWithTaskReadEnd
1379
+ : this.copyHistory
1380
+ ? freeStartFlow
1381
+ : register,
1382
+ method: 'post',
1383
+ data: params
1384
+ })
1385
+ .then((res) => {
1386
+ const { status, message } = res;
1387
+ if (this.showBtn) {
1388
+ this.loading = false;
1389
+ } else {
1390
+ this.allLoading.close();
1391
+ }
1392
+ if (status === 'success' || res.rCode == 0) {
1393
+ this.quit(true);
1394
+ this.simpleTips && this.$message.success('操作成功');
1395
+ } else {
1396
+ this.$message.error(message || '系统错误,请联系管理员!');
1397
+ }
1398
+ })
1399
+ .catch((err) => {
1400
+ if (this.showBtn) {
1401
+ this.loading = false;
1402
+ } else {
1403
+ this.allLoading.close();
1404
+ }
1405
+ if (err.message && err.message !== 'canceled') {
1406
+ this.$message.error(err.message);
1407
+ }
1408
+ });
1409
+ });
1410
+ return;
1411
+ }
1412
+ if (this.showBtn) {
1413
+ this.loading = true;
1414
+ } else {
1415
+ this.allLoading = util.loading(this.$loading, '加载中...');
1416
+ }
1417
+ let newNextUser = [];
1418
+ if (this.multiple) {
1419
+ nextUser && nextUser.map((item) => newNextUser.push(item));
1420
+ }
1421
+ let newNoticeType = '';
1422
+ if (noticeType) {
1423
+ newNoticeType = noticeType.join(',');
1424
+ }
1425
+ let params = {
1426
+ processDefinitionId: this.processDefinitionId,
1427
+ nextUserId: this.multiple ? newNextUser.join(',') : nextUser,
1428
+ nextNodeId: nextNode,
1429
+ businessId: this.businessId,
1430
+ notificationType: newNoticeType,
1431
+ userId: util.getStorage('userId'),
1432
+ notificationMsg: noticeInfo,
1433
+ customPresetUserJson: JSON.stringify(this.presetList),
1434
+ presetUserJson: JSON.stringify(this.presetUserJson),
1435
+ nextReadUserId: this.readMultiple
1436
+ ? this.mixReadList && this.mixReadList.join('|')
1437
+ : nextReadUserId,
1438
+ nextOrgId: !this.isShowNextUser
1439
+ ? this.multiple
1440
+ ? this.mixOrgIdList && this.mixOrgIdList.join('|')
1441
+ : nextOrgId
1442
+ : '',
1443
+ handleExplain: handleExplain,
1444
+ presetReadUserId:
1445
+ this.mixPresetList && this.mixPresetList.length > 0
1446
+ ? this.mixPresetList.join('|')
1447
+ : presetReadUserId.join(','),
1448
+ opinion: this.newOpinion || newOpinion
1449
+ };
1450
+ if (this.enableCustomLimitTimeSetting) {
1451
+ params.customLimitTime = customLimitTime;
1452
+ if (!customLimitTime) {
1453
+ this.$message.warning('请选择或输入限时办理的天数');
1454
+ this.nextNode.customLimitTime = '';
1455
+ return;
1456
+ } else if (
1457
+ !Number(customLimitTime) ||
1458
+ customLimitTime.indexOf('.') != -1 ||
1459
+ Number(customLimitTime) < 0
1460
+ ) {
1461
+ this.$message.warning('请输入正确的天数');
1462
+ this.nextNode.customLimitTime = '';
1463
+ return;
1464
+ }
1465
+ }
1466
+ if (this.isHideCurrentOrg) {
1467
+ params.nextCurrentOrgObj = nextCurrentOrgObj;
1468
+ }
1469
+ if (this.isHideOtherOrg) {
1470
+ params.nextOtherOrgObj = nextOtherOrgObj;
1471
+ }
1472
+ if (this.activeNames != '1' || !this.isCustomPreset)
1473
+ delete params.customPresetUserJson;
1474
+ if (this.isFreeStartFlow || this.formType === 'readTransfer') {
1475
+ let newParm = {};
1476
+ newParm.copyHistory = this.copyHistory === 'needCopyPendedHistory';
1477
+ newParm.startFlowParamJson = params;
1478
+ // newParm.startFlowParamJson.businessId = this.id; //this.id
1479
+ newParm.startFlowParamJson.taskExamineParam = {
1480
+ startFlowFirstNodeName: this.taskExamineParam
1481
+ };
1482
+ newParm.startFlowParamJson = JSON.stringify(
1483
+ newParm.startFlowParamJson
1484
+ );
1485
+ for (let key in this.taskParams) {
1486
+ if (Array.isArray(this.taskParams[key])) {
1487
+ this.taskParams[key] =
1488
+ this.taskParams[key].length > 0
1489
+ ? this.taskParams[key].join(',')
1490
+ : '';
1491
+ }
1492
+ }
1493
+
1494
+ newParm.submitTaskParamJson = JSON.stringify(this.taskParams);
1495
+ if (this.formType == 'readTransfer') {
1496
+ newParm.readTransferHandleStartFlowParamJson =
1497
+ JSON.stringify(params);
1498
+ newParm.taskReadEndParamJson = JSON.stringify(this.taskParams);
1499
+ delete newParm.copyHistory;
1500
+ delete newParm.startFlowParamJson;
1501
+ delete newParm.submitTaskParamJson;
1502
+ }
1503
+ params = newParm;
1504
+ }
1505
+ if (this.copyHistory && !this.isFreeStartFlow) {
1506
+ params.pendingId = this.pendingId;
1507
+ delete params.businessId;
1508
+ }
1509
+ util
1510
+ .ajax({
1511
+ url: this.isFreeStartFlow
1512
+ ? freeStartFlowWithSubmitTask
1513
+ : this.formType == 'readTransfer'
1514
+ ? startReadTransferHandleFlowWithTaskReadEnd
1515
+ : this.copyHistory
1516
+ ? freeStartFlow
1517
+ : register,
1518
+ method: 'post',
1519
+ data: params
1520
+ })
1521
+ .then((res) => {
1522
+ const { status, message } = res;
1523
+ if (this.showBtn) {
1524
+ this.loading = false;
1525
+ } else {
1526
+ this.allLoading.close();
1527
+ }
1528
+ if (status === 'success' || res.rCode == 0) {
1529
+ this.quit(true);
1530
+ this.simpleTips && this.$message.success('操作成功');
1531
+ } else {
1532
+ this.$message.error(message || '系统错误,请联系管理员!');
1533
+ }
1534
+ })
1535
+ .catch((err) => {
1536
+ if (this.showBtn) {
1537
+ this.loading = false;
1538
+ } else {
1539
+ this.allLoading.close();
1540
+ }
1541
+ if (err.message && err.message !== 'canceled') {
1542
+ this.$message.error(err.message);
1543
+ }
1544
+ });
1545
+ } else {
1546
+ return false;
1547
+ }
1548
+ });
1549
+ },
1550
+ getNodeInfos(nodeId, index, processDefinitionId) {
1551
+ let params = {
1552
+ processDefinitionId: processDefinitionId || this.processDefinitionId,
1553
+ nextNodeId: nodeId ? nodeId : this.nextNode.nextNode,
1554
+ businessId: this.id,
1555
+ userId: util.getStorage('userId')
1556
+ };
1557
+ util
1558
+ .ajax({ url: getNodeInfo, params })
1559
+ .then((res) => {
1560
+ const {
1561
+ status,
1562
+ message,
1563
+ data: {
1564
+ nextUserList,
1565
+ nodeExtAttr,
1566
+ nodeMoreInfo,
1567
+ countersignaturetypeText,
1568
+ countersignaturetypeCode
1569
+ }
1570
+ } = res;
1571
+ if (this.showBtn) {
1572
+ this.loading = false;
1573
+ } else {
1574
+ this.allLoading.close();
1575
+ }
1576
+ if (status === 'success') {
1577
+ if (
1578
+ this.currentOrgSelectorParams.department &&
1579
+ !this.currentOrgSelectorParams.department.roleid &&
1580
+ this.selectorParams.roleid &&
1581
+ nodeExtAttr.deptRoleCode
1582
+ ) {
1583
+ this.currentOrgSelectorParams.department.roleid =
1584
+ nodeExtAttr.deptRoleCode;
1585
+ }
1586
+ this.isCurrentNodeForbiddenChangeCandidate =
1587
+ nodeExtAttr.isCurrentNodeForbiddenChangeCandidate;
1588
+ this.nextNode.userInfo = nextUserList;
1589
+ this.countersignaturetypeCode = countersignaturetypeCode;
1590
+ this.nextNode.countersignaturetypeText = countersignaturetypeText;
1591
+ this.enableCustomLimitTimeSetting =
1592
+ nodeExtAttr.enableCustomLimitTimeSetting == 1;
1593
+ if (nodeMoreInfo.currentOrgDefaultSelectObjectItems) {
1594
+ this.nextCurrentOrgselectUserList = [];
1595
+ if (
1596
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.deptIds.length >
1597
+ 0
1598
+ ) {
1599
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.deptIds.map(
1600
+ (x, i) => {
1601
+ this.nextCurrentOrgselectUserList.push({
1602
+ showname:
1603
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems
1604
+ .deptNames[i],
1605
+ showid: x,
1606
+ stype: 'department'
1607
+ });
1608
+ }
1609
+ );
1610
+ }
1611
+ if (
1612
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.userIds.length >
1613
+ 0
1614
+ ) {
1615
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.userIds.map(
1616
+ (x, i) => {
1617
+ this.nextCurrentOrgselectUserList.push({
1618
+ showname:
1619
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems
1620
+ .userNames[i],
1621
+ showid: x,
1622
+ stype: 'employee'
1623
+ });
1624
+ }
1625
+ );
1626
+ }
1627
+ if (
1628
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.orgIds.length >
1629
+ 0
1630
+ ) {
1631
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems.orgIds.map(
1632
+ (x, i) => {
1633
+ this.nextCurrentOrgselectUserList.push({
1634
+ showname:
1635
+ nodeMoreInfo.currentOrgDefaultSelectObjectItems
1636
+ .orgNames[i],
1637
+ showid: x,
1638
+ stype: 'enterprise'
1639
+ });
1640
+ }
1641
+ );
1642
+ }
1643
+ this.nextNode.nextCurrentOrgObj =
1644
+ nodeMoreInfo.currentOrgDefaultSelectObjects;
1645
+ }
1646
+ if (
1647
+ this.enableCustomLimitTimeSetting &&
1648
+ nodeMoreInfo.defaultCustomLimitDays
1649
+ ) {
1650
+ this.nextNode.customLimitTime =
1651
+ this.nextNode.customLimitTimeText =
1652
+ nodeMoreInfo.defaultCustomLimitDays + '';
1653
+ }
1654
+ this.isTaskread = nodeExtAttr.isTaskread;
1655
+ this.isHandleExplain = nodeExtAttr.isHandleExplain;
1656
+ this.isCustomUser = nodeExtAttr.isCustomUser; //是否展示选人组件按钮
1657
+ this.presetEdit = nodeExtAttr.presetEdit; //是否展示备选人
1658
+ this.isDefSelectedObj = nodeExtAttr.isDefSelectedObj; //是否默认选中
1659
+ if (
1660
+ nodeExtAttr.userSelectionType == 7 ||
1661
+ nodeExtAttr.userSelectionType == 8 ||
1662
+ nodeExtAttr.userSelectionType == 9 ||
1663
+ nodeExtAttr.userSelectionType == 10 ||
1664
+ nodeExtAttr.userSelectionType == 11 ||
1665
+ nodeExtAttr.userSelectionType == 12
1666
+ ) {
1667
+ this.getIsShowNextUser(
1668
+ nodeExtAttr && nodeExtAttr.userSelectionType
1669
+ );
1670
+ } else {
1671
+ const { multiple, params } = this.isMultiple(
1672
+ nodeExtAttr.userSelectionType
1673
+ );
1674
+ this.multiple = multiple;
1675
+ this.params = params;
1676
+ }
1677
+ // this.isReadMultiple(nodeExtAttr.userSelectionType);
1678
+ if (nodeExtAttr.nodeType === 1 || nodeExtAttr.nodeType === 2) {
1679
+ this.isHideCurrentOrg =
1680
+ nodeExtAttr.isHideCurrentOrg == 1 ? false : true; //判断是否隐藏本单位
1681
+ this.isHideOtherOrg =
1682
+ nodeExtAttr.isHideOtherOrg == 1 ? false : true; //判断是否隐藏外单位
1683
+ } else {
1684
+ this.isHideCurrentOrg = false;
1685
+ this.isHideOtherOrg = false;
1686
+ }
1687
+ nextUserList.map((item) => {
1688
+ if (
1689
+ this.multiple &&
1690
+ nodeExtAttr.isDefSelectedObj == 1 &&
1691
+ nextUserList !== undefined
1692
+ ) {
1693
+ this.nextNode.nextUser.push(item.userId);
1694
+ this.selectUserList.push({
1695
+ showname: item.username,
1696
+ showid: item.userId
1697
+ });
1698
+ }
1699
+
1700
+ this.options.push({
1701
+ showname: item.username,
1702
+ showid: item.userId
1703
+ });
1704
+ });
1705
+ if (this.multiple) {
1706
+ this.nextNode.nextReadUserId = [];
1707
+ } else {
1708
+ this.nextNode.nextReadUserId = '';
1709
+ }
1710
+ if (
1711
+ nextUserList.length > 0 &&
1712
+ nodeExtAttr.isDefSelectedObj == 1 &&
1713
+ !this.multiple
1714
+ ) {
1715
+ this.nextNode.nextUser = nextUserList[0].userId;
1716
+ this.selectUserList.push({
1717
+ showname: nextUserList[0].username,
1718
+ showid: nextUserList[0].userId
1719
+ });
1720
+ }
1721
+ this.radioList = this.options;
1722
+ } else {
1723
+ this.$message.error(message || '系统错误,请联系管理员!');
1724
+ }
1725
+ nodeId && this.$refs.selectUser[index].changeInfo();
1726
+ })
1727
+ .catch((err) => {
1728
+ if (this.showBtn) {
1729
+ this.loading = false;
1730
+ } else {
1731
+ this.allLoading.close();
1732
+ }
1733
+ if (err.message && err.message !== 'canceled') {
1734
+ this.$message.error(err.message);
1735
+ }
1736
+ });
1737
+ },
1738
+ changeSel(val) {
1739
+ this.nextNode.nextUser = [];
1740
+ this.options = [];
1741
+ this.selectUserList = [];
1742
+ this.radioList = [];
1743
+ if (this.showBtn) {
1744
+ this.loading = true;
1745
+ } else {
1746
+ this.allLoading = util.loading(this.$loading, '加载中...');
1747
+ }
1748
+ this.getNodeInfos();
1749
+ },
1750
+ // 取消
1751
+ quit(val) {
1752
+ if (val === true) return this.$emit('cancel', val);
1753
+ this.$emit('cancel', false);
1754
+ },
1755
+ getFind() {
1756
+ util
1757
+ .ajax({
1758
+ url: findSysCodes
1759
+ })
1760
+ .then((res) => {
1761
+ const { status, message } = res;
1762
+ if (status === 'success') {
1763
+ if (this.hideMessage) return;
1764
+ this.nextNode.noticeType = message.split(',');
1765
+ let arr = [];
1766
+ this.nextNode.noticeList.map((item) => {
1767
+ this.nextNode.noticeType.map((x) => {
1768
+ if (x == item.cciValue) {
1769
+ arr.push(x);
1770
+ }
1771
+ });
1772
+ });
1773
+ this.nextNode.noticeType = arr;
1774
+ } else {
1775
+ this.$message.error(message || '系统错误,请联系管理员!');
1776
+ }
1777
+ })
1778
+ .catch((err) => {
1779
+ if (this.showBtn) {
1780
+ this.loading = false;
1781
+ } else {
1782
+ this.allLoading.close();
1783
+ }
1784
+ if (err.message && err.message !== 'canceled') {
1785
+ this.$message.error(err.message);
1786
+ }
1787
+ });
1788
+ },
1789
+ /**
1790
+ * isMultiple
1791
+ * @desc:是否多选
1792
+ * @author liufan
1793
+ * @date 2022年9月13日
1794
+ **/
1795
+ isMultiple(val, choiceOrgId, choiceDeptId, pOrgId) {
1796
+ let multiple = false;
1797
+ let params = {};
1798
+ if (val == 2 || val == 4 || val == 6 || val == 16 || val == 12) {
1799
+ multiple = true;
1800
+ }
1801
+ if (val == 1 || val == 2 || val == 5) {
1802
+ params.filid = this.userModel.orgId;
1803
+ params.only_filid = true;
1804
+ if (choiceOrgId) {
1805
+ params.filid = choiceOrgId;
1806
+ }
1807
+ }
1808
+ if (val == 5 || val == 6) {
1809
+ params.filid = this.userModel.orgId;
1810
+ params.mydeptid = this.userModel.depId;
1811
+ if (choiceDeptId) {
1812
+ params.mydeptid = choiceDeptId;
1813
+ }
1814
+ if (choiceOrgId) {
1815
+ params.filid = choiceOrgId;
1816
+ }
1817
+ }
1818
+ if (val == 15 || val == 16) {
1819
+ params.filid = this.pOrgId;
1820
+ if (pOrgId) {
1821
+ params.filid = pOrgId;
1822
+ }
1823
+
1824
+ }
1825
+ return { multiple, params };
1826
+ },
1827
+ getStartFlow(processId) {
1828
+ if (!processId) {
1829
+ return false;
1830
+ }
1831
+ if (this.showBtn) {
1832
+ this.loading = true;
1833
+ } else {
1834
+ this.allLoading = util.loading(this.$loading, '加载中...');
1835
+ }
1836
+ this.businessId = this.id;
1837
+ let params = {
1838
+ processDefinitionId: processId, // processId || this.processDefinitionId,
1839
+ userId: util.getStorage('userId'),
1840
+ businessId: this.businessId
1841
+ };
1842
+ if (!this.shwowBtn) {
1843
+ params.taskAction = 'toStartFlowWithoutTempSave';
1844
+ }
1845
+ // 获取节点
1846
+ util
1847
+ .ajax({ url: toStartFlow, params })
1848
+ .then((res) => {
1849
+ //pc接口返回数据处理
1850
+ const { status, message, data } = res;
1851
+ if (status == 'success') {
1852
+ data.nodeInfoMap.nodeExtAttr.submitTipsMsg &&
1853
+ this.$confirm(
1854
+ data.nodeInfoMap.nodeExtAttr.submitTipsMsg,
1855
+ '提示',
1856
+ {
1857
+ confirmButtonText: '确定',
1858
+ cancelButtonText: '取消',
1859
+ type: 'warning'
1860
+ }
1861
+ )
1862
+ .then(() => {})
1863
+ .catch(() => {
1864
+ this.quit();
1865
+ });
1866
+ data.nextNodeCheckType &&
1867
+ (this.nextNodeCheckType = data.nextNodeCheckType);
1868
+ data.nextOperateCheckType &&
1869
+ (this.nextOperateCheckType = data.nextOperateCheckType);
1870
+ if (data.currentOrgSelectorParams) {
1871
+ if (
1872
+ data.currentOrgSelectorParams.enableCurrentOrgConfig == 'true'
1873
+ ) {
1874
+ this.currentOrgSelectorTabs =
1875
+ data.currentOrgSelectorParams.currentOrgType.split(',');
1876
+ let currentOrgparams =
1877
+ data.currentOrgSelectorParams.currentOrgRange.split(',');
1878
+ this.currentOrgSelectorTabs.map((x, i) => {
1879
+ this.currentOrgSelectorParams[x] = {
1880
+ filid:
1881
+ currentOrgparams[i] == 'my'
1882
+ ? JSON.parse(util.getStorage('mainConfig')).userModel
1883
+ .orgId
1884
+ : currentOrgparams[i],
1885
+ only_filid: true
1886
+ };
1887
+ });
1888
+ }
1889
+ }
1890
+ this.configInfo = res.data;
1891
+ this.customPresetHintMessage = data.customPresetHintMessage;
1892
+ this.readOnlyNotificationType = data.readOnlyNotificationType;
1893
+ this.notificationMessageReadOnly =
1894
+ data.notificationMessageReadOnly == 'true';
1895
+ this.nextNode.nodeInfo = data.nextNodeList;
1896
+ this.nextNode.nextNode = data.nextNodeList[0].nodeId;
1897
+ this.isPreset = data.isPreset;
1898
+ this.isHideDefaultOperation =
1899
+ data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation;
1900
+ this.defaultNextNode = data.nodeInfoMap.nodeExtAttr.defaultNextNode;
1901
+ this.isChooseNextNode =
1902
+ data.nodeInfoMap.nodeExtAttr.isChooseNextNode;
1903
+ this.isCdjxjTaskHandle = data.isCdjxjTaskHandle;
1904
+ if (this.isChooseNextNode == 1) {
1905
+ this.operationList = [
1906
+ // { key: 0, value: '默认', list: [] },
1907
+ { key: 1, value: '自定义', list: [] }
1908
+ ];
1909
+ if (data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation != 1) {
1910
+ this.operationList.unshift({
1911
+ key: 0,
1912
+ value: '默认',
1913
+ list: data.nextNodeList
1914
+ });
1915
+ }
1916
+ let arr = [];
1917
+ for (let key in data.taskNodeMap) {
1918
+ arr.push({ nodeName: data.taskNodeMap[key], nodeId: key });
1919
+ }
1920
+ // this.operationList[0].list = data.nextNodeList;
1921
+ this.operationList[
1922
+ data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation != 1 ? 1 : 0
1923
+ ].list = arr;
1924
+ if (this.isHideDefaultOperation != 1) {
1925
+ this.nextNode.nextOperate = 0;
1926
+ this.nextNode.nodeInfo = this.operationList[0].list;
1927
+ if (this.nextNode.nodeInfo.length > 0) {
1928
+ let defaultNodeData = data.nextNodeList.filter(
1929
+ (x) => x.nodeId == this.defaultNextNode
1930
+ );
1931
+ this.nextNode.nextNode =
1932
+ defaultNodeData.length > 0
1933
+ ? this.defaultNextNode
1934
+ : data.nextNodeList[0].nodeId;
1935
+ }
1936
+ }
1937
+ if (
1938
+ data.nodeInfoMap.nodeExtAttr.defaultNextOperate == 1 ||
1939
+ data.nodeInfoMap.nodeExtAttr.isHideDefaultOperation == 1
1940
+ ) {
1941
+ // this.nextNode.nodeInfo = data.nextNodeList
1942
+ this.nextNode.nextOperate = 1;
1943
+ this.nextNode.nodeInfo =
1944
+ this.operationList[
1945
+ this.isHideDefaultOperation != 1 ? 1 : 0
1946
+ ].list;
1947
+
1948
+ if (this.nextNode.nodeInfo.length > 0) {
1949
+ let defaultNodeData = this.nextNode.nodeInfo.filter(
1950
+ (x) => x.nodeId == this.defaultNextNode
1951
+ );
1952
+ this.nextNode.nextNode =
1953
+ defaultNodeData.length > 0
1954
+ ? this.defaultNextNode
1955
+ : this.nextNode.nodeInfo[0].nodeId;
1956
+ }
1957
+ }
1958
+ }
1959
+ this.isCustomPreset = data.isCustomPreset;
1960
+ this.presetTaskNodeKeyStr = data.presetTaskNodeKeyStr;
1961
+ this.presetTaskNodeMap = data.presetTaskNodeMap;
1962
+ this.isSinglePage = data.taskExamine.isSinglePage;
1963
+ this.pOrgId = data.pOrgId;
1964
+ this.isSinglePage &&
1965
+ (this.nextNode.opinion = data.taskExamine.opinion);
1966
+ // this.nextNode.noticeInfo = data.taskExamine.notificationMsg;
1967
+ this.nextNode.nodeName = data.taskExamine.nodeName;
1968
+ this.canPresetRead = data.canPresetRead;
1969
+ if (data.canPresetRead) {
1970
+ let ids =
1971
+ data.nodeInfoMap.nodeExtAttr.presetReadCandinateIds.split(',');
1972
+ let names =
1973
+ data.nodeInfoMap.nodeExtAttr.presetReadCandinateNames.split(
1974
+ ','
1975
+ );
1976
+ ids.map((item, index) => {
1977
+ this.presetReadUserId.push({
1978
+ showid: item,
1979
+ showname: names[index]
1980
+ });
1981
+ this.selectPresetUserList.push({
1982
+ showid: item,
1983
+ showname: names[index]
1984
+ });
1985
+ this.nextNode.presetReadUserId.push(item);
1986
+ });
1987
+ }
1988
+ this.getNodeInfos(undefined, undefined, processId);
1989
+ // this.getPresetFlowInfo();
1990
+ if (this.isCustomPreset) {
1991
+ this.$nextTick(() => {
1992
+ this.$refs.customPreset &&
1993
+ this.$refs.customPreset.getPresetFlowInfo(
1994
+ this.nextNode.nextNode,
1995
+ undefined,
1996
+ true
1997
+ );
1998
+ });
1999
+ }
2000
+ this.getFind();
2001
+ this.getMessage();
2002
+ } else {
2003
+ this.$message.error(message || '系统错误,请联系管理员!');
2004
+ }
2005
+ })
2006
+ .catch((err) => {
2007
+ if (this.showBtn) {
2008
+ this.loading = false;
2009
+ } else {
2010
+ this.allLoading.close();
2011
+ }
2012
+ if (err.message && err.message !== 'canceled') {
2013
+ this.$message.error(err.message);
2014
+ }
2015
+ });
2016
+ }
2017
+ }
2018
+ };
2019
+ </script>