@lambo-design/workflow-approve 1.0.0-beta.66 → 1.0.0-beta.68

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/portrait.vue +111 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.66",
3
+ "version": "1.0.0-beta.68",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -13,7 +13,7 @@
13
13
  "axios": "^0.24.0",
14
14
  "axios-cache-plugin": "^0.1.0",
15
15
  "@lambo-design/core": "^4.7.1-beta.158",
16
- "@lambo-design/shared": "^1.0.0-beta.250"
16
+ "@lambo-design/shared": "^1.0.0-beta.253"
17
17
  },
18
18
  "dependencies": {
19
19
  "bpmn-js": "^7.3.1",
package/src/portrait.vue CHANGED
@@ -198,13 +198,19 @@
198
198
 
199
199
  <Modal v-model="modal1" title="选择节点"
200
200
  @on-cancel="cancel"
201
- @on-ok="doPass">
201
+ @on-ok="doJump">
202
202
  <Table border
203
203
  :data="allNode"
204
204
  :columns="nodeColumn"
205
205
  highlight-row
206
206
  @on-current-change="selectNode">
207
207
  </Table>
208
+ <Card v-if="showProcessControl && auditResult == '90'">
209
+ <p slot="title">选择驳回后流程流转方式:</p>
210
+ <RadioGroup v-model="rejectAttribute">
211
+ <Radio v-for="(item, index) in rejectAttributeList" :key="index" :label="item.type">{{item.name}}</Radio>
212
+ </RadioGroup>
213
+ </Card>
208
214
  </Modal>
209
215
  <assigneeBox ref="assigneeHelpBox" :execution-completed="executionCompleted"
210
216
  @update-selected="handleSelectedUser" @update-next-node-assignee="updateNextNodeAssignee"
@@ -314,6 +320,13 @@
314
320
  </Form>
315
321
  </Card>
316
322
  </Modal>
323
+ <Modal v-model="rejectAttributesBoxShow" title="选择被驳回任务通过后流程流转方式"
324
+ @on-cancel="rejectAttributesCancel"
325
+ @on-ok="rejectProcessWithRejectAttributes">
326
+ <RadioGroup v-model="rejectAttribute">
327
+ <Radio v-for="(item, index) in rejectAttributeList" :key="index" :label="item.type">{{item.name}}</Radio>
328
+ </RadioGroup>
329
+ </Modal>
317
330
  <candidateGroupsHelpBox ref="candidateGroupsHelpBox" :show="candidateGroupsHelpBoxShow"
318
331
  @update-cand-groups="updateCandGroups"
319
332
  :upms-server-context="upmsServerContext"
@@ -321,34 +334,34 @@
321
334
  <template slot="page-footer">
322
335
  <div>
323
336
  <slot name="footer-button"></slot>
324
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo70') && !isDetail && !appointTask"
337
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo70') && !isDetail && !appointTask && !rejectedTask"
325
338
  :disabled="disable" :loading="loading" @click="audit('70')">驳回到原点
326
339
  </Button>
327
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo40') && !isDetail && !appointTask"
340
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo40') && !isDetail && !appointTask && !rejectedTask"
328
341
  :disabled="disable" :loading="loading" @click="audit('40')">驳回上一节点
329
342
  </Button>
330
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo90') && !isDetail && !appointTask"
343
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo90') && !isDetail && !appointTask && !rejectedTask"
331
344
  :disabled="disable" :loading="loading" @click="audit('90')">驳回指定节点
332
345
  </Button>
333
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo80') && !isDetail && !appointTask"
346
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo80') && !isDetail && !appointTask && !rejectedTask"
334
347
  :disabled="disable" :loading="loading" @click="audit('80')">跳转指定节点
335
348
  </Button>
336
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo82') && !isDetail && !appointTask"
349
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo82') && !isDetail && !appointTask && !rejectedTask"
337
350
  :disabled="disable" :loading="loading" @click="audit('82')">指定他人处理
338
351
  </Button>
339
352
  <Button style="margin-left: 10px;"
340
- v-if="curNodeType === 'userTask' && handleButtons && handleButtons.includes('delegateTask') && !isDetail && !appointTask"
353
+ v-if="curNodeType === 'userTask' && handleButtons && handleButtons.includes('delegateTask') && !isDetail && !appointTask && !rejectedTask"
341
354
  :disabled="disable" :loading="loading" @click="audit('84')">委派
342
355
  </Button>
343
356
  <Button style="margin-left: 10px;"
344
- v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('addMultitaskInstance') && !isDetail && !appointTask"
357
+ v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('addMultitaskInstance') && !isDetail && !appointTask && !rejectedTask"
345
358
  :disabled="disable" :loading="loading" @click="showUpdateMultitaskInstanceModal('81')">加签
346
359
  </Button>
347
360
  <Button style="margin-left: 10px;"
348
- v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('reductionMultitaskInstance') && !isDetail && !appointTask"
361
+ v-if="curNodeType === 'multiNode' && handleButtons && handleButtons.includes('reductionMultitaskInstance') && !isDetail && !appointTask && !rejectedTask"
349
362
  :disabled="disable" :loading="loading" @click="showUpdateMultitaskInstanceModal('83')">减签
350
363
  </Button>
351
- <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo50') && !isDetail && !appointTask"
364
+ <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('auditTo50') && !isDetail && !appointTask && !rejectedTask"
352
365
  :disabled="disable" :loading="loading" @click="audit('50')">直接结束流程
353
366
  </Button>
354
367
  <Button style="margin-left: 10px;" v-if="handleButtons && handleButtons.includes('processTrace')"
@@ -444,6 +457,12 @@ export default {
444
457
  required: false,
445
458
  default: 'click',
446
459
  },
460
+ //驳回后是否可控制流程流转
461
+ showProcessControl: {
462
+ type: Boolean,
463
+ required: false,
464
+ default: true,
465
+ },
447
466
  //业务表单保存方法
448
467
  businessFormSave: {
449
468
  type: Function,
@@ -506,8 +525,12 @@ export default {
506
525
  reductionMultitaskInstanceModal: false,
507
526
  candidateGroupsHelpBoxShow: false,
508
527
  appointBoxShow: false,
528
+ rejectAttributesBoxShow: false,
529
+ rejectAttributes: {},
509
530
  autoOpenNode: '0',
510
531
  unapprovedAssigneeList: [],
532
+ rejectAttribute: 'inSequence',
533
+ rejectAttributeList: [],
511
534
  reductionAssigneeList: [],
512
535
  nextNodesOldSettings: [],
513
536
  nextNodesFormList: [],
@@ -526,6 +549,7 @@ export default {
526
549
  },
527
550
  loading: false,
528
551
  disable: false,
552
+ rejectedTask: false,
529
553
  revokeDelegateTask: false,
530
554
  appointTask: false,
531
555
  instanceId: '',
@@ -949,6 +973,11 @@ export default {
949
973
  self.instanceId = todoData.procInstanceId
950
974
  self.curAuditGroup = todoData.auditGroup
951
975
  self.revokeDelegateTask = todoData.delegateStatus ? todoData.delegateStatus === '10' : false
976
+ const taskExtensionAttributes = todoData.taskExtensionAttributes ? JSON.parse(todoData.taskExtensionAttributes) : ''
977
+ if (taskExtensionAttributes && taskExtensionAttributes.rejectAttributes) {
978
+ const rejectAttributes = taskExtensionAttributes.rejectAttributes
979
+ if (rejectAttributes && rejectAttributes.type && rejectAttributes.type != 'inSequence') self.rejectedTask = true
980
+ }
952
981
  self.appointTask = todoData.delegateStatus ? todoData.delegateStatus === '20' : false
953
982
  if (self.revokeDelegateTask) self.disable = true
954
983
  let procType = todoData.procType
@@ -1296,6 +1325,7 @@ export default {
1296
1325
  self.getNodesBehind()
1297
1326
  } else if (self.auditResult === '90') {
1298
1327
  //驳回到前序指定节点
1328
+ self.showProcessControl ? self.getProcessAttributes() : ''
1299
1329
  self.getAllPreNodes()
1300
1330
  } else if (self.auditResult === '40') {
1301
1331
  //驳回到上一级
@@ -1354,39 +1384,15 @@ export default {
1354
1384
  self.executionCompleted(true, null, null, auditResult, self.curTaskId)
1355
1385
  }, 1000)
1356
1386
  } else {
1357
- self.loading = true
1358
- self.disable = true
1359
- let url = self.smartFlowServerContext + '/manage/processTodo/audit'
1360
- ajax.post(url, self.auditParams).then(function (resp) {
1361
- let result = resp.data
1362
- if (result.code == '200') {
1363
- self.loading = false
1364
- self.disable = false
1365
- self.$Message.success(result.message)
1366
- setTimeout(() => {
1367
- if (result.data) {
1368
- let taskIds = result.data.map(item => item.id).join(',')
1369
- self.executionCompleted(true, result.data[0].processInstanceId, taskIds, auditResult, self.curTaskId)
1370
- } else {
1371
- self.executionCompleted(true, null, null, auditResult, self.curTaskId)
1372
- }
1373
- }, 1000)
1374
- } else {
1375
- self.loading = false
1376
- self.disable = false
1377
- self.$Message.error(result.message)
1378
- setTimeout(() => {
1379
- self.executionCompleted(false, null, null, auditResult, self.curTaskId)
1380
- }, 1000)
1381
- }
1382
- bus.$emit('triggerTimer')
1383
- })
1387
+ self.showProcessControl ? self.getProcessAttributes() : self.doPass()
1384
1388
  }
1385
1389
  })
1386
1390
  } else {
1387
- if (self.auditResult === '30' && (!self.handleButtons || self.handleButtons.includes('appointHandler') || self.handleButtons.includes('appointTimeoutTime'))) {
1391
+ if (self.auditResult === '30' && !self.rejectedTask && (!self.handleButtons || self.handleButtons.includes('appointHandler') || self.handleButtons.includes('appointTimeoutTime'))) {
1388
1392
  self.getNextNodes()
1389
1393
  self.appointBoxShow = true
1394
+ } else if (self.showProcessControl && self.auditResult === '70'){
1395
+ self.getProcessAttributes()
1390
1396
  } else {
1391
1397
  self.doPass()
1392
1398
  }
@@ -1451,6 +1457,12 @@ export default {
1451
1457
  })
1452
1458
  }
