Browse Source

将客户以及项目外的其他驳回流程改为旧版驳回

lizhenhao 2 years ago
parent
commit
f95cb31b43
1 changed files with 55 additions and 33 deletions
  1. 55 33
      src/views/modules/flowable/task/TaskForm.vue

+ 55 - 33
src/views/modules/flowable/task/TaskForm.vue

@@ -451,41 +451,63 @@
       },
       // 驳回
       reject (vars) {
-        this.$confirm(`确定驳回流程吗?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          if (this.formType === '2') {
-            if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
-              await setTimeout(() => {
+        if (this.procDefId.includes('Process_1667978088459') || this.procDefId.includes('UserTask_07ofhqm') || this.procDefId.includes('Process_1668394732246') || this.procDefId.includes('UserTask_0a4v9r9')) {
+          console.log('进入新版驳回')
+          this.$confirm(`确定驳回流程吗?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async () => {
+            if (this.formType === '2') {
+              if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
+                await setTimeout(() => {
+                  vars = {...vars, agree: false}
+                  this.commit(vars) // 驳回
+                }, 100)
+                this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
+                  this.auditForm.candidateUserList = inputForm.assignee
+                })
+              } else {
                 vars = {...vars, agree: false}
-                this.commit(vars) // 驳回
-                // this.taskService.backNodes(this.taskId).then(({data}) => {
-                //   let backNodes = data
-                //   if (backNodes.length > 0) {
-                //     let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
-                //     this.back(backTaskDefKey)
-                //   }
-                // })
-              }, 100)
-              this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
-                this.auditForm.candidateUserList = inputForm.assignee
-              })
-            } else {
-              vars = {...vars, agree: false}
-              await this.commit(vars) // 驳回
-              this.$refs.form.updateStatusById('reject')
-              // this.taskService.backNodes(this.taskId).then(({data}) => {
-              //   let backNodes = data
-              //   if (backNodes.length > 0) {
-              //     let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
-              //     this.back(backTaskDefKey)
-              //   }
-              // })
+                await this.commit(vars) // 驳回
+                this.$refs.form.updateStatusById('reject')
+              }
             }
-          }
-        })
+          })
+        } else {
+          console.log('进入旧版驳回')
+          this.$confirm(`确定驳回流程吗?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async () => {
+            if (this.formType === '2') {
+              if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
+                await this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
+                  this.auditForm.candidateUserList = inputForm.assignee
+                })
+                setTimeout(() => {
+                  this.taskService.backNodes(this.taskId).then(({data}) => {
+                    let backNodes = data
+                    if (backNodes.length > 0) {
+                      let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
+                      this.back(backTaskDefKey)
+                    }
+                  })
+                }, 100)
+              } else {
+                await this.$refs.form.updateStatusById('reject')
+                this.taskService.backNodes(this.taskId).then(({data}) => {
+                  let backNodes = data
+                  if (backNodes.length > 0) {
+                    let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
+                    this.back(backTaskDefKey)
+                  }
+                })
+              }
+            }
+          })
+        }
       },
       // 驳回至指定节点(节点是从0开始)
       rejectToPointNum (num) {