@lambo-design/workflow-approve 1.0.0-beta.55 → 1.0.0-beta.57

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/src/portrait.vue CHANGED
@@ -205,11 +205,11 @@
205
205
  </Modal>
206
206
  <assigneeBox ref="assigneeHelpBox" :execution-completed="executionCompleted"
207
207
  @update-selected="handleSelectedUser" @update-next-node-assignee="updateNextNodeAssignee"
208
- @add-multitask-instance="addMultitaskInstance"
208
+ @add-multitask-instance="addMultitaskInstance" @delegate-task-assignee="delegateTask"
209
209
  :data="assigneeBoxData" :smart-flow-server-context="smartFlowServerContext"
210
210
  :upms-server-context="upmsServerContext"/>
211
- <Modal v-model="modalBoxShow" width="1000" title="流程跟踪图">
212
- <Workflow_Diagram ref="processTrace" :instanceId="process.instanceId" :applyId="process.applyId"
211
+ <Modal ref="processTraceModal" v-model="modalBoxShow" width="1000" title="流程跟踪图" @scroll="handleScroll">
212
+ <Workflow_Diagram ref="processTrace" @scroll="handleScroll" :instanceId="process.instanceId" :applyId="process.applyId"
213
213
  :procId="process.procId" :table-columns="diagramTableColumns"
214
214
  :tableData="process.tableData" :hisAudit="hisAudit"
215
215
  :approve-detail-show-way="approveDetailShowWay"
@@ -318,38 +318,46 @@
318
318
  <template slot="page-footer">
319
319
  <div>
320
320
  <slot name="footer-button"></slot>
321
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo70') && !isDetail"
321
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo70') && !isDetail && !appointTask"
322
322
  :disabled="disable" :loading="loading" @click="audit('70')">驳回到原点
323
323
  </Button>
324
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo40') && !isDetail"
324
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo40') && !isDetail && !appointTask"
325
325
  :disabled="disable" :loading="loading" @click="audit('40')">驳回上一节点
326
326
  </Button>
327
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo90') && !isDetail"
327
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo90') && !isDetail && !appointTask"
328
328
  :disabled="disable" :loading="loading" @click="audit('90')">驳回指定节点
329
329
  </Button>
330
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo80') && !isDetail"
330
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo80') && !isDetail && !appointTask"
331
331
  :disabled="disable" :loading="loading" @click="audit('80')">跳转指定节点
332
332
  </Button>
333
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo82') && !isDetail"
333
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo82') && !isDetail && !appointTask"
334
334
  :disabled="disable" :loading="loading" @click="audit('82')">指定他人处理
335
335
  </Button>
336
336
  <Button style="margin-left: 10px;"
337
- v-if="isParallelCountersignature && handleButtons && handleButtons.includes('addMultitaskInstance') && !isDetail"
337
+ v-if="curNodeType === 'userTask' && handleButtons && handleButtons.includes('delegateTask') && !isDetail && !appointTask"
338
+ :disabled="disable" :loading="loading" @click="audit('84')">委派
339
+ </Button>
340
+ <Button style="margin-left: 10px;"
341
+ v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('addMultitaskInstance') && !isDetail && !appointTask"
338
342
  :disabled="disable" :loading="loading" @click="showUpdateMultitaskInstanceModal('81')">加签
339
343
  </Button>
340
344
  <Button style="margin-left: 10px;"
341
- v-if="isParallelCountersignature && handleButtons && handleButtons.includes('reductionMultitaskInstance') && !isDetail"
345
+ v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('reductionMultitaskInstance') && !isDetail && !appointTask"
342
346
  :disabled="disable" :loading="loading" @click="showUpdateMultitaskInstanceModal('83')">减签
343
347
  </Button>
344
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo50') && !isDetail"
348
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo50') && !isDetail && !appointTask"
345
349
  :disabled="disable" :loading="loading" @click="audit('50')">直接结束流程
346
350
  </Button>
347
351
  <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('processTrace')"
348
352
  @click="processPrint">流程跟踪图
349
353
  </Button>
350
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo30') && !isDetail"
354
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo30') && !isDetail && !appointTask"
351
355
  :disabled="disable" :loading="loading" type="primary" @click="audit('30')">通过
352
356
  </Button>
