sasp-flow-render 1.1.22 → 1.1.24-decoupling

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.
@@ -0,0 +1,1088 @@
1
+ <!-- components/WorkflowDialog.vue -->
2
+ <template>
3
+ <div>
4
+ <!--处理、修改、查看流程信息弹窗-->
5
+ <el-dialog :close-on-click-modal=false top="5vh" width="90%" height="90%" :visible.sync="flowInstDataDialog" append-to-body
6
+ custom-class="flowInstTabDialog">
7
+ <span slot="title" class="dialog-title">
8
+ <span>{{flowFormTitle}}</span>
9
+ </span>
10
+ <template v-if="flowInstDataDialog">
11
+ <!-- <slot name="formInfo"></slot>-->
12
+ <render-form :flowComponet="workFlowUtil.$this"
13
+ v-if="workFlowUtil.$this.$slots.formInfo && flowInstDataDialog">
14
+
15
+ </render-form>
16
+ <template v-else>
17
+ <table-form-render ref="tableRef"
18
+ v-if="flowInstDataDialog"
19
+ is-sign-form
20
+ is-edit-data
21
+ useLoadSelf
22
+ :tableview-id="tableviewId"
23
+ :data-id="formInfo.dataId"
24
+ isFlow
25
+ :flowFieldStatus="flowFieldStatus"
26
+ :flowFieldDefault="fieldDefaultVal"
27
+ :flowFieldDefaultChangeNum="fieldDefaultValChangeNum"
28
+ :flowFieldDefaultFromForm="flowFieldDefaultFromForm"
29
+ :form-operate="formOperate"
30
+ :form-id="formId">
31
+ </table-form-render>
32
+ </template>
33
+ </template>
34
+ <div slot="footer" style="height:31px;" class="dialog-footer">
35
+ <div v-if="!formSearchObj.isNewSelectBatchDeal">
36
+ <el-button
37
+ v-for="button in Object.values(diyButtonsObj)"
38
+ :key="button.id" size="small" :type="button.buttonColor" :icon="button.buttonIcon"
39
+ v-if="judeDiyButton(tabActive,button)"
40
+ @click="openDiyButtonEvent('table','', button)">{{button.showButtonName}}
41
+ </el-button>
42
+ <el-button v-for="btn in formBtnArr" @click="btn.method" :disabled="isDisabled[btn.btnType]?false:true"
43
+ v-show="btn.show && ((formInfo.opt != 'view') || (formInfo.opt=='view' && btn.isView))"
44
+ :key="btn.btnType"
45
+ :type="btn.type"
46
+ :icon="btn.icon"
47
+ size="small">
48
+ {{btn.text}}
49
+ </el-button>
50
+ </div>
51
+ <div v-else>
52
+ <el-button v-for="btn in formNewBtnArr" @click="btn.method"
53
+ :key="btn.btnType"
54
+ :type="btn.type"
55
+ :icon="btn.icon"
56
+ size="small">{{btn.text}}
57
+ </el-button>
58
+ </div>
59
+ </div>
60
+ </el-dialog>
61
+
62
+ <!--流程下一步处理人选择弹窗-->
63
+ <el-dialog :close-on-click-modal=false style="font-family: '微软雅黑'" :title="'下一步' + (nextNodeName ? (isProceedNext?' -> ' + nextNodeName:'->等待他人处理') : '')"
64
+ :top="nextNode.nextType != 'inclusiveGateway' ? '20vh': '10vh'" append-to-body
65
+ width="500px" :visible.sync="nextSteptUserDialog" @closed="closeNextSteptUserDialog">
66
+ <el-form label-width="100px" size="small" v-if="nextNode.nodeType != 'EndEvent'">
67
+ <fieldset v-if="nextNode.nextType == 'inclusiveGateway'"
68
+ v-for="(itemAll,index) in (nextNode.result || [])" :key="index">
69
+ <legend>
70
+ {{itemAll.nodeName}}
71
+ </legend>
72
+ <el-form-item label="" label-width="0">
73
+ <el-select v-model="chooseNextUserIdObj[itemAll.nodeKey]" v-if="itemAll.type != 'all'"
74
+ :multiple="itemAll.mulitiChooseUser" style="width:100%">
75
+ <el-option v-for="item in itemAll.userArr" :key="item.id" :value="item.id"
76
+ :label="item.userName"></el-option>
77
+ </el-select>
78
+ <div @click="chooseUser(itemAll.nodeKey)">
79
+ <el-input v-model="chooseNextUserNameObj[itemAll.nodeKey]" v-if="itemAll.type == 'all'"
80
+ readonly>
81
+ <el-button slot="append" icon="el-icon-search"></el-button>
82
+ </el-input>
83
+ </div>
84
+ </el-form-item>
85
+ </fieldset>
86
+ <el-form-item label="下一步执行人" v-if="nextNode.nextType != 'inclusiveGateway' && isProceedNext">
87
+ <el-select v-model="chooseNextUserId" v-if="nextSteptUserType != 'all' && nextSteptUserDialog"
88
+ :multiple="mulitiChooseUser" filterable style="width:100%">
89
+ <el-option v-for="item in nextSteptUserArr" :key="item.id" :value="item.id"
90
+ :label="item.userName"></el-option>
91
+ </el-select>
92
+ <div @click="chooseUser()">
93
+ <el-input v-model="chooseNextUserName" v-if="nextSteptUserType == 'all'" readonly>
94
+ <el-button slot="append" icon="el-icon-search"></el-button>
95
+ </el-input>
96
+ </div>
97
+ </el-form-item>
98
+ <fieldset v-if="nextNode.nextType == 'inclusiveGateway'">
99
+ <legend>
100
+ {{'附加说明'}}
101
+ </legend>
102
+ <el-form-item label="" label-width="0">
103
+ <el-input type="textarea" :rows="5" v-model="description"></el-input>
104
+ </el-form-item>
105
+ </fieldset>
106
+ <el-form-item label="附加说明" v-if="nextNode.nextType != 'inclusiveGateway' && isProceedNext">
107
+ <el-input type="textarea" :rows="5" v-model="description"></el-input>
108
+ </el-form-item>
109
+ <el-form-item v-if="nextNode.nextType != 'inclusiveGateway' && !isProceedNext" label-width="0">
110
+ <div>请等待其他人员处理完成。</div>
111
+ </el-form-item>
112
+ </el-form>
113
+ <div v-if="nextNode.nodeType == 'EndEvent'">流程即将结束,是否继续?</div>
114
+ <div slot="footer" class="dialog-footer">
115
+ <el-button type="primary" size="small" @click="saveNextStept()" :disabled="isDisabled1?false:true">确定
116
+ </el-button>
117
+ <el-button size="small" @click="closeNextSteptUserDialog">取消</el-button>
118
+ </div>
119
+ </el-dialog>
120
+
121
+ <el-dialog :close-on-click-modal=false title="组织岗位用户" top="5vh" width="80%" height="80%"
122
+ :visible.sync="sysOrgPosUserDialog" append-to-body>
123
+ <!-- <sys-org-pos-user-select ref="orgPosUserRef" v-if="sysOrgPosUserDialog"-->
124
+ <!-- :filterUserParam="{'commonUserType':'common' }" :ognEnable="false"-->
125
+ <!-- :default-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"-->
126
+ <!-- defaultChooseIds="$"-->
127
+ <!-- :posEnable="false" :checkbox="mulitiChooseUser">-->
128
+ <!-- </sys-org-pos-user-select>-->
129
+ <user-select ref="orgPosUserRef"
130
+ :choose-user-ids="inclusiveChooseKey ? choosePosUserIdsObj[inclusiveChooseKey]:choosePosUserIds"
131
+ :checkbox="mulitiChooseUser" v-if="sysOrgPosUserDialog">
132
+ </user-select>
133
+ <div slot="footer" class="dialog-footer">
134
+ <el-button type="primary" size="small" @click="sureNextUser()">确定</el-button>
135
+ <el-button size="small" @click="sysOrgPosUserDialog = false">取消</el-button>
136
+ </div>
137
+ </el-dialog>
138
+
139
+ <el-dialog :close-on-click-modal=false title="选择加签人" top="5vh" width="80%" height="80%"
140
+ :visible.sync="completeSignDialog" append-to-body @closed="disableSign = false">
141
+ <!-- <sys-org-pos-user-select ref="completeSignRef"-->
142
+ <!-- :filterUserParam="{'commonUserType':'common','filterLoginUser':'Y'}"-->
143
+ <!-- :ognEnable="false"-->
144
+ <!-- :posEnable="false"-->
145
+ <!-- :checkbox="true"-->
146
+ <!-- v-if="completeSignDialog"-->
147
+ <!-- >-->
148
+ <!-- </sys-org-pos-user-select>-->
149
+ <user-select ref="completeSignRef"
150
+ v-if="completeSignDialog">
151
+ </user-select>
152
+ <div slot="footer" class="dialog-footer">
153
+ <el-button type="primary" size="small" @click="sureCompleteSign()" :disabled="disableSign">确定</el-button>
154
+ <el-button size="small" @click="completeSignDialog = false">取消</el-button>
155
+ </div>
156
+ </el-dialog>
157
+
158
+ <el-dialog :close-on-click-modal=false title="选择转签人" top="5vh" width="80%" height="80%"
159
+ :visible.sync="turnSignDialog" append-to-body @closed="disableSign = false">
160
+ <!-- <sys-org-pos-user-select ref="turnSignRef"-->
161
+ <!-- :filterUserParam="{'commonUserType':'common' }"-->
162
+ <!-- :ognEnable="false"-->
163
+ <!-- :posEnable="false"-->
164
+ <!-- :checkbox="false"-->
165
+ <!-- v-if="turnSignDialog"-->
166
+ <!-- >-->
167
+ <!-- </sys-org-pos-user-select>-->
168
+ <user-select ref="turnSignRef"
169
+ :checkbox="false"
170
+ v-if="turnSignDialog">
171
+ </user-select>
172
+ <div slot="footer" class="dialog-footer">
173
+ <el-button type="primary" size="small" @click="sureTurnSign()" :disabled="disableSign">确定</el-button>
174
+ <el-button size="small" @click="turnSignDialog = false">取消</el-button>
175
+ </div>
176
+ </el-dialog>
177
+
178
+
179
+ <el-dialog :close-on-click-modal="false" append-to-body title="查看流程图"
180
+ :visible.sync="flowChartObj.dialogVisible"
181
+ width="90%" height="90%"
182
+ top="5vh">
183
+ <flow-chart :flow-id="(flowChartObj.flowId) + ''" :inst-id="flowChartObj.instId + ''"
184
+ :link-proc-id="flowChartObj.linkProcId + ''"
185
+ :is-release="flowChartObj.isRelease"
186
+ v-if="flowChartObj.dialogVisible"></flow-chart>
187
+ <div slot="footer" class="dialog-footer">
188
+ <el-button @click="flowChartObj.dialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
189
+ </div>
190
+ </el-dialog>
191
+
192
+ <el-dialog :close-on-click-modal="false" append-to-body title="流转记录"
193
+ :visible.sync="flowRecordObj.dialogVisible"
194
+ width="90%" height="90%"
195
+ top="5vh">
196
+ <flow-roam-record :instId="flowRecordObj.instId + ''" v-if="flowRecordObj.dialogVisible"></flow-roam-record>
197
+ <div slot="footer" class="dialog-footer">
198
+ <el-button @click="flowRecordObj.dialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
199
+ </div>
200
+ </el-dialog>
201
+
202
+ <el-dialog :close-on-click-modal="false" append-to-body title="流转记录"
203
+ :visible.sync="flowRecordObj.oldDialogVisible"
204
+ width="90%" height="90%"
205
+ top="5vh">
206
+ <roam-record :flow-inst-id="flowRecordObj.instId + ''" v-if="flowRecordObj.oldDialogVisible"></roam-record>
207
+ <div slot="footer" class="dialog-footer">
208
+ <el-button @click="flowRecordObj.oldDialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
209
+ </div>
210
+ </el-dialog>
211
+
212
+ <el-dialog :close-on-click-modal="false" append-to-body title="选择退回节点"
213
+ :visible.sync="backDialogVisible"
214
+ width="450px" height="320px"
215
+ top="30vh">
216
+ <el-form label-width="80px">
217
+ <el-form-item label="退回节点">
218
+ <el-select v-model="backNodeId" clearable style="width: 100%">
219
+ <el-option v-for="item in backNodeArr" :key="item.nodeId" :label="item.nodeName" :value="item.nodeId">
220
+ </el-option>
221
+ </el-select>
222
+ </el-form-item>
223
+ <el-form-item label="退回备注">
224
+ <el-input v-model="backMsg" type="textarea" :autosize="{minRows:4,maxRows:4}"></el-input>
225
+ </el-form-item>
226
+ </el-form>
227
+ <div slot="footer" class="dialog-footer">
228
+ <el-button @click="beginBack" size="small" type="primary" icon="el-icon-success" :disabled="isDisabled2?false:true">确定</el-button>
229
+ <el-button @click="backDialogVisible = false" size="small" icon="el-icon-error">关闭</el-button>
230
+ </div>
231
+ </el-dialog>
232
+
233
+ <el-dialog :close-on-click-modal="false" append-to-body :title="diyDialogProps.title || '打开页面'"
234
+ :visible.sync="diyDialogProps.visible" :show-close="false"
235
+ :width="diyDialogProps.width || '80%'" :height="diyDialogProps.height || '80%'"
236
+ :top="diyDialogProps.top || '10vh'">
237
+ <table-form-render v-bind="diyDialogProps.props" ref="dialogFormRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'form'"></table-form-render>
238
+ <list-view-preview v-bind="diyDialogProps.props" ref="dialogListRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'list'"></list-view-preview>
239
+ <component v-bind="diyDialogProps.props" :is="diyDialogProps.component" ref="dialogComponentRef" v-if="diyDialogProps.visible && diyDialogProps.type === 'component'">
240
+
241
+ </component>
242
+ <div slot="footer" class="dialog-footer">
243
+ <template v-for="item in diyDialogProps.buttonList">
244
+ <el-button @click="dialogEvent(item)" size="small" :type="item.type" :icon="item.icon || 'el-icon-success'">{{item.name}}</el-button>
245
+ </template>
246
+ <el-button @click="diyDialogProps.visible = false" size="small" icon="el-icon-error" v-if="diyDialogProps.showClose">关闭</el-button>
247
+ </div>
248
+ </el-dialog>
249
+ </div>
250
+ </template>
251
+
252
+ <script>
253
+ import UserSelect from "../../userSelect.vue";
254
+ import RenderForm from "./renderForm.vue";
255
+ import FlowChart from "../../flowChart";
256
+ import FlowRoamRecord from "../../flowRoamRecords";
257
+ import RoamRecord from "../../roamRecord";
258
+
259
+ export default {
260
+ name: 'flowDialog',
261
+ components: {RenderForm, UserSelect,RoamRecord,
262
+ FlowRoamRecord,
263
+ FlowChart,},
264
+ data() {
265
+ let vm = this;
266
+ return {
267
+ flowData:{
268
+ flowId: '',
269
+ operateRootArr: [],
270
+ flowobj: {},
271
+ defaultTab: '',
272
+ dataPermisArr:[],
273
+ },
274
+ tabActive: "pending",
275
+ loginUser: {},//当前登录用户
276
+ userDept: {},//当前登录用户所在部门信息
277
+ flowDefine: {},
278
+ flowDefineByFlowId: {},
279
+ flowNodeIdToInfo: {},//key为id
280
+ flowNodeNameObj:{}, //节点名称对应节点id分组
281
+ draftNodeId:"", // 草稿节点id
282
+ allNodeInfo: {},//key为id
283
+ startNodeKey: "",//开始节点key
284
+ formFieldObj: {},//表单字段
285
+
286
+ isShow: false,
287
+ currentStartUser: "",
288
+ currentStartTime: "",
289
+
290
+ currentInst: {},//当前流程实例
291
+
292
+ // 列表按钮
293
+ listButtonObj: {
294
+ add: "新增",
295
+ delete: "删除",
296
+ update: "修改",
297
+ view: "查看",
298
+ deal: "处理",
299
+ flowRecord: "流转记录",
300
+ flowChart: "流程图",
301
+ },
302
+
303
+ // 批量处理
304
+ flowBatchPendingDialog: false,
305
+ // 选择性的批量多条一次性处理
306
+ flowBatchSelectPendingDialog: false,
307
+ batchUpdateFormInfo: {
308
+ formShow: false,
309
+ dataRows: [],
310
+ pendingNums: 0,
311
+ activeName: "",
312
+ batchDataId: ""
313
+ },
314
+
315
+ nodeFormBtnObj: {},
316
+
317
+ formBtnArr: [],
318
+ //表单按钮
319
+ formButtonObj: {
320
+ saveDraft: "存草稿",
321
+ completeSign: "加签",
322
+ turnSign: "转签",
323
+ nextStep: "下一步",
324
+ back: "退回",
325
+ getBack: "取回",
326
+ cancel: "撤销",
327
+ stopped: "中止",
328
+ close: "关闭",
329
+ export: "导出",
330
+ retSpecified: "退回指定节点"
331
+ },
332
+
333
+ nodeListButtonObj: {},
334
+ nodeFormButtonObj: {},
335
+ optColumnWidth: 336,
336
+ showModel: "list",//默认风格 list:列表card:卡片
337
+ showInfo: "flow",//展示信息 flow:流程信息 form:表单信息
338
+ operateType: {},
339
+ resourceTabOpts: ['draft','pending','processed','rescinded','finished','discontinue','flowQuery'],
340
+ tabTypeObj: {},//标签页对象
341
+ numberObj: {draft: 0, pending: 0, processed: 0, rescinded: 0, finished: 0, discontinue: 0},//标签内容数量对象
342
+ flowChartDialogVisible: false,
343
+ agentTitle: "", //代理标题
344
+ agentFormObj: {
345
+ openAgent: '0',
346
+ agentUserId: '', //代理人
347
+ flowId: "",
348
+ userId: '',
349
+ agentNodeUser: '',
350
+ agentUser: {}, //代理人
351
+ agentUserName: '',//代理人名称
352
+ agentUserKey: '', //代理人id
353
+ }, //代理对象
354
+ agentNodeUserArr: [], //代理人arr
355
+ agentVisible: false,
356
+
357
+ flowFormTitle: "" || "流程信息",//工作流表单信息弹出框标题
358
+
359
+ // 流转记录
360
+ flowRecordObj: {
361
+ instId: "",
362
+ dialogVisible: false,
363
+ oldDialogVisible: false,
364
+ },
365
+
366
+ // 流程图
367
+ flowChartObj: {
368
+ dialogVisible: false,
369
+ flowId: "",
370
+ instId: "",
371
+ linkProcId:"",
372
+ isRelease:"",
373
+ },
374
+
375
+ completeSignDialog: false,//加签人窗口
376
+ turnSignDialog: false,//转签人窗口
377
+ pendingNums: "",//批量处理条数
378
+ sysOrgPosUserDialog: false,
379
+ mulitiChooseUser: false,//处理人是否多选
380
+
381
+ nextSteptUserDialog: false,//下一步执行人窗口
382
+ nextSteptUserType: "all",
383
+ nextSteptUserArr: [],//下一步处理人
384
+ chooseNextUserId: "",//选择的处理人
385
+ chooseNextUserName: "",//选择的处理人名称
386
+ choosePosUserIds: "",//选择的处理人组织岗位id
387
+ chooseNextUserIdObj: {},//选择的处理人集合
388
+ choosePosUserIdsObj: {},//选择的处理人组织岗位id集合
389
+ chooseNextUserNameObj: {},//选择的处理人名称集合
390
+ inclusiveChooseKey:"", // 并行网关下一步选择多个节点时是全部人员选择时
391
+
392
+ nextNodeName:"", // 下一个节点名称
393
+ nextNode: {},//下一个节点信息
394
+ nowNode: {},//本节点信息
395
+ isProceedNext:true,
396
+ description: "",//附加说明
397
+
398
+ // 处理、修改、查看流程信息弹窗
399
+ flowInstDataDialog: false,
400
+ currentRowData: {}, // 修改时行数据
401
+
402
+ // 表单信息
403
+ formInfo: {
404
+ dataId: "",
405
+ opt: "view",
406
+ },
407
+
408
+
409
+ isDisabled: {
410
+ update: true,
411
+ deal: true,
412
+ flowRecord: true,
413
+ flowChart: true,
414
+ view: true,
415
+ saveDraft: true,
416
+ completeSign: true,
417
+ turnSign: true,
418
+ nextStep: true,
419
+ back: true,
420
+ cancel: true,
421
+ stopped: true,
422
+ close: true,
423
+ export: true,
424
+ retSpecified: true,
425
+ getBack: true,
426
+ record: true,
427
+ restore: true,
428
+ },
429
+ flowParams:{}, // 流程流转变量
430
+ isDisabled1: true,
431
+
432
+ initSuccess: false,
433
+
434
+ backDialogVisible:false, //退回指定节点窗口
435
+ backNodeArr:[], //退回节点arr
436
+ backMsg:'',//退回信息
437
+ backNodeId:'',//退回节点id
438
+ isDisabled2:true,
439
+ isShowAgentSet:false,//是否显示流程设置
440
+ loadAgentSuccess:false,//是否显示流程设置
441
+
442
+ startNodeKeyObj: {}, //当前开始节点 key 和对应版本号
443
+ startNodeKeyObjByFlowId: {},
444
+ flowVersionNodeObj: {}, //版本号对应的节点对象
445
+ flowVersionNodeObjByFlowId: {},
446
+ parentListViewId:"",
447
+ parentTableViewId:"",
448
+ scriptObj:{},
449
+ newScriptObj:{}, //新事件规则-脚本
450
+ newEventObj:{}, //新事件规则-规则
451
+ installListObj:this.EVENT_PLUGIN['installEventObj']||{}, //已经安装的流程事件
452
+ formSettingVisible:false,
453
+ workListViews:{},
454
+ workTableViews:{},
455
+ currNodeName: "", //当前节点名称
456
+ nextUserInfo: {}, // 下一步处理人的信息
457
+ dataId: "", // 表单数据id
458
+ disableSign: false, // 禁用加签转签按钮
459
+ formSearchObj: {
460
+ taskNode: "",
461
+ flowNewBatchDealArr: [],
462
+ isNewSelectBatchDeal: false,
463
+ loading: true,
464
+ isInit: false
465
+ },
466
+ formDataObj: {},
467
+ formNewBtnArr: [],
468
+ isRefreshGetNextUsers: [], // 是否要刷新下一步处理人的字段,网关字段,表单,变量
469
+ fieldSysDataObj: {},
470
+ flowNewBatchDealDataIds: "",
471
+ currentPage: 1, //当前页
472
+ pages: 1, //总页数
473
+ total: 0, //总条数
474
+ pageSize: 50, //每页多少条
475
+ flowEventScriptByFlowId: {},
476
+ diyButtonsObj: {}, // 自定义按钮对象
477
+
478
+ // 原props对象
479
+ flowNextOperation: null, // 以下内容是原props
480
+ workFlowUtil: null,
481
+
482
+ flowFieldStatus:{},
483
+ fieldDefaultVal:{},
484
+ fieldDefaultValChangeNum:{},
485
+ flowFieldDefaultFromForm:{},
486
+ formOperate: "add",
487
+ formId: "",
488
+ tableviewId: "",
489
+ diyDialogProps:{
490
+ visible: false,
491
+ showClose:true,
492
+ title: "",
493
+ width: "90%",
494
+ height: "90%",
495
+ top: "5vh",
496
+ props: {},
497
+ buttonList:[]
498
+ }
499
+ }
500
+ },
501
+ watch:{
502
+ flowInstDataDialog(){
503
+ if(this.flowInstDataDialog){
504
+ this.isDisabled1 = true;
505
+ this.isDisabled['nextStep'] = true;
506
+ }
507
+ }
508
+ },
509
+ methods: {
510
+ initDialogProps(dialogProps) {
511
+ this.flowNextOperation = dialogProps.flowNextOperation;
512
+ this.workFlowUtil = dialogProps.workFlowUtil;
513
+ this.getFieldInfo();
514
+ },
515
+
516
+ openFlowDialog(args){
517
+ if(args.visible){
518
+ console.log("visible为系统参数,不允许设置此参数");
519
+ delete args.visible;
520
+ }
521
+ args.props = args.props || {};
522
+ if(args.type === "form"){
523
+ let props = args.props;
524
+ args.props = Object.assign({isSignForm:true, isEditData: true},props);
525
+ }
526
+ Object.assign(this.diyDialogProps, args);
527
+ this.diyDialogProps.visible = true;
528
+ },
529
+
530
+ closeFlowDialog(){
531
+ this.diyDialogProps.visible = false;
532
+ },
533
+
534
+ dialogEvent(item){
535
+ let ref = "dialogFormRef";
536
+ if(this.diyDialogProps.type === "list"){
537
+ ref = "dialogListRef";
538
+ }
539
+ if(this.diyDialogProps.type === "component"){
540
+ ref = "dialogComponentRef";
541
+ }
542
+ item.event && item.event(this,ref);
543
+ },
544
+
545
+ operateDialog(key,value) {
546
+ this[key] = value;
547
+ },
548
+ /**
549
+ * 选择下一步执行人
550
+ */
551
+ chooseUser(nodekey) {
552
+ this.inclusiveChooseKey = nodekey || "";
553
+ this.sysOrgPosUserDialog = true;
554
+ },
555
+ fillFlowDialogParams(params){
556
+ Object.keys(params).forEach(key => {
557
+ this[key] = params[key];
558
+ });
559
+ },
560
+ /**
561
+ * 下一步确定
562
+ */
563
+ saveNextStept() {
564
+ this.isDisabled1 = false;
565
+ let dealers = this.chooseNextUserId;
566
+ let dealerNames = this.chooseNextUserName;
567
+ let dealersObj = {};
568
+ if (this.nextNode.nextType == "inclusiveGateway") {
569
+ // 校验是否选人了
570
+ let tempResult = true;
571
+ Object.keys(this.chooseNextUserIdObj).forEach(key => {
572
+ let dealers = this.chooseNextUserIdObj[key];
573
+ if(Array.isArray(dealers)){
574
+ dealersObj[key] = dealers.join(",");
575
+ }else{
576
+ dealersObj[key] = dealers;
577
+ }
578
+ if ((this.chooseNextUserIdObj[key] || []).length == 0) {
579
+ tempResult = false;
580
+ }
581
+ });
582
+ if (!tempResult) {
583
+ this.$message.error("所有任务都需要设置执行人!");
584
+ this.isDisabled1 = true;
585
+ return;
586
+ }
587
+ } else {
588
+ if (dealers && !dealerNames) {
589
+ let userName = "";
590
+ this.nextSteptUserArr.forEach(item => {
591
+ if (("," + dealers + ",").indexOf("," + item.id + ",") > -1) {
592
+ userName += "," + item.userName;
593
+ }
594
+ });
595
+ if (userName) {
596
+ userName = userName.substring(1);
597
+ }
598
+ this.chooseNextUserName = userName;
599
+ dealerNames = this.chooseNextUserName;
600
+ }
601
+ if (this.nextNode.nodeType != 'EndEvent') {
602
+ if ((!this.chooseNextUserId || this.chooseNextUserId.length == 0) && this.isProceedNext) {
603
+ this.$message({type: "error", message: "请选择处理人!"});
604
+ this.isDisabled1 = true;
605
+ return;
606
+ }
607
+ if (this.nextNode.dealType != "single") {
608
+ if (typeof this.chooseNextUserId == 'string') {
609
+ dealers = this.chooseNextUserId;
610
+ } else {
611
+ dealers = this.chooseNextUserId.join(",");
612
+ }
613
+ if (typeof this.chooseNextUserName == 'string') {
614
+ dealerNames = this.chooseNextUserName;
615
+ } else {
616
+ dealerNames = this.chooseNextUserName.join(",");
617
+ }
618
+ }else if(this.nextNode.dealType == "single"){
619
+ dealers=dealers.split(",")[0];
620
+ dealerNames=dealerNames.split(",")[0];
621
+ }
622
+ } else {
623
+ dealers = "";
624
+ }
625
+ dealersObj[this.nextNode["nodeLinkId"]] = dealers;
626
+ }
627
+
628
+ this.nextUserInfo['dealers'] = dealers;
629
+ this.nextUserInfo['dealerNames'] = dealerNames;
630
+ this.nextUserInfo['dealersObj'] = dealersObj;
631
+
632
+ let obj = {
633
+ instId: this.saveInstId,
634
+ dealers: dealers,
635
+ dealerNames: dealerNames,
636
+ nextNodeType: this.nextNode.nodeType,
637
+ dealersObj: JSON.stringify(dealersObj),
638
+ taskId: this.currentInst.taskId,
639
+ nextNodeId: this.nextNode.id,
640
+ nextNodeKey: this.nextNode.nodeLinkId,
641
+ }
642
+ if(this.nowNode && this.nowNode.dealType && this.nowNode.dealType == 'multi'){
643
+ this.$set(obj,'passCondition',this.nowNode.passCondition)
644
+ }
645
+ if(this.flowNextOperation) {
646
+ this.flowNextOperation(obj.instId, obj.dealers, obj.dealerNames, obj.taskId);
647
+ }
648
+ let params = {"SASP_FLOW_USE_VARIABLES":"yes"};
649
+ Object.assign(params,this.flowParams || {},obj);
650
+ this.saspFlowAxios.post(this.api.plFlowInst.executeNextStep,params).then(res => {
651
+ if (res && res.data && res.data.operateSuccess) {
652
+ this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
653
+ this.$message({type: "success", message: "提交成功!"});
654
+ if (this.flowBatchPendingDialog) {
655
+ this.workFlowUtil.batchTabRemove && this.workFlowUtil.batchTabRemove(this.currentInst.dataId);
656
+ } else {
657
+ this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
658
+ }
659
+
660
+ this.nextSteptUserDialog = false;
661
+ this.flowInstDataDialog = false;
662
+
663
+ let type = this.flowBatchPendingDialog ? "batch" : "";
664
+ let currentNodeObj = this.flowNodeIdToInfo[this.currentInst.currentNode || this.draftNodeId] ||{};
665
+ let submitSuccessRusult;
666
+ if (type == 'batch') {
667
+ // 批量处理
668
+ let ref = "batchTableForm"+this.batchUpdateFormInfo.activeName+"Ref";
669
+ submitSuccessRusult=this.workFlowUtil.exeFlowEvent("nextStep","submitSuccess", this.currentInst.currentNode || this.draftNodeId,ref);
670
+ if(currentNodeObj.openEvent == '1'){
671
+ submitSuccessRusult = this.workFlowUtil.exeNewFlowEvent("nextSubmit",currentNodeObj.nodeLinkId||'',ref)
672
+ }
673
+ } else {
674
+ submitSuccessRusult=this.workFlowUtil.exeFlowEvent("nextStep","submitSuccess", this.currentInst.currentNode || this.draftNodeId);
675
+ if(currentNodeObj.openEvent == '1'){
676
+ submitSuccessRusult =this.workFlowUtil.exeNewFlowEvent("nextSubmit",currentNodeObj.nodeLinkId||'')
677
+ }
678
+ }
679
+ if(submitSuccessRusult){
680
+ //办结提醒
681
+ if(this.nextNode.nodeType == "EndEvent"){
682
+ let remindParam = {
683
+ instId:this.saveInstId,
684
+ flowId:this.flowDefine.id,
685
+ flowName:this.flowDefine.flowName,
686
+ formId:this.formId,
687
+ dataId:this.formInfo.dataId,
688
+ instType:"end"
689
+ };
690
+ this.saspFlowAxios.post(this.api.plFlowInst.saveRemind,remindParam);
691
+ }
692
+ }else{
693
+ console.log("脚本异常")
694
+ }
695
+
696
+
697
+ } else {
698
+ this.$message({type: "error", message: "保存失败!"});
699
+ this.isDisabled1 = true;
700
+ this.isDisabled['nextStep'] = true;
701
+ }
702
+ });
703
+ },
704
+ /**
705
+ * 确认执行人
706
+ */
707
+ sureNextUser() {
708
+ let checkedUserArr = this.$refs.orgPosUserRef.chooseUsers || [];
709
+ let userName = "";
710
+ let userId = "";
711
+ let arr = [];
712
+ let posUserIdArr = [];
713
+ checkedUserArr.forEach(item => {
714
+ userName += "," + item.dataLabel;
715
+ userId += "," + (item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
716
+ arr.push(item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
717
+ posUserIdArr.push(item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey);
718
+ });
719
+ if (userName) {
720
+ userName = userName.substring(1);
721
+ userId = userId.substring(1);
722
+ }
723
+ this.chooseNextUserName = userName;
724
+ this.chooseNextUserId = userId;
725
+ this.choosePosUserIds = posUserIdArr.join(",");
726
+ if(this.inclusiveChooseKey){
727
+ this.chooseNextUserNameObj[this.inclusiveChooseKey] = userName;
728
+ this.chooseNextUserIdObj[this.inclusiveChooseKey] = arr;
729
+ this.choosePosUserIdsObj[this.inclusiveChooseKey] = posUserIdArr.join(",");
730
+ }
731
+ this.sysOrgPosUserDialog = false;
732
+ },
733
+
734
+ /**
735
+ * 确认加签
736
+ */
737
+ sureCompleteSign() {
738
+ let checkedUserArr = this.$refs.completeSignRef.chooseUsers || [];
739
+ if (checkedUserArr.length === 0) {
740
+ this.$message({type: "error", message: "请选择加签人!"});
741
+ return;
742
+ }
743
+ let userIds = "";
744
+ checkedUserArr.forEach(item => {
745
+ userIds += "," + item.dataKey.startsWith("user_") ? item.dataKey.replace("user_", "") : item.dataKey;
746
+ });
747
+ this.disableSign = true;
748
+ this.saspFlowAxios.post(this.api.plFlowInst.completeSign, {
749
+ taskId: this.currentInst.taskId,
750
+ dealers: userIds.substring(1)
751
+ }).then(res => {
752
+ if (res && res.data && res.data.operateSuccess) {
753
+ this.completeSignDialog = false;
754
+ this.flowInstDataDialog = false;
755
+ this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
756
+ this.$message({type: "success", message: "加签成功!"});
757
+ this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
758
+ } else {
759
+ this.$message({type: "error", message: "加签失败!"});
760
+ }
761
+ this.disableSign = false;
762
+ });
763
+ },
764
+
765
+ /**
766
+ * 确认转签
767
+ */
768
+ sureTurnSign() {
769
+ let checkedUserArr = this.$refs.turnSignRef.chooseUsers || [];
770
+ if (checkedUserArr.length === 0) {
771
+ this.$message({type: "error", message: "请选择转签人!"});
772
+ return;
773
+ }
774
+ let userId = checkedUserArr[0].dataKey.startsWith("user_") ? checkedUserArr[0].dataKey.replace("user_", "") : checkedUserArr[0].dataKey;
775
+ this.disableSign = true;
776
+ this.saspFlowAxios.post(this.api.plFlowInst.turnSign, {
777
+ taskId: this.currentInst.taskId,
778
+ dealers: userId
779
+ }).then(res => {
780
+ if (res && res.data && res.data.operateSuccess) {
781
+ this.turnSignDialog = false;
782
+ this.flowInstDataDialog = false;
783
+ this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
784
+ this.$message({type: "success", message: "转签成功!"});
785
+ this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
786
+ } else {
787
+ this.$message({type: "error", message: "转签失败!"});
788
+ }
789
+ this.disableSign = false;
790
+ });
791
+
792
+ },
793
+
794
+ /**
795
+ * 执行退回
796
+ */
797
+ beginBack(){
798
+ if(!this.backNodeId){
799
+ this.$message.error("没有选择要退回的节点!");
800
+ return;
801
+ }
802
+ this.isDisabled2 = false;
803
+ this.saspFlowAxios.post(this.api.plFlowInst.skipToNode,
804
+ {"instId":this.currentInst.flowInstId,"skipNode":this.backNodeId,
805
+ "backMsg":this.backMsg,"skipStatus":"skip"}).then(res => {
806
+ if(res.data.operateSuccess){
807
+ this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
808
+ this.$message.success("退回成功!");
809
+ this.backDialogVisible = false;
810
+ this.isDisabled2 = true;
811
+ this.isDisabled['retSpecified'] = true;
812
+ this.flowInstDataDialog = false;
813
+ if (this.flowBatchPendingDialog) {
814
+ this.workFlowUtil.batchTabRemove && this.workFlowUtil.batchTabRemove(this.currentInst.dataId);
815
+ } else {
816
+ this.workFlowUtil.tabCrudSearch && this.workFlowUtil.tabCrudSearch();
817
+ }
818
+ this.workFlowUtil.initTabNum && this.workFlowUtil.initTabNum();
819
+ }else{
820
+ this.$message.error("退回失败!");
821
+ this.isDisabled['retSpecified'] = true;
822
+ }
823
+ })
824
+ },
825
+
826
+ /**
827
+ * 获取表单信息 start
828
+ * @returns {{}}
829
+ */
830
+ getFormInfo(){
831
+ let optFormData = {};
832
+ if(this.$refs.tableRef){
833
+ optFormData = this.$refs.tableRef.optFormData;
834
+ }
835
+ return optFormData;
836
+ },
837
+
838
+ /**
839
+ * 保存表单信息
840
+ */
841
+ saveFormInfo(type){
842
+ return new Promise(resolve => {
843
+ if(type === 'draft'){
844
+ let validate = this.$refs.tableRef.validateDraft();
845
+ if(!validate){
846
+ return;
847
+ }
848
+ }
849
+ this.$refs.tableRef.saveData().then(res => {
850
+ if(!res){
851
+ resolve(false);
852
+ return;
853
+ }
854
+ if(!res.formDataObj.flowSaveSuccess){
855
+ this.$message({
856
+ type:"warning",
857
+ message:"保存失败!"
858
+ });
859
+ resolve(false);
860
+ return;
861
+ }
862
+ let flowParams = res.formDataObj;
863
+ let fieldSysDataObj = this.$refs.tableRef.fieldSysDataObj;
864
+ this.getFieldInfo().then(() => {
865
+ let obj = {};
866
+ Object.keys(flowParams).forEach(key => {
867
+ let paramKey = this.formFieldObj[key] || key;
868
+ if(fieldSysDataObj[key]){ // 替换元数据
869
+ let value = flowParams[key];
870
+ obj[paramKey] = flowParams[key] || "";
871
+ if(value){
872
+ let valueKeyArr = [value];
873
+ if(value.indexOf(",") > -1){
874
+ valueKeyArr = value.split(",");
875
+ }
876
+ let valueArr = [];
877
+ valueKeyArr.forEach(item => {
878
+ valueArr.push(fieldSysDataObj[key][item]);
879
+ })
880
+ obj[paramKey + "_SASP_SYS_DATA"] = valueArr.join(",");
881
+ obj[key + "_SASP_SYS_DATA"] = valueArr.join(",");
882
+ obj[paramKey + "_SASP_SYS_DATA_ID"] = valueKeyArr.join(",");
883
+ obj[key + "_SASP_SYS_DATA_ID"] = valueKeyArr.join(",");
884
+ obj[paramKey] = valueArr.join(",");
885
+ obj[key] = valueArr.join(",");
886
+ }
887
+ }else{
888
+ obj[paramKey] = flowParams[key];
889
+ obj[key] = flowParams[key];
890
+ }
891
+ });
892
+ resolve(obj);
893
+ });
894
+ })
895
+ })
896
+ },
897
+
898
+ /**
899
+ * 获取字段信息
900
+ */
901
+ getFieldInfo(){
902
+ return new Promise(resolve => {
903
+ if(Object.keys(this.formFieldObj).length > 0 && !this.flowDefine.id.includes(",")){
904
+ resolve();
905
+ return;
906
+ }
907
+ if(!this.FORM_GLOBAL){
908
+ this.$message.error("请先安装表单组件或使用自定义表单!");
909
+ resolve();
910
+ return;
911
+ }
912
+ this.FORM_GLOBAL.getFormFields(this.formId).then(res => {
913
+ this.formFieldObj = {};
914
+ (res || []).forEach(item => {
915
+ this.formFieldObj[item.id] = item.phyfieldName;
916
+ });
917
+ // this.formAboutInfoObj["formFieldObj"] = this.formFieldObj;
918
+ resolve();
919
+ });
920
+ });
921
+ },
922
+
923
+ /**
924
+ * 初始化表单信息
925
+ */
926
+ initFormInfo(type,dataId,fieldOperate,flowInstData){
927
+ flowInstData = flowInstData || {};
928
+ return new Promise(resolve => {
929
+ this.formOperate = type;
930
+ this.dataId = dataId;
931
+ this.getFieldDefaultVal(fieldOperate,flowInstData.flowStatus).then(() => {
932
+ this.$nextTick(() => {
933
+ this.$refs.tableRef.loadData().then(() => {
934
+ resolve();
935
+ })
936
+ })
937
+ })
938
+ })
939
+ },
940
+
941
+ getFieldDefaultVal(fieldOperate,flowStatus){
942
+ return new Promise(resolve => {
943
+ this.flowFieldStatus = {};
944
+ this.fieldDefaultVal = {}; //初始化可编辑状态和默认值
945
+ let orgChargeField = [];
946
+ let supervisorField = [];
947
+ // let levels = "";
948
+ Object.keys(fieldOperate).forEach(field => {
949
+ let fieldObj = fieldOperate[field];
950
+ if(flowStatus!='4'){
951
+ if (fieldObj.edit == "1") {//可编辑
952
+ this.flowFieldStatus[field] = "edit";
953
+ } else if (fieldObj.hide == "1") {//不可见
954
+ this.flowFieldStatus[field] = "hide";
955
+ }
956
+ }
957
+ let defaultValType = fieldObj.defaultValType;
958
+ let defaultVal = fieldObj.defaultVal;
959
+ let dateTimeType = fieldObj.dateTimeType;
960
+ if (defaultVal) {
961
+ if (defaultValType == "sysData") {
962
+ this.fieldDefaultVal[field] = defaultVal[defaultVal.length - 1];
963
+ } else if (defaultValType == "formInfo"){
964
+ this.fieldDefaultVal[field] = "&&," + defaultVal + ",&&";
965
+ } else if (defaultValType == "diyVal" || (defaultValType == "dateTime" && dateTimeType == "diyTime")) {
966
+ this.fieldDefaultVal[field] = defaultVal;
967
+ } else {
968
+ if (defaultVal.indexOf("LOGINUSER") > -1) {
969
+ this.fieldDefaultVal[field] = Replace.def(this.loginUser, defaultVal);
970
+ } else {
971
+ this.fieldDefaultVal[field] = Replace.def(this.userDept, defaultVal);
972
+ }
973
+ }
974
+ }
975
+ //时间
976
+ if(defaultValType == "dateTime" && dateTimeType == "sysTime"){
977
+ let time = "";
978
+ let dateTimeFormat = fieldObj.dateTimeFormat || "yyyy-MM-dd";
979
+ let specialDate = fieldObj.specialDate;
980
+ let specialOpt = fieldObj.specialOpt;
981
+ let specialVal = fieldObj.specialVal;
982
+ if(specialDate && specialOpt && specialVal){
983
+ time = this.DATE_UTIL.timeConversion(new Date(),dateTimeFormat,specialDate,specialOpt,specialVal);
984
+ }else{
985
+ time = this.DATE_UTIL.formaterDateOrTime(new Date(),dateTimeFormat);
986
+ }
987
+ this.fieldDefaultVal[field] = time;
988
+ }
989
+
990
+ if(defaultValType == "dateTime" && dateTimeType == "formField"){
991
+ this.flowFieldDefaultFromForm[field] = fieldObj;
992
+ }
993
+
994
+
995
+ //处理人上级
996
+ let dealerLeaderType = fieldObj.dealerLeaderType;
997
+ if(dealerLeaderType){
998
+ if(dealerLeaderType == "1"){
999
+ orgChargeField.push(field);
1000
+ }else{
1001
+ supervisorField.push({field:field,level:fieldObj.leaderLevel})
1002
+ // levels += "," + fieldObj.leaderLevel;
1003
+ }
1004
+ }
1005
+ this.fieldDefaultValChangeNum[field] = fieldObj.changeNum;
1006
+ });
1007
+ this.getDefaultUser(orgChargeField,supervisorField,resolve);
1008
+ })
1009
+ },
1010
+
1011
+ getDefaultUser(orgChargeField,supervisorField,resolve){
1012
+ if(orgChargeField.length > 0 && supervisorField.length > 0){
1013
+ this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getDeptSupervisor",
1014
+ {loginUserId:this.loginUser.id}).then(res => {
1015
+ if(res && res.data){
1016
+ let userId = (res.data[0] || {}).id;
1017
+ orgChargeField.forEach(fieldId => {
1018
+ this.fieldDefaultVal[fieldId] = userId || "";
1019
+ });
1020
+ }
1021
+
1022
+ this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
1023
+ {loginUserId:this.loginUser.id}).then(res => {
1024
+ if(res && res.data){
1025
+ let userIdMap = res.data || {};
1026
+ supervisorField.forEach(item => {
1027
+ this.fieldDefaultVal[item.field] = userIdMap[item.level] || "";
1028
+ });
1029
+ resolve(true);
1030
+ }
1031
+ });
1032
+ });
1033
+ }else if(orgChargeField.length > 0){
1034
+ this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
1035
+ {loginUserId:this.loginUser.id}).then(res => {
1036
+ if (res && res.data) {
1037
+ let userId = (res.data[0] || {}).id;
1038
+ orgChargeField.forEach(fieldId => {
1039
+ this.fieldDefaultVal[fieldId] = userId || "";
1040
+ });
1041
+ resolve(true);
1042
+ }
1043
+ });
1044
+ }else if(supervisorField.length > 0){
1045
+ this.saspFlowAxios.post(window.FLOW_RENDER_URL + "/plFlowInterfaceController/getSupervisor",
1046
+ {loginUserId:this.loginUser.id}).then(res => {
1047
+ if(res && res.data){
1048
+ let userIdMap = res.data || {};
1049
+ supervisorField.forEach(item => {
1050
+ this.fieldDefaultVal[item.field] = userIdMap[item.level] || "";
1051
+ });
1052
+ resolve(true);
1053
+ }
1054
+ });
1055
+ }else{
1056
+ resolve(true);
1057
+ }
1058
+ },
1059
+
1060
+ // 表单操作end
1061
+
1062
+ /**
1063
+ * 关闭下一步执行人弹窗
1064
+ */
1065
+ closeNextSteptUserDialog() {
1066
+ this.nextSteptUserDialog = false;
1067
+ this.isDisabled['nextStep'] = true;
1068
+ },
1069
+
1070
+ // 自定义按钮窗口回调函数
1071
+ openDiyButtonEvent(type,row, button) {
1072
+ this.workFlowUtil.openDiyButtonEvent(type,row,button);
1073
+ },
1074
+
1075
+ judeDiyButton(tabActive,button) {
1076
+ return this.workFlowUtil.judeDiyButton(tabActive,button);
1077
+ },
1078
+
1079
+ open(){
1080
+ this.nextSteptUserDialog = true;
1081
+ },
1082
+ }
1083
+ };
1084
+ </script>
1085
+
1086
+ <style scoped>
1087
+
1088
+ </style>