@lambo-design/workflow-approve 1.0.0-beta.92 → 1.0.0-beta.94

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.
package/index.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import WorkflowHorizontalApprove from "./src/horizontal";
2
2
  import WorkflowPortraitApprove from "./src/portrait";
3
3
  import WorkflowDiagram from "./src/workflow-diagram";
4
+ import { WorkflowOperationButtons, WorkflowInfoButtons } from "./src/utils/const";
4
5
 
5
6
  export {
6
7
  WorkflowHorizontalApprove,
7
8
  WorkflowPortraitApprove,
8
- WorkflowDiagram
9
+ WorkflowDiagram,
10
+ WorkflowOperationButtons,
11
+ WorkflowInfoButtons
9
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.92",
3
+ "version": "1.0.0-beta.94",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -12,8 +12,8 @@
12
12
  "devDependencies": {
13
13
  "axios": "^0.24.0",
14
14
  "axios-cache-plugin": "^0.1.0",
15
- "@lambo-design/core": "^4.7.1-beta.168",
16
- "@lambo-design/shared": "^1.0.0-beta.295"
15
+ "@lambo-design/shared": "^1.0.0-beta.297",
16
+ "@lambo-design/core": "^4.7.1-beta.169"
17
17
  },
18
18
  "dependencies": {
19
19
  "bpmn-js": "^7.3.1",
@@ -11,8 +11,8 @@
11
11
  </div>
12
12
  </div>
13
13
  <div class="org-detil">
14
- <LamboPagingTable ref="selection" :data="tableData" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams"
15
- @on-selection-change="onSelectionChange" :page-disable="useTransferRangeUsers" :showTableOption="!useTransferRangeUsers">
14
+ <LamboPagingTable ref="selection" highlight-row :data="tableData" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams"
15
+ @on-selection-change="onSelectionChange" @on-current-change="onCurrentChange" :page-disable="useTransferRangeUsers" :showTableOption="!useTransferRangeUsers">
16
16
  <div slot="search" v-if="!useTransferRangeUsers">
17
17
  <Form :label-width="60">
18
18
  <Row>
@@ -139,13 +139,16 @@ export default {
139
139
  tableColumn () {
140
140
  let columns = []
141
141
  let self = this
142
- columns.push({
143
- title: '#',
144
- key: 'selectId',
145
- type: 'selection',
146
- align: 'center',
147
- width: 55
148
- })
142
+ // 加签/选择候选人可多选
143
+ if (this.helpBoxType === 'addMultitaskInstance' || this.helpBoxType === 'appointHandlerWithCandGroups'){
144
+ columns.push({
145
+ title: '#',
146
+ key: 'selectId',
147
+ type: 'selection',
148
+ align: 'center',
149
+ width: 55
150
+ })
151
+ }
149
152
  columns.push({
150
153
  title: '账号',
151
154
  key: 'userId',
@@ -338,15 +341,21 @@ export default {
338
341
  doSearch: function () {
339
342
  this.tableSearchParams = Object.assign({}, this.form)
340
343
  },
344
+ // 加签、选择下一环节候选人
341
345
  onSelectionChange: function (selection) {
342
346
  let self = this
343
- // self.idSelectedArr = []
344
- if (self.helpBoxType !== 'addMultitaskInstance' && self.helpBoxType !== 'appointHandlerWithCandGroups' && selection.length > 1) {
345
- self.$Message.info('只能选择一条记录!')
346
- this.$refs.selection.selectAll(false);
347
+ if (self.helpBoxType === 'addMultitaskInstance' || self.helpBoxType === 'appointHandlerWithCandGroups') {
348
+ for (let item of selection) {
349
+ self.idSelectedArr.push(item.userId + ',' + item.userName)
350
+ }
347
351
  }
348
- for (let item of selection) {
349
- self.idSelectedArr.push(item.userId + ',' + item.userName)
352
+ },
353
+ // 转办、委派、选择下一环节办理人
354
+ onCurrentChange(selection) {
355
+ let self = this
356
+ if (self.helpBoxType !== 'addMultitaskInstance' && self.helpBoxType !== 'appointHandlerWithCandGroups') {
357
+ self.idSelectedArr = []
358
+ self.idSelectedArr.push(selection.userId + ',' + selection.userName)
350
359
  }
351
360
  },
352
361
  loadData (node, callback) {
@@ -239,7 +239,7 @@ export default {
239
239
  //组件宽度
240
240
  portraitWidth: {
241
241
  type: Number,
242
- default: 0
242
+ default: 400
243
243
  },
244
244
  //是否显示竖向布局
245
245
  inHorizontal: {
package/src/portrait.vue CHANGED
@@ -100,7 +100,7 @@
100
100
  </a>
101
101
  <transition style="position: relative; overflow-x: hidden" v-if="showProcessInfo && !inHorizontal" name="draw" @before-enter="beforeFlowInfoEnter" @enter="flowInfoEnter"
102
102
  @before-leave="beforeFlowInfoLeave" @leave="flowInfoLeave">
103
- <lamboIndicatorCard v-show="isExpanded" class="portrait-lambo-indicator-card"
103
+ <LamboIndicatorCard v-show="isExpanded" class="portrait-lambo-indicator-card"
104
104
  :style="{width: portraitWidth + 'px', right: '0', ...pageContainerWithoutPadding}" :hasExtend="false">
105
105
  <div slot="content-title">流程信息</div>
106
106
  <ProcessInfo ref="processInfo"
@@ -119,7 +119,7 @@
119
119
  :portrait-width="portraitWidth"
120
120
  :smart-flow-server-context="smartFlowServerContext"
121
121
  @upload-file="uploadFile"/>
122
- </lamboIndicatorCard>
122
+ </LamboIndicatorCard>
123
123
  </transition>
124
124
 
125
125
  <!-- 节点跳转选择弹框 -->
@@ -275,7 +275,7 @@
275
275
  :key="button.id"
276
276
  style="margin-left: 10px;"
277
277
  v-if="button.condition"
278
- :disabled="button.disabled || disable"
278
+ :disabled="button.disabled"
279
279
  :loading="loading"
280
280
  :type="button.type || 'default'"
281
281
  @click="button.action"
@@ -301,7 +301,7 @@ import CandidateGroupsHelpBox from './components/candidate-groups-box'
301
301
  import CountersingersBox from './components/countersigners-box'
302
302
  import { timestampToTime } from '@lambo-design/shared/utils/date'
303
303
  import ProcessInfo from './components/process-info'
304
- import { nodeType } from './utils/const'
304
+ import { NodeType } from './utils/const'
305
305
 
306
306
  export default {
307
307
  props: {
@@ -332,23 +332,59 @@ export default {
332
332
  required: false,
333
333
  default: '',
334
334
  },
335
+ //业务表单保存方法
336
+ businessFormSave: {
337
+ type: Function,
338
+ required: false
339
+ },
340
+ //按钮执行完毕回调方法
341
+ executionCompleted: {
342
+ type: Function,
343
+ required: false,
344
+ default: () => {}
345
+ },
346
+ smartFlowServerContext: {
347
+ type: String,
348
+ default: '/api/smart-flow-server',
349
+ },
350
+ upmsServerContext: {
351
+ type: String,
352
+ default: '/api/upms-server',
353
+ },
354
+ //标题
355
+ title: {
356
+ type: String,
357
+ default: '流程办理'
358
+ },
359
+ //审批人来源
335
360
  auditGroup: {
336
361
  type: String,
337
362
  required: false,
338
363
  default: '',
339
364
  },
365
+ //默认审批意见
340
366
  defaultAuditOpinion: {
341
367
  type: String,
342
368
  required: false,
343
369
  default: '',
344
370
  },
345
- //详情页催办按钮
371
+ //是否显示竖向布局
372
+ inHorizontal: {
373
+ type: Boolean,
374
+ default: false
375
+ },
376
+ //强制不展示的流程操作按钮
377
+ displayedOperButton: {
378
+ type: Array,
379
+ default: () => ([])
380
+ },
381
+ //是否展示详情页催办按钮
346
382
  pushButton: {
347
383
  type: Boolean,
348
384
  required: false,
349
385
  default: true,
350
386
  },
351
- //流程跟踪图附件列
387
+ //是否展示流程跟踪图附件列
352
388
  showAttachmentFile: {
353
389
  type: Boolean,
354
390
  required: false,
@@ -360,40 +396,11 @@ export default {
360
396
  required: false,
361
397
  default: 'click',
362
398
  },
363
- //业务表单保存方法
364
- businessFormSave: {
365
- type: Function,
366
- required: false
367
- },
368
- //按钮执行完毕回调方法
369
- executionCompleted: {
370
- type: Function,
371
- required: false,
372
- default: () => {
373
- }
374
- },
375
- //是否显示竖向布局
376
- inHorizontal: {
377
- type: Boolean,
378
- default: false
379
- },
380
- title: {
381
- type: String,
382
- default: '流程办理'
383
- },
384
399
  //流程跟踪图以tab形式展示
385
400
  processTraceInTab: {
386
401
  type: Boolean,
387
402
  default: false
388
403
  },
389
- smartFlowServerContext: {
390
- type: String,
391
- default: '/api/smart-flow-server',
392
- },
393
- upmsServerContext: {
394
- type: String,
395
- default: '/api/upms-server',
396
- },
397
404
  },
398
405
  components: {
399
406
  Title,
@@ -471,7 +478,7 @@ export default {
471
478
  appointTask: false,
472
479
  instanceId: '',
473
480
  curTaskId: '',
474
- curNodeType: nodeType.userTask,
481
+ curNodeType: NodeType.UserTask,
475
482
  handleButtons: [],
476
483
  handleName: '审批',
477
484
  passName: '通过',
@@ -573,6 +580,7 @@ export default {
573
580
  position: 'absolute',
574
581
  top: `${top}px`,
575
582
  height: `calc(100% - ${top + this.footerHeight}px)`,
583
+ minHeight: `calc(100% - ${top + this.footerHeight}px)`,
576
584
  }
577
585
  return style
578
586
  },
@@ -582,96 +590,112 @@ export default {
582
590
  {
583
591
  id: 'auditTo70',
584
592
  label: `${this.rejectName}到原点`,
585
- condition: this.handleButtons?.includes('auditTo70') && showButtons,
586
- action: () => this.audit('70')
593
+ condition: this.handleButtons?.includes('auditTo70') && !this.displayedOperButton.includes('auditTo70') && showButtons,
594
+ action: () => this.audit('70'),
595
+ disabled: this.disable
587
596
  },
588
597
  {
589
598
  id: 'auditTo40',
590
599
  label: `${this.rejectName}上一节点`,
591
- condition: this.handleButtons?.includes('auditTo40') && showButtons,
592
- action: () => this.audit('40')
600
+ condition: this.handleButtons?.includes('auditTo40') && !this.displayedOperButton.includes('auditTo40') && showButtons,
601
+ action: () => this.audit('40'),
602
+ disabled: this.disable
593
603
  },
594
604
  {
595
605
  id: 'auditTo90',
596
606
  label: `${this.rejectName}指定节点`,
597
- condition: this.handleButtons?.includes('auditTo90') && showButtons,
598
- action: () => this.audit('90')
607
+ condition: this.handleButtons?.includes('auditTo90') && !this.displayedOperButton.includes('auditTo90') && showButtons,
608
+ action: () => this.audit('90'),
609
+ disabled: this.disable
599
610
  },
600
611
  {
601
612
  id: 'auditTo80',
602
613
  label: '跳转指定节点',
603
- condition: this.handleButtons?.includes('auditTo80') && showButtons,
604
- action: () => this.audit('80')
614
+ condition: this.handleButtons?.includes('auditTo80') && !this.displayedOperButton.includes('auditTo80') && showButtons,
615
+ action: () => this.audit('80'),
616
+ disabled: this.disable
605
617
  },
606
618
  {
607
619
  id: 'auditTo82',
608
620
  label: '指定他人处理',
609
- condition: this.handleButtons?.includes('auditTo82') && showButtons,
610
- action: () => this.audit('82')
621
+ condition: this.handleButtons?.includes('auditTo82') && !this.displayedOperButton.includes('auditTo82') && showButtons,
622
+ action: () => this.audit('82'),
623
+ disabled: this.disable
611
624
  },
612
625
  {
613
626
  id: 'delegateTask',
614
627
  label: '委派',
615
- condition: this.curNodeType === nodeType.userTask &&
616
- this.handleButtons?.includes('delegateTask') &&
628
+ condition: this.curNodeType === NodeType.UserTask &&
629
+ this.handleButtons?.includes('delegateTask') &&
630
+ !this.displayedOperButton.includes('delegateTask') &&
617
631
  showButtons,
618
- action: () => this.audit('84')
632
+ action: () => this.audit('84'),
633
+ disabled: this.disable
619
634
  },
620
635
  {
621
636
  id: 'addMultitaskInstance',
622
637
  label: '加签',
623
- condition: this.curNodeType === nodeType.multiNode &&
638
+ condition: this.curNodeType === NodeType.MultiNode &&
624
639
  this.handleButtons?.includes('addMultitaskInstance') &&
640
+ !this.displayedOperButton.includes('addMultitaskInstance') &&
625
641
  showButtons,
626
- action: () => this.showUpdateMultitaskInstanceModal('81')
642
+ action: () => this.showUpdateMultitaskInstanceModal('81'),
643
+ disabled: this.disable
627
644
  },
628
645
  {
629
646
  id: 'reductionMultitaskInstance',
630
647
  label: '减签',
631
- condition: this.curNodeType === nodeType.multiNode &&
648
+ condition: this.curNodeType === NodeType.MultiNode &&
632
649
  this.handleButtons?.includes('reductionMultitaskInstance') &&
650
+ !this.displayedOperButton.includes('reductionMultitaskInstance') &&
633
651
  showButtons,
634
- action: () => this.showUpdateMultitaskInstanceModal('83')
652
+ action: () => this.showUpdateMultitaskInstanceModal('83'),
653
+ disabled: this.disable
635
654
  },
636
655
  {
637
656
  id: 'auditTo50',
638
657
  label: '直接结束流程',
639
- condition: this.handleButtons?.includes('auditTo50') && showButtons,
640
- action: () => this.audit('50')
658
+ condition: this.handleButtons?.includes('auditTo50') && !this.displayedOperButton.includes('auditTo50') && showButtons,
659
+ action: () => this.audit('50'),
660
+ disabled: this.disable
641
661
  },
642
662
  {
643
663
  id: 'processTrace',
644
664
  label: '流程跟踪图',
645
- condition: this.handleButtons?.includes('processTrace') && !this.processTraceInTab,
646
- action: () => this.processPrint()
665
+ condition: this.handleButtons?.includes('processTrace') && !this.displayedOperButton.includes('processTrace') && !this.processTraceInTab,
666
+ action: () => this.processPrint(),
667
+ disabled: this.disable
647
668
  },
648
669
  {
649
670
  id: 'auditTo30',
650
671
  label: this.passName,
651
- condition: this.handleButtons?.includes('auditTo30') && !this.isDetail && !this.appointTask,
672
+ condition: this.handleButtons?.includes('auditTo30') && !this.displayedOperButton.includes('auditTo30') && !this.isDetail && !this.appointTask,
652
673
  action: () => this.audit('30'),
653
- type: 'primary'
674
+ type: 'primary',
675
+ disabled: this.disable
654
676
  },
655
677
  {
656
678
  id: 'passContinue',
657
679
  label: `${this.passName}并继续`,
658
- condition: this.handleButtons?.includes('passContinue') && !this.isDetail && !this.appointTask,
680
+ condition: this.handleButtons?.includes('passContinue') && !this.displayedOperButton.includes('passContinue') && !this.isDetail && !this.appointTask,
659
681
  action: () => this.passContinueAudit(),
660
- type: 'primary'
682
+ type: 'primary',
683
+ disabled: this.disable
661
684
  },
662
685
  {
663
686
  id: 'revokeDelegateTask',
664
687
  label: '撤回委派',
665
- condition: this.revokeDelegateTask,
688
+ condition: this.revokeDelegateTask && !this.displayedOperButton.includes('revokeDelegateTask'),
666
689
  action: () => this.audit('62'),
667
690
  disabled: !this.revokeDelegateTask
668
691
  },
669
692
  {
670
693
  id: 'appointTask',
671
694
  label: '交回',
672
- condition: this.appointTask,
695
+ condition: this.appointTask && !this.displayedOperButton.includes('appointTask'),
673
696
  action: () => this.audit('61'),
674
- type: 'primary'
697
+ type: 'primary',
698
+ disabled: this.disable
675
699
  }
676
700
  ];
677
701
  },
@@ -879,6 +903,9 @@ export default {
879
903
  } else if (row.auditResult == '62') {
880
904
  label = '委派任务被撤回'
881
905
  tagColor = 'blue' // 蓝色
906
+ } else if (row.auditResult == '63') {
907
+ label = '委派任务'
908
+ tagColor = 'green' // 绿色
882
909
  } else if (row.auditResult == '80') {
883
910
  label = '跳转到指定节点'
884
911
  tagColor = 'cyan' // 青色
@@ -1168,7 +1195,7 @@ export default {
1168
1195
  if (resp.data.code === '200') {
1169
1196
  self.handleButtons = resp.data.data[0].handleButtons ? resp.data.data[0].handleButtons : ["processTrace","auditHistory","auditOpinion","attachmentFile","auditTo30","auditTo70","auditTo40","auditTo90","auditTo80","auditTo82","auditTo50"];
1170
1197
  if (resp.data.data[0].hasOwnProperty('isSequential')) {
1171
- self.curNodeType = resp.data.data[0].isSequential ? nodeType.sequentialMultiNode : nodeType.multiNode;
1198
+ self.curNodeType = resp.data.data[0].isSequential ? NodeType.SequentialMultiNode : NodeType.MultiNode;
1172
1199
  }
1173
1200
  self.handleName = resp.data.data[0].handleName ? resp.data.data[0].handleName : '审批';
1174
1201
  self.rejectName = resp.data.data[0].rejectName ? resp.data.data[0].rejectName : '驳回';
@@ -1407,7 +1434,7 @@ export default {
1407
1434
  self.businessFormSave ? self.businessFormSave(self.handleSaveResult, auditResult) : self.handleSaveResult(true)
1408
1435
  return
1409
1436
  }
1410
- if ((!self.handleButtons || self.handleButtons.includes('auditOpinion')) && self.auditResult !== '84') {
1437
+ if ((!self.handleButtons || self.handleButtons.includes('auditOpinion')) && self.auditResult !== '84' && self.auditResult !== '62') {
1411
1438
  self.$Message.error(`请输入${self.handleName}意见!`)
1412
1439
  return
1413
1440
  } else {
@@ -1,89 +1,36 @@
1
- export const nodeType = {
2
- userTask: 'userTask',
3
- multiNode: 'multiNode',
4
- sequentialMultiNode: 'sequentialMultiNode'
1
+ export const NodeType = {
2
+ UserTask: 'userTask',
3
+ MultiNode: 'multiNode',
4
+ SequentialMultiNode: 'sequentialMultiNode'
5
5
  }
6
6
 
7
- export const handleButtons = {
8
- //流程信息按钮
9
- processTrace: {
10
- id: 'processTrace',
11
- name: '流程跟踪图',
12
- },
13
- auditHistory: {
14
- id: 'auditHistory',
15
- name: '审批历史',
16
- },
17
- auditOpinion: {
18
- id: 'auditOpinion',
19
- name: '处理意见',
20
- },
21
- attachmentFile: {
22
- id: 'attachmentFile',
23
- name: '上传附件',
24
- },
25
- //流程操作按钮
26
- auditTo30: {
27
- id: 'auditTo30',
28
- name: '同意',
29
- auditResult: '30',
30
- },
31
- auditTo70: {
32
- id: 'auditTo70',
33
- name: '驳回原点',
34
- auditResult: '70',
35
- },
36
- auditTo40: {
37
- id: 'auditTo40',
38
- name: '驳回上一节点',
39
- auditResult: '40',
40
- },
41
- auditTo90: {
42
- id: 'auditTo90',
43
- name: '驳回指定节点',
44
- auditResult: '90',
45
- },
46
- auditTo80: {
47
- id: 'auditTo80',
48
- name: '跳转指定节点',
49
- auditResult: '80',
50
- },
51
- auditTo82: {
52
- id: 'auditTo82',
53
- name: '转办',
54
- auditResult: '82',
55
- },
56
- auditTo50: {
57
- id: 'auditTo50',
58
- name: '人工终止',
59
- auditResult: '50',
60
- },
61
- delegateTask: {
62
- id: 'delegateTask',
63
- name: '委派',
64
- auditResult: 'delegateTask',
65
- },
66
- addMultitaskInstance: {
67
- id: 'addMultitaskInstance',
68
- name: '加签',
69
- auditResult: 'addMultitaskInstance',
70
- },
71
- reductionMultitaskInstance: {
72
- id: 'reductionMultitaskInstance',
73
- name: '减签',
74
- auditResult: 'reductionMultitaskInstance',
75
- },
76
- //后续操作按钮
77
- rejectProcessControl: {
78
- id: 'rejectProcessControl',
79
- name: '允许驳回时控制流转',
80
- },
81
- appointHandler: {
82
- id: 'appointHandler',
83
- name: '指定下一环节的办理人',
84
- },
85
- appointTimeoutTime: {
86
- id: 'appointTimeoutTime',
87
- name: '指定下一环节办理时限(含预警时间)',
88
- },
7
+ // 流程信息按钮
8
+ export const WorkflowInfoButtons = {
9
+ ProcessTrace: 'processTrace',// 流程跟踪图
10
+ AuditHistory: 'auditHistory',// 审批历史
11
+ AuditOpinion: 'auditOpinion',// 审批意见
12
+ AttachmentFile: 'attachmentFile',// 附件
13
+ }
14
+
15
+ // 流程操作按钮
16
+ export const WorkflowOperationButtons = {
17
+ AuditTo30: 'auditTo30',// 通过
18
+ AuditTo70: 'auditTo70',// 驳回原点
19
+ AuditTo40: 'auditTo40',// 驳回上一节点
20
+ AuditTo90: 'auditTo90',// 驳回指定节点
21
+ AuditTo80: 'auditTo80',// 跳转指定节点
22
+ AuditTo82: 'auditTo82',// 转办
23
+ AuditTo50: 'auditTo50',// 人工终止
24
+ DelegateTask: 'delegateTask',// 委派
25
+ RevokeDelegateTask: 'revokeDelegateTask',// 撤回委派
26
+ AppointTask: 'appointTask',// 交回委派
27
+ AddMultitaskInstance: 'addMultitaskInstance',// 会签加签
28
+ ReductionMultitaskInstance: 'reductionMultitaskInstance',// 会签减签
29
+ }
30
+
31
+ // 流程流转控制按钮
32
+ export const WorkflowControlButtons = {
33
+ RejectProcessControl: 'rejectProcessControl',// 允许驳回时控制流转
34
+ AppointHandler: 'appointHandler',// 指定下一环节的办理人
35
+ AppointTimeoutTime: 'appointTimeoutTime',// 指定下一环节办理时限(含预警时间)
89
36
  }