357
+ <Button style="margin-left: 10px;" v-if="revokeDelegateTask"
358
+ :disabled="!revokeDelegateTask && disable" :loading="loading" @click="audit('62')">撤回委派
359
+ </Button>
360
+ <Button style="margin-left: 10px;" v-if="appointTask" :disabled="disable" :loading="loading" type="primary" @click="audit('61')">交回</Button>
353
361
  </div>
354
362
  </template>
355
363
  </LamboPageContainer>
@@ -514,9 +522,11 @@ export default {
514
522
  },
515
523
  loading: false,
516
524
  disable: false,
525
+ revokeDelegateTask: false,
526
+ appointTask: false,
517
527
  instanceId: '',
518
528
  curTaskId: '',
519
- isParallelCountersignature: false,
529
+ curNodeType: 'userTask',
520
530
  handleButtons: [],
521
531
  handleName: '',
522
532
  auditOpinionTitle: '',
@@ -554,7 +564,10 @@ export default {
554
564
  '90': '驳回指定节点',
555
565
  '80': '跳转指定节点',
556
566
  '82': '指定他人处理',
557
- '50': '直接结束流程'
567
+ '50': '直接结束流程',
568
+ '84': '委派任务',
569
+ '61': '交回委派任务',
570
+ '62': '撤回委派任务',
558
571
  },
559
572
  handleTypeList: [
560
573
  {
@@ -649,6 +662,22 @@ export default {
649
662
  }
650
663
  }, '已撤回')
651
664
  ])
665
+ } else if (params.row.auditResult == '61' && params.row.taskNode != this.taskNode) {
666
+ return h('div', [
667
+ h('tag', {
668
+ props: {
669
+ color: '#19be6b'
670
+ }
671
+ }, '已交回委派任务')
672
+ ])
673
+ } else if (params.row.auditResult == '62' && params.row.taskNode != this.taskNode) {
674
+ return h('div', [
675
+ h('tag', {
676
+ props: {
677
+ color: '#ed4014'
678
+ }
679
+ }, '委派任务已撤回')
680
+ ])
652
681
  } else if (params.row.auditResult == '80' && params.row.taskNode != this.taskNode) {
653
682
  return h('div', [
654
683
  h('tag', {
@@ -730,6 +759,12 @@ export default {
730
759
  } else if (row.auditResult == '60') {
731
760
  label = '撤回'
732
761
  tagColor = 'blue' // 蓝色
762
+ } else if (row.auditResult == '61') {
763
+ label = '交回委派任务'
764
+ tagColor = 'green' // 绿色
765
+ } else if (row.auditResult == '62') {
766
+ label = '委派任务被撤回'
767
+ tagColor = 'blue' // 蓝色
733
768
  } else if (row.auditResult == '80') {
734
769
  label = '跳转到指定节点'
735
770
  tagColor = 'cyan' // 青色
@@ -842,10 +877,14 @@ export default {
842
877
  }
843
878
  ajax.get(self.smartFlowServerContext + '/manage/processTodo/list', { params: param }).then(function (resp) {
844
879
  if (resp.data.code === '200') {
845
- self.curTaskId = resp.data.data.rows[0].taskId
846
- self.instanceId = resp.data.data.rows[0].procInstanceId
847
- self.curAuditGroup = resp.data.data.rows[0].auditGroup
848
- let procType = resp.data.data.rows[0].procType
880
+ let todoData = resp.data.data.rows[0]
881
+ self.curTaskId = todoData.taskId
882
+ self.instanceId = todoData.procInstanceId
883
+ self.curAuditGroup = todoData.auditGroup
884
+ self.revokeDelegateTask = todoData.delegateStatus ? todoData.delegateStatus === '10' : false
885
+ self.appointTask = todoData.delegateStatus ? todoData.delegateStatus === '20' : false
886
+ if (self.revokeDelegateTask) self.disable = true
887
+ let procType = todoData.procType
849
888
  ajax.get(self.smartFlowServerContext + '/manage/processType/lists?proType=' + procType)
850
889
  .then(resp => {
851
890
  let data = resp.data.data.rows
@@ -939,7 +978,7 @@ export default {
939
978
  if (resp.data.code === '200') {
940
979
  self.handleButtons = resp.data.data[0].handleButtons
941
980
  if (resp.data.data[0].hasOwnProperty('isSequential')) {
942
- self.isParallelCountersignature = !resp.data.data[0].isSequential
981
+ self.curNodeType = resp.data.data[0].isSequential ? 'sequentialMultiNode' : 'multiNode'
943
982
  }
944
983
  self.handleName = resp.data.data[0].handleName ? resp.data.data[0].handleName : '审批'
945
984
  self.auditOpinionTitle = resp.data.data[0].handleName ? resp.data.data[0].handleName + '意见' : '审批意见'
@@ -1115,7 +1154,7 @@ export default {
1115
1154
  self.businessFormSave ? self.businessFormSave(self.handleSaveResult) : self.handleSaveResult(true)
1116
1155
  return
1117
1156
  }
1118
- if (!self.handleButtons || self.handleButtons.includes('auditOpinion')) {
1157
+ if ((!self.handleButtons || self.handleButtons.includes('auditOpinion')) && self.auditResult !== '84') {
1119
1158
  self.$Message.error(`请输入${self.handleName}意见!`)
1120
1159
  return
1121
1160
  } else {
@@ -1142,15 +1181,57 @@ export default {
1142
1181
  name: self.handleButtonsNames[self.auditResult]
1143
1182
  }
1144
1183
  if (self.auditResult === '82') {
1184
+ //指定他人处理
1145
1185
  self.assigneeBoxData = self.auditParams
1146
1186
  self.assigneeBoxData.auditResultName = self.handleButtonsNames[self.auditResult]
1147
1187
  self.assigneeBoxData.instanceId = self.instanceId
1148
1188
  self.$refs.assigneeHelpBox.toggleShowHelpBox(self.organTreeType, '', 'transferCurTask')
1189
+ } else if (self.auditResult === '84') {
1190
+ //委派任务
1191
+ self.$refs.assigneeHelpBox.toggleShowHelpBox(self.organTreeType, '', 'delegateTask')
1192
+ } else if (self.auditResult === '62') {
1193
+ //撤回委派任务
1194
+ ajax.post(self.smartFlowServerContext + '/manage/processTodo/audit', self.auditParams).then(resp => {
1195
+ let result = resp.data
1196
+ if (result.code == '200') {
1197
+ self.loading = false
1198
+ self.disable = false
1199
+ self.revokeDelegateTask = false
1200
+ self.$Message.success('撤回委派成功')
1201
+ } else {
1202
+ self.loading = false
1203
+ self.disable = false
1204
+ self.$Message.error(result.message)
1205
+ }
1206
+ })
1207
+ } else if (self.auditResult === '61') {
1208
+ //交回委派任务
1209
+ ajax.post(self.smartFlowServerContext + '/manage/processTodo/audit', self.auditParams).then(resp => {
1210
+ let result = resp.data
1211
+ if (result.code == '200') {
1212
+ self.loading = false
1213
+ self.disable = false
1214
+ self.$Message.success('交回委派任务成功')
1215
+ if (result.data) {
1216
+ let taskIds = result.data.id ? result.data.id : result.data.map(item => item.id).join(',')
1217
+ setTimeout(() => {
1218
+ self.executionCompleted(true, result.data.id ? result.data.processInstanceId : result.data[0].processInstanceId, taskIds, auditResult, self.curTaskId)
1219
+ }, 1000)
1220
+ }
1221
+ } else {
1222
+ self.loading = false
1223
+ self.disable = false
1224
+ self.$Message.error(result.message)
1225
+ }
1226
+ })
1149
1227
  } else if (self.auditResult === '80') {
1228
+ //跳转到后序指定节点
1150
1229
  self.getNodesBehind()
1151
1230
  } else if (self.auditResult === '90') {
1231
+ //驳回到前序指定节点
1152
1232
  self.getAllPreNodes()
1153
1233
  } else if (self.auditResult === '40') {
1234
+ //驳回到上一级
1154
1235
  self.loading = true
1155
1236
  self.disable = true
1156
1237
  let url = self.smartFlowServerContext + '/manage/processTodo/getPreNode'
@@ -1345,6 +1426,39 @@ export default {
1345
1426
  console.log(err)
1346
1427
  })
1347
1428
  },
1429
+ //委派
1430
+ delegateTask(assignee) {
1431
+ const self = this
1432
+ if (!assignee){
1433
+ self.$Message.error('请选择加签人员')
1434
+ return
1435
+ }
1436
+ let auditResult = {
1437
+ code: self.auditResult,
1438
+ name: self.handleButtonsNames[self.auditResult]
1439
+ }
1440
+ self.auditParams.selectedUserId = assignee
1441
+ ajax.post(self.smartFlowServerContext + '/manage/processTodo/audit', self.auditParams).then(resp => {
1442
+ let result = resp.data
1443
+ if (result.code == '200') {
1444
+ self.loading = false
1445
+ self.disable = false
1446
+ self.$Message.success('委派成功')
1447
+ if (result.data) {
1448
+ let taskIds = result.data.id ? result.data.id : result.data.map(item => item.id).join(',')
1449
+ setTimeout(() => {
1450
+ self.executionCompleted(true, result.data.id ? result.data.processInstanceId : result.data[0].processInstanceId, taskIds, auditResult, self.curTaskId)
1451
+ }, 1000)
1452
+ }
1453
+ } else {
1454
+ self.loading = false
1455
+ self.disable = false
1456
+ self.$Message.error(result.message)
1457
+ }
1458
+ }).catch(err => {
1459
+ console.log(err)
1460
+ })
1461
+ },
1348
1462
  //加签
1349
1463
  addMultitaskInstance(assingeeList) {
1350
1464
  const assingees = assingeeList.join(',')
@@ -1653,6 +1767,17 @@ export default {
1653
1767
  node.needUpdate = true
1654
1768
  this.$forceUpdate()
1655
1769
  }
1770
+ },
1771
+ handleScroll(delta) {
1772
+ let modalElement = this.$refs.processTraceModal.$el
1773
+ for (let i = 0; i < modalElement.children.length; i++) {
1774
+ //找到目标element进行滚动
1775
+ let targetElement = modalElement.children[i]
1776
+ if (targetElement.classList.toString().includes('-wrap')){
1777
+ targetElement.scrollTop -= delta.dy
1778
+ break
1779
+ }
1780
+ }
1656
1781
  }
1657
1782
  },
1658
1783
  watch: {
@@ -60,6 +60,8 @@
60
60
  <Tag color="red" v-else-if="item.auditResult=='50'">驳回到原点</Tag>
61
61
  <Tag color="purple" v-else-if="item.auditResult=='51'">流程终止</Tag>
62
62
  <Tag color="blue" v-else-if="item.auditResult == '60'">撤回</Tag>
63
+ <Tag color="green" v-else-if="item.auditResult == '61'">交回委派任务</Tag>
64
+ <Tag color="blue" v-else-if="item.auditResult == '62'">委派任务被撤回</Tag>
63
65
  <Tag color="cyan" v-else-if="item.auditResult == '80'">跳转指定节点</Tag>
64
66
  <Tag color="cyan" v-else-if="item.auditResult == '83'">会签减签</Tag>
65
67
  <Tag color="magenta" v-else-if="item.auditResult == '90'">驳回指定节点</Tag>
@@ -176,6 +178,14 @@ export default {
176
178
  label = '撤回';
177
179
  tagColor = 'blue'; // 蓝色
178
180
  }
181
+ else if (row.auditResult == '61'){
182
+ label = '交回委派任务';
183
+ tagColor = 'green'; // 绿色
184
+ }
185
+ else if (row.auditResult == '62'){
186
+ label = '委派任务被撤回';
187
+ tagColor = 'blue'; // 蓝色
188
+ }
179
189
  else if (row.auditResult == '80'){
180
190
  label = '跳转到指定节点';
181
191
  tagColor = 'cyan'; // 青色
@@ -290,6 +300,11 @@ export default {
290
300
  ]
291
301
  });
292
302
 
303
+ //修改zoomScroll的scroll方法,将滚动事件抛出
304
+ zoomScroll.zoomScroll[1].prototype.scroll = (delta)=>{
305
+ this.$emit('scroll', delta)
306
+ }
307
+
293
308
  ajax.get(this.smartFlowServerContext + "/manage/processTodo/printData", {
294
309
  params: {
295
310
  applyId: this.applyId,