1453
1459
  },
1460
+ doJump(){
1461
+ if (this.auditResult === '90'){
1462
+ this.auditParams.rejectAttribute = this.rejectAttribute ? this.rejectAttribute :'inSequence'
1463
+ }
1464
+ this.doPass()
1465
+ },
1454
1466
  showUpdateMultitaskInstanceModal(updateType) {
1455
1467
  const self = this
1456
1468
  if (updateType === '81') {
@@ -1540,6 +1552,10 @@ export default {
1540
1552
  const assingees = this.reductionAssigneeList.map(item => item.auditId).join(',')
1541
1553
  this.updateMultitaskInstance('83', assingees)
1542
1554
  },
1555
+ rejectProcessWithRejectAttributes(){
1556
+ this.auditParams.rejectAttribute = this.rejectAttribute ? this.rejectAttribute :'inSequence'
1557
+ this.doPass()
1558
+ },
1543
1559
 
1544
1560
  doSearch() {
1545
1561
  //不需要实现,是子组件assigneeBox要求使用父组件的这个方法
@@ -1627,11 +1643,18 @@ export default {
1627
1643
  cancel() {
1628
1644
  this.modal = false
1629
1645
  this.auditResult = ''
1646
+ this.rejectAttribute = 'inSequence'
1630
1647
  },
1631
1648
  reductionModalCancel() {
1632
1649
  this.reductionMultitaskInstanceModal = false
1633
1650
  this.reductionAssigneeList = []
1634
1651
  },
1652
+ rejectAttributesCancel() {
1653
+ this.rejectAttributesBoxShow = false
1654
+ this.rejectAttribute = 'inSequence'
1655
+ this.loading = false
1656
+ this.disable = false
1657
+ },
1635
1658
  selectAssignee(selection) {
1636
1659
  this.reductionAssigneeList = selection
1637
1660
  },
@@ -1835,6 +1858,56 @@ export default {
1835
1858
  this.$forceUpdate()
1836
1859
  }
1837
1860
  },
1861
+ getProcessAttributes(){
1862
+ const self = this
1863
+ let params = {
1864
+ procId: self.procId,
1865
+ taskNode: self.taskNode
1866
+ }
1867
+ self.rejectAttributeList = [{
1868
+ _checked: true,
1869
+ type: 'inSequence',
1870
+ name: '按顺序流转'
1871
+ }]
1872
+
1873
+ ajax.get(self.smartFlowServerContext + '/manage/processTodo/getProcessAttributes', { params: params }).then(function (resp) {
1874
+ if (resp.data.code === '200') {
1875
+ if ((self.auditParams.auditResult == '70' && !resp.data.data.jumpFirstNode) || (self.auditParams.auditResult == '40' && (resp.data.data.multiNode || resp.data.data.preNodeGateway))){
1876
+ self.doPass()
1877
+ return
1878
+ } else {
1879
+ if (self.auditParams.auditResult == '40'){
1880
+ self.rejectAttributeList.push(
1881
+ {
1882
+ type: 'returnToCurrentAuditUser',
1883
+ name: '返回我'
1884
+ }
1885
+ )
1886
+ } else {
1887
+ self.rejectAttributeList.push(
1888
+ {
1889
+ type: 'returnToCurrentNode',
1890
+ name: '返回本节点'
1891
+ }
1892
+ )
1893
+ if (!resp.data.data.multiNode){
1894
+ self.rejectAttributeList.push(
1895
+ {
1896
+ type: 'returnToCurrentAuditUser',
1897
+ name: '返回我'
1898
+ }
1899
+ )
1900
+ }
1901
+ }
1902
+ if (self.auditParams.auditResult != '90') self.rejectAttributesBoxShow = true
1903
+ }
1904
+ } else {
1905
+ self.$Message.error(resp.data.message)
1906
+ }
1907
+ }).catch((err) => {
1908
+ console.log(err)
1909
+ })
1910
+ }
1838
1911
  },
1839
1912
  watch: {
1840
1913
  auditOpinionText(label